VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions
DtLuaScriptInterfaceExtension Class Referenceabstract

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.

Related Examples
Inheritance diagram for DtLuaScriptInterfaceExtension:
Inheritance graph
[legend]

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 *)
 

Member Typedef Documentation

typedef DtLuaScriptInterfaceExtension*(* DtLuaScriptInterfaceExtension::CreatorFcn)(void *usr)

Prototype for DtLuaScriptInterfaceExtension creator function.

Constructor & Destructor Documentation

virtual DtLuaScriptInterfaceExtension::~DtLuaScriptInterfaceExtension ( )
inlinevirtual

Member Function Documentation

virtual void DtLuaScriptInterfaceExtension::bindLuaFunctions ( DtLocalObject *  ,
const DtString &  scriptId,
lua_State *   
)
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.

virtual void DtLuaScriptInterfaceExtension::cleanup ( lua_State *  )
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.

virtual void DtLuaScriptInterfaceExtension::clearBackingPointer ( void *  )
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.


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

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)