![]() |
RTBKit
0.9
Open-source framework to create real-time ad bidding systems.
|
Static Public Member Functions | |
template<class T > | |
static T * | unwrap (const v8::Handle< v8::Object > &handle) |
Public Attributes | |
v8::Persistent< v8::Object > | js_object_ |
std::shared_ptr< void > | owner_ |
Protected Member Functions | |
void | wrap (v8::Handle< v8::Object > handle, size_t object_size, const std::type_info &wrappedType) |
void | registerForGarbageCollection () |
virtual void | ref () |
virtual void | unref () |
virtual void | dispose () |
virtual v8::WeakReferenceCallback | getGarbageCollectionCallback () const |
virtual std::string | getJsTypeName () const |
Static Protected Member Functions | |
static void | Setup (const v8::Persistent< v8::FunctionTemplate > &ft, const std::string &name, const v8::Handle< v8::Object > &target) |
template<typename Wrapper > | |
static v8::Handle< v8::Value > | createExtendedObject (const v8::Arguments &args) |
template<typename Wrapper > | |
static v8::Handle< v8::Value > | extendImpl (const v8::Arguments &args) |
static v8::Persistent < v8::FunctionTemplate > | RegisterBase (const char *name, const char *module, v8::InvocationCallback constructor, SetupFunction setup=Setup) |
Definition at line 60 of file js_wrapped.h.
static v8::Handle<v8::Value> Datacratic::JS::JSWrappedBase::createExtendedObject | ( | const v8::Arguments & | args | ) | [inline, static, protected] |
Helper function that acts as a constructor for when we're creating an object from a C++ class extended by a Javascript class. It creates a different class (which is JS compatible) and replaces the prototype of that class with the prototype of the desired class so that inheritance works as expected.
Definition at line 185 of file js_wrapped.h.
void Datacratic::JS::JSWrappedBase::dispose | ( | ) | [protected, virtual] |
Method called to actually dispose of an object once everything is finished. This function won't be called if deleter() is overridden. Default simply uses operator delete.
Definition at line 124 of file js_wrapped.cc.
static v8::Handle<v8::Value> Datacratic::JS::JSWrappedBase::extendImpl | ( | const v8::Arguments & | args | ) | [inline, static, protected] |
Helper function that can be called to implement an "extend" class method. This works in concert with createExtendedObject. See recommendation_js.cc for examples.
Definition at line 214 of file js_wrapped.h.
v8::WeakReferenceCallback Datacratic::JS::JSWrappedBase::getGarbageCollectionCallback | ( | ) | const [protected, virtual] |
Method to return the deleter function. By default, it's the weakCallback function below, which will delete with the dispose() method. Override to use something else.
Definition at line 133 of file js_wrapped.cc.
void Datacratic::JS::JSWrappedBase::registerForGarbageCollection | ( | ) | [protected] |
Set this object up to be garbage collected once there are no more references to it in the javascript.
Definition at line 98 of file js_wrapped.cc.
void Datacratic::JS::JSWrappedBase::wrap | ( | v8::Handle< v8::Object > | handle, |
size_t | object_size, | ||
const std::type_info & | wrappedType | ||
) | [protected] |
Set up the object by making handle contain an external reference to the given object.
Definition at line 75 of file js_wrapped.cc.
std::shared_ptr<void> Datacratic::JS::JSWrappedBase::owner_ |
If there is an object that owns this and must stay alive for this JS object to be valid, then it goes here.
Definition at line 83 of file js_wrapped.h.