Changeset View
Changeset View
Standalone View
Standalone View
source/scriptinterface/ScriptInterface.h
Show First 20 Lines • Show All 105 Lines • ▼ Show 20 Lines | public: | ||||
* Constructor. | * Constructor. | ||||
* @param nativeScopeName Name of global object that functions (via ScriptFunction::Register) will | * @param nativeScopeName Name of global object that functions (via ScriptFunction::Register) will | ||||
* be placed into, as a scoping mechanism; typically "Engine" | * be placed into, as a scoping mechanism; typically "Engine" | ||||
* @param debugName Name of this interface for CScriptStats purposes. | * @param debugName Name of this interface for CScriptStats purposes. | ||||
* @param context ScriptContext to use when initializing this interface. | * @param context ScriptContext to use when initializing this interface. | ||||
*/ | */ | ||||
ScriptInterface(const char* nativeScopeName, const char* debugName, const shared_ptr<ScriptContext>& context); | ScriptInterface(const char* nativeScopeName, const char* debugName, const shared_ptr<ScriptContext>& context); | ||||
/** | |||||
* Alternate constructor. This creates the new Realm in the same Compartment as the neighbor scriptInterface. | |||||
* This means that data can be freely exchanged between these two script interfaces without cloning. | |||||
* @param nativeScopeName Name of global object that functions (via ScriptFunction::Register) will | |||||
* be placed into, as a scoping mechanism; typically "Engine" | |||||
* @param debugName Name of this interface for CScriptStats purposes. | |||||
* @param scriptInterface 'Neighbor' scriptInterface to share a compartment with. | |||||
*/ | |||||
ScriptInterface(const char* nativeScopeName, const char* debugName, const ScriptInterface& neighbor); | |||||
~ScriptInterface(); | ~ScriptInterface(); | ||||
struct CmptPrivate | struct CmptPrivate | ||||
{ | { | ||||
ScriptInterface* pScriptInterface; // the ScriptInterface object the compartment belongs to | ScriptInterface* pScriptInterface; // the ScriptInterface object the compartment belongs to | ||||
void* pCBData; // meant to be used as the "this" object for callback functions | void* pCBData; // meant to be used as the "this" object for callback functions | ||||
} m_CmptPrivate; | } m_CmptPrivate; | ||||
▲ Show 20 Lines • Show All 507 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator