v8toolkit  0.0.1
Utility library for embedding V8 Javascript engine in a c++ program
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
v8toolkit::JSWrapperBase Class Reference

#include <bidirectional.h>

Inheritance diagram for v8toolkit::JSWrapperBase:
Inheritance graph
[legend]
Collaboration diagram for v8toolkit::JSWrapperBase:
Collaboration graph
[legend]

Public Member Functions

v8::Local< v8::Object > get_javascript_object () const
 

Protected Member Functions

 JSWrapperBase (v8::Local< v8::Context > context, v8::Local< v8::Object > object, v8::Local< v8::FunctionTemplate > created_by)
 

Protected Attributes

v8::Isolate * isolate
 
v8::Global< v8::Context > global_context
 
v8::Global< v8::Object > global_js_object
 
v8::Global< v8::FunctionTemplate > global_created_by
 
bool called_from_javascript = false
 

Detailed Description

Definition at line 36 of file bidirectional.h.

Constructor & Destructor Documentation

v8toolkit::JSWrapperBase::JSWrapperBase ( v8::Local< v8::Context >  context,
v8::Local< v8::Object >  object,
v8::Local< v8::FunctionTemplate >  created_by 
)
inlineprotected

Definition at line 52 of file bidirectional.h.

Member Function Documentation

v8::Local<v8::Object> v8toolkit::JSWrapperBase::get_javascript_object ( ) const
inline

Definition at line 61 of file bidirectional.h.

Referenced by v8toolkit::CastToJS< JSWrapper< T > >::operator()().

Here is the caller graph for this function:

Member Data Documentation

v8::Isolate* v8toolkit::JSWrapperBase::isolate
protected

Definition at line 38 of file bidirectional.h.

v8::Global<v8::Context> v8toolkit::JSWrapperBase::global_context
protected

Definition at line 39 of file bidirectional.h.

v8::Global<v8::Object> v8toolkit::JSWrapperBase::global_js_object
protected

Definition at line 40 of file bidirectional.h.

v8::Global<v8::FunctionTemplate> v8toolkit::JSWrapperBase::global_created_by
protected

Definition at line 41 of file bidirectional.h.

bool v8toolkit::JSWrapperBase::called_from_javascript = false
mutableprotected

It's easy to end up in infinite recursion where the JSWrapper object looks for a javascript implementation to call instead of calling the native C++ implementation, but finds its own JS_ACCESS function that its already in an proceeds to call itself. This flag stops that from happening - at least in naive situations. Marked as mutable because it needs to be changed even from within const methods

Definition at line 49 of file bidirectional.h.


The documentation for this class was generated from the following file: