VR-Forces 4.0.4 Class Documentation
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes
vrfLua::DtLuaScriptManager Class Reference

Manager for using Lua scripts. More...

Inheritance diagram for vrfLua::DtLuaScriptManager:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtLuaScriptManager (DtCgf *cgf)
 constructor
virtual ~DtLuaScriptManager ()
 destructor
virtual bool initializeLua ()
virtual bool initializeVRFLuaExtensions (lua_State *L)
 Initialize all global functions.
virtual bool initializeVRFObject (lua_State *L, DtVrfObject *vrfObject)
 Initialize all functions in a VRF Object, putting it on top of the stack.
virtual bool initializeThisVRFObject (lua_State *L, DtVrfObject *vrfObject)
DtCgfgetCgf () const
virtual void reloadScriptForAllConcernedKynapseEntities (const DtString &scriptName, const DtString &scriptFullPath)

Protected Member Functions

virtual void processRequestLuaScripts (DtSimMessage *msg)
virtual void processRequestScriptText (DtSimMessage *msg)
virtual void processSetScriptText (DtSimMessage *msg)
virtual void processDeleteScript (DtSimMessage *msg)
virtual void processObjectAdded (DtVrfObject *vrfObject)
 when an object is added
virtual void processObjectRemoved (DtVrfObject *vrfObject)
 remove it from the World
virtual DtLuaScriptControllercreateLuaComponent (DtVrfObject *vrfObject)
 Add the Lua component to the passed entity.
virtual void sendScriptList ()
 Sends the current script list to the GUI.
virtual std::vector< DtStringscriptNamesOnDisk ()
 Returns the names of all the scripts available on the disk.
virtual void sendScriptText (const DtString &scriptName)
 Sends the text of the specified script onto the network.
virtual void saveScriptText (const DtString &scriptName, const std::list< DtString > &scriptLines)
 Saves the script to the disk.
virtual bool deleteScript (const DtString &scriptName)
 Deletes the named script from the disk.

Static Protected Member Functions

static void requestLuaScriptsCallback (DtSimMessage *msg, void *usr)
static void requestScriptTextCallback (DtSimMessage *msg, void *usr)
static void setScriptTextCallback (DtSimMessage *msg, void *usr)
static void deleteScriptCallback (DtSimMessage *msg, void *usr)
static void objectAddedCallback (DtVrfObject *vrfObject, void *usr)
 used as a static adapter to processObjectAdded
static void objectRemovedCallback (DtVrfObject *vrfObject, void *usr)
 used as a static adapter to processObjectRemoved

Protected Attributes

DtCgfmyCgf
 pointer to main VRF application
DtLuaScriptDescriptormyLuaDescriptor

Static Protected Attributes

static struct luaL_reg myVrfLib []
static struct luaL_reg myVrfObjLib []
static struct luaL_reg myThisVrfObjLib []

Detailed Description

Manager for using Lua scripts.

This manager initializes Lua, as well as provides supporting functions for it.


Constructor & Destructor Documentation

constructor

destructor


Member Function Documentation

virtual bool vrfLua::DtLuaScriptManager::initializeVRFLuaExtensions ( lua_State *  L) [virtual]

Initialize all global functions.

Reimplemented in vrfLua::DtBhaveLuaScriptManager.

virtual bool vrfLua::DtLuaScriptManager::initializeVRFObject ( lua_State *  L,
DtVrfObject vrfObject 
) [virtual]

Initialize all functions in a VRF Object, putting it on top of the stack.

virtual bool vrfLua::DtLuaScriptManager::initializeThisVRFObject ( lua_State *  L,
DtVrfObject vrfObject 
) [virtual]
virtual void vrfLua::DtLuaScriptManager::reloadScriptForAllConcernedKynapseEntities ( const DtString scriptName,
const DtString scriptFullPath 
) [virtual]
static void vrfLua::DtLuaScriptManager::requestLuaScriptsCallback ( DtSimMessage msg,
void *  usr 
) [static, protected]
virtual void vrfLua::DtLuaScriptManager::processRequestLuaScripts ( DtSimMessage msg) [protected, virtual]
static void vrfLua::DtLuaScriptManager::requestScriptTextCallback ( DtSimMessage msg,
void *  usr 
) [static, protected]
virtual void vrfLua::DtLuaScriptManager::processRequestScriptText ( DtSimMessage msg) [protected, virtual]
static void vrfLua::DtLuaScriptManager::setScriptTextCallback ( DtSimMessage msg,
void *  usr 
) [static, protected]
virtual void vrfLua::DtLuaScriptManager::processSetScriptText ( DtSimMessage msg) [protected, virtual]
static void vrfLua::DtLuaScriptManager::deleteScriptCallback ( DtSimMessage msg,
void *  usr 
) [static, protected]
virtual void vrfLua::DtLuaScriptManager::processDeleteScript ( DtSimMessage msg) [protected, virtual]
static void vrfLua::DtLuaScriptManager::objectAddedCallback ( DtVrfObject vrfObject,
void *  usr 
) [static, protected]

used as a static adapter to processObjectAdded

virtual void vrfLua::DtLuaScriptManager::processObjectAdded ( DtVrfObject vrfObject) [protected, virtual]

when an object is added

static void vrfLua::DtLuaScriptManager::objectRemovedCallback ( DtVrfObject vrfObject,
void *  usr 
) [static, protected]

used as a static adapter to processObjectRemoved

virtual void vrfLua::DtLuaScriptManager::processObjectRemoved ( DtVrfObject vrfObject) [protected, virtual]

remove it from the World

Add the Lua component to the passed entity.

Returns:
The component just added or null if it failed.
virtual void vrfLua::DtLuaScriptManager::sendScriptList ( ) [protected, virtual]

Sends the current script list to the GUI.

virtual std::vector<DtString> vrfLua::DtLuaScriptManager::scriptNamesOnDisk ( ) [protected, virtual]

Returns the names of all the scripts available on the disk.

virtual void vrfLua::DtLuaScriptManager::sendScriptText ( const DtString scriptName) [protected, virtual]

Sends the text of the specified script onto the network.

virtual void vrfLua::DtLuaScriptManager::saveScriptText ( const DtString scriptName,
const std::list< DtString > &  scriptLines 
) [protected, virtual]

Saves the script to the disk.

It will be saved with the name specified, and the text lines provided. Any preexisting script of this name will be overwritten.

virtual bool vrfLua::DtLuaScriptManager::deleteScript ( const DtString scriptName) [protected, virtual]

Deletes the named script from the disk.

Returns:
True on success.

Member Data Documentation

struct luaL_reg vrfLua::DtLuaScriptManager::myVrfLib[] [static, protected]
struct luaL_reg vrfLua::DtLuaScriptManager::myVrfObjLib[] [static, protected]
struct luaL_reg vrfLua::DtLuaScriptManager::myThisVrfObjLib[] [static, protected]

pointer to main VRF application


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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)