RTBKit  0.9
Open-source framework to create real-time ad bidding systems.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions
Datacratic::JS::JSWrappedBase Class Reference
Inheritance diagram for Datacratic::JS::JSWrappedBase:
Datacratic::JS::JSWrapped< Shared > Datacratic::JS::WrappedArrayJS Datacratic::JS::WrappedFundamentalValueArrayJS Datacratic::JS::WrappedStructureJS Datacratic::JS::WrappedValueArrayJS Datacratic::JS::JSWrapped< AdSpot > Datacratic::JS::JSWrapped< Amount > Datacratic::JS::JSWrapped< ArityTestClass > Datacratic::JS::JSWrapped< Auction > Datacratic::JS::JSWrapped< Banker > Datacratic::JS::JSWrapped< Base > Datacratic::JS::JSWrapped< Base2 > Datacratic::JS::JSWrapped< Bid > Datacratic::JS::JSWrapped< BidRequest > Datacratic::JS::JSWrapped< Bids > Datacratic::JS::JSWrapped< CarbonConnector > Datacratic::JS::JSWrapped< Filter > Datacratic::JS::JSWrapped< FromTo > Datacratic::JS::JSWrapped< Location > Datacratic::JS::JSWrapped< Logger > Datacratic::JS::JSWrapped< LogOutput > Datacratic::JS::JSWrapped< OutputStream > Datacratic::JS::JSWrapped< RemoteInput > Datacratic::JS::JSWrapped< RTBKIT::BiddingAgent > Datacratic::JS::JSWrapped< RTBKIT::RouterStack > Datacratic::JS::JSWrapped< S3Api > Datacratic::JS::JSWrapped< SegmentList > Datacratic::JS::JSWrapped< SegmentsBySource > Datacratic::JS::JSWrapped< ServiceBase > Datacratic::JS::JSWrapped< ServiceProxies > Datacratic::JS::JSWrapped< SignalSlotTest > Datacratic::JS::JSWrapped< Slot > Datacratic::JS::JSWrapped< TestException > Datacratic::JS::JSWrapped< UserIds >

List of all members.

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)

Detailed Description

Definition at line 60 of file js_wrapped.h.


Member Function Documentation

template<typename Wrapper >
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.

template<typename Wrapper >
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.

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.


Member Data Documentation

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.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator