![]() |
VR-Forces Developer's Guide
|
Manages resources shared by scripts.

Classes | |
| struct | DtBytecodeRwInteface |
Public Member Functions | |
| DtLuaScriptResourceManager () | |
| virtual | ~DtLuaScriptResourceManager () |
| virtual void | initializeNumberOfStates (unsigned numberOfStates) |
| virtual lua_State * | getLuaState (int scriptType=DtScriptedTaskScriptedTask) |
| virtual bool | loadModule (lua_State *L, const std::string &moduleName) |
Public Member Functions inherited from DtScriptResourceManager | |
| DtScriptResourceManager () | |
| virtual | ~DtScriptResourceManager () |
| virtual void | setScriptPaths (const std::vector< std::string > &scriptPaths) |
| virtual const std::vector < std::string > & | scriptPaths () const |
Static Public Member Functions | |
| static lua_State * | createLuaState (const std::vector< std::string > &scriptPaths, int scriptType=DtScriptedTaskScriptedTask) |
| static bool | initializeVRFLuaExtensions (lua_State *L, const std::vector< std::string > &scriptPaths, int scriptType=DtScriptedTaskScriptedTask) |
| static DtScriptResourceManager * | creator () |
Protected Types | |
| typedef std::vector< char > | DtLuaBytecodeChunk |
| typedef DtBoost::shared_ptr < DtLuaBytecodeChunk > | DtLuaBytecodeChunkPtr |
Protected Member Functions | |
| virtual std::string | findLuaModuleFile (const std::string &filename) |
| virtual void | saveBytecodeChunk (lua_State *L, const std::string &chunkName) |
| virtual void | createLuaStates (unsigned numStates) |
| DtLuaScriptResourceManager (const DtLuaScriptResourceManager &other) | |
| DtLuaScriptResourceManager & | operator= (const DtLuaScriptResourceManager &other) |
Protected Member Functions inherited from DtScriptResourceManager | |
| DtScriptResourceManager (const DtScriptResourceManager &other) | |
| DtScriptResourceManager & | operator= (const DtScriptResourceManager &other) |
Static Protected Member Functions | |
| static int | luaBytecodeSaveCb (lua_State *L, const void *p, size_t sz, void *ud) |
| static const char * | luaBytecodeLoadCb (lua_State *L, void *ud, size_t *size) |
Protected Attributes | |
| std::list< lua_State * > | myLuaStates |
| std::map< std::string, DtLuaBytecodeChunkPtr > | myLuaBytecodeChunks |
| tbb::mutex | myBytecodeMutex |
Protected Attributes inherited from DtScriptResourceManager | |
| std::vector< std::string > | myScriptPaths |
|
protected |
|
protected |
| DtLuaScriptResourceManager::DtLuaScriptResourceManager | ( | ) |
|
virtual |
|
protected |
|
virtual |
Initializes the resource manager for the scenario, pre-allocating some resources based on the number supplied.
Implements DtScriptResourceManager.
|
virtual |
Returns a new Lua state.
|
virtual |
Loads a module with the given name into the Lua state. Returns true if successful.
|
static |
Creates and initializes a new Lua state with the given paths.
|
static |
Initializes a Lua state with the standard VRF Lua extensions.
|
static |
Creator function for the Lua resource manager.
|
protectedvirtual |
Finds the full path to the given filename using the current script paths.
|
protectedvirtual |
Saves the top of the lua_State stack as a bytecode cache labeled as chunkName.
|
protectedvirtual |
Creates a number of Lua states in parallel.
|
protected |
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |
|
protected |