![]() |
RTBKit
0.9
Open-source framework to create real-time ad bidding systems.
|
#include <js_wrapped.h>
Public Types | |
typedef Shared | shared_type |
typedef Base::base_shared_type | base_shared_type |
typedef Base::root_type | root_type |
typedef Base::root_shared_type | root_shared_type |
typedef boost::is_base_of < Base, Wrapper > | WrapperIsDerivedFromBase |
typedef boost::is_base_of < typename Base::shared_type, Shared > | SharedIsDerivedFromBaseShared |
typedef JSWrapped3< Shared, Wrapper, Base, ClassNameT, ModuleNameT, defaultWrapper > | WrapperType |
Public Member Functions | |
virtual size_t | memusage (void *object) const |
Static Public Member Functions | |
static v8::Local< v8::Object > | toJS (const std::shared_ptr< Shared > &shared) |
template<typename Owner > | |
static v8::Local< v8::Object > | toJS (Shared &shared, const std::shared_ptr< Owner > &owner) |
static std::shared_ptr< Shared > | fromJS (v8::Handle< v8::Object > obj) |
static Wrapper * | getWrapper (v8::Handle< v8::Value > handle) |
static Wrapper * | getWrapper (const v8::Arguments &args) |
static Shared * | getShared (v8::Handle< v8::Value > handle) |
static Shared * | getShared (const v8::Arguments &args) |
static std::shared_ptr< Shared > | getSharedPtr (v8::Handle< v8::Value > handle) |
static std::shared_ptr< Shared > | getSharedPtr (const v8::Arguments &args) |
static void | setShared (v8::Handle< v8::Value > handle, const std::shared_ptr< Shared > &shared) |
template<typename Owner > | |
static void | setShared (v8::Handle< v8::Value > handle, Shared &shared, const std::shared_ptr< Owner > &owner) |
static v8::Handle< v8::Value > | NoConstructor (const v8::Arguments &args) |
static v8::Handle< v8::Value > | wrapperType (const v8::Arguments &args) |
static void | addMethods () |
static v8::Persistent < v8::FunctionTemplate > | Register (SetupFunction setup=Base::Setup) |
static v8::Persistent < v8::FunctionTemplate > | Register (v8::InvocationCallback constructor, SetupFunction setup=Base::Setup) |
static v8::Local< v8::Object > | constructMe (void *smart_ptr, const void *object) |
static void | unwrapMe (const v8::Handle< v8::Value > &wrapper, void *outputPtr, const std::type_info &wrapperType) |
static void | InitializeFunction () |
static void | DestructionFunction () |
template<typename T , typename Obj > | |
static void | registerRWProperty (T(Obj::*ptr), const char *name, unsigned options=v8::DontDelete) |
template<typename T , typename Obj > | |
static void | registerROProperty (T(Obj::*ptr), const char *name, unsigned options=v8::DontDelete|v8::ReadOnly) |
template<typename T , typename Obj > | |
static void | registerROProperty (T(Obj::*pmf)() const, const char *name, unsigned options=v8::DontDelete|v8::ReadOnly) |
template<typename R , typename Obj , typename... Args> | |
static void | registerAsyncCallback (boost::function< R(Args...)>(Obj::*ptr), const char *name, unsigned options=v8::DontDelete) |
template<typename R , typename Obj , typename... Args> | |
static void | registerMemberFn (R(Obj::*pmf)(Args...args) const, const char *name) |
template<typename R , typename Obj , typename... Args> | |
static void | registerMemberFn (R(Obj::*pmf)(Args...args), const char *name) |
static v8::Handle< v8::Value > | extend (const v8::Arguments &args) |
Static Public Attributes | |
static const char *const & | ClassName = ClassNameT |
static const char *const & | Module = ModuleNameT |
static v8::Persistent < v8::FunctionTemplate > | tmpl |
static DoInitialize | initializer |
A wrapped object with a base class. This sets up the given Wrapper class (which must derive from JSWrapped3 in the curiously recurring template pattern) to wrap an object derived from that wrapped in Base. For example,
class Base { virtual ~Base(); };
class BaseJS: public JSWrapped2<Base, BaseJS> { };
class DerivedJS: public JSWrapped3<Derived, DerivedJS, BaseJS> { };
The methods described in BaseJS will be available to DerivedJS via the prototype of DerivedJS.
Definition at line 1099 of file js_wrapped.h.
static v8::Local<v8::Object> Datacratic::JS::JSWrapped3< Shared, Wrapper, Base, ClassNameT, ModuleNameT, defaultWrapper >::constructMe | ( | void * | smart_ptr, |
const void * | object | ||
) | [inline, static] |
Function used by the registry to construct this object from a shared pointer to a base class. Used by the magic that allows a wrapper to be found by the registry for any derived class of a base.
Does manipulation of the internals of a shared pointer. Not for the unwary.
Reimplemented in Datacratic::JS::JSWrapped3< ReDerived, ReDerivedJS, DerivedJS, ReDerivedName, Module >.
Definition at line 1312 of file js_wrapped.h.