![]() |
VR-Forces Developer's Guide
|
Subclass this class in order to provide extensions to the LUA interface. In order to be considered a valid extension it must implement bindLuaFunctions() and have a static creator function. This class will be created for each script implementation and methods bound to the lua_state provided. Use the DtLuaScriptInterfaceImpl::addExtension method to add a new extension for all lua task environments. Use DtLocalObject::addScriptExtension() to add an extension for a specific entity only.

Public Types | |
| typedef DtLuaScriptInterfaceExtension *(* | CreatorFcn )(void *usr) |
| typedef std::pair < DtLuaScriptInterfaceExtension::CreatorFcn, void * > | CreatorUserPair |
Public Member Functions | |
| virtual | ~DtLuaScriptInterfaceExtension () |
| virtual void | bindLuaFunctions (DtLocalObject *, const DtString &scriptId, lua_State *)=0 |
| virtual void | cleanup (lua_State *)=0 |
| virtual void | clearBackingPointer (void *) |
| typedef DtLuaScriptInterfaceExtension*(* DtLuaScriptInterfaceExtension::CreatorFcn)(void *usr) |
Prototype for DtLuaScriptInterfaceExtension creator function.
| typedef std::pair<DtLuaScriptInterfaceExtension::CreatorFcn, void*> DtLuaScriptInterfaceExtension::CreatorUserPair |
|
inlinevirtual |
|
pure virtual |
Bind any methods that are part of this class to the lua_state. The object supplied is the entity that is used for this bound script.
Implemented in DtBindableLuaComponentExtension.
|
pure virtual |
Called to cleanup any state. The most important thing would be to clean up any global space, for example if you have added a global space as:
luabind::globals(L)["myModule"] = this;
You will need to, in this cleanup call, do:
luabind::globals(L)["myModule"] = luabind::object();
Implemented in DtBindableLuaComponentExtension.
|
inlinevirtual |
Called when the object that backs this extension is about to be destroyed. Implementations should null out any raw pointer they hold to usr. The default implementation is a no-op.
Reimplemented in DtBindableLuaComponentExtension.