The Lua interpreter addon interface. More...
#include "murl_addons_lua_i_addon.h"
Public Member Functions | |
virtual UInt32 | GetVersionNumber () const =0 |
Get the Lua interpreter version information number. More... | |
virtual String | GetVersion () const =0 |
Get the Lua interpreter version information string. More... | |
virtual String | GetRelease () const =0 |
Get the Lua interpreter release information string. More... | |
virtual String | GetCopyright () const =0 |
Get the Lua interpreter copyright information string. More... | |
virtual String | GetAuthors () const =0 |
Get the Lua interpreter authors information string. More... | |
virtual Bool | OpenLibrary (const String &name)=0 |
Open a Lua standard library. More... | |
virtual String | ReadChunk (IFileInterface *fileInterface, const String &fileName)=0 |
Read a Lua chunk from a file. More... | |
virtual String | ReadResourceChunk (const Resource::ICollection *resourceCollection, const String &resourceId)=0 |
Read a Lua chunk from a resource. More... | |
virtual ConstData | LoadChunk (IFileInterface *fileInterface, const String &fileName)=0 |
Load (or map) a Lua chunk from a file. More... | |
virtual Bool | UnLoadChunk (IFileInterface *fileInterface, ConstData &chunk)=0 |
Unload (or unmap) a Lua chunk from a file. More... | |
virtual ConstData | LoadResourceChunk (const Resource::ICollection *resourceCollection, const String &resourceId)=0 |
Load (or map) a Lua chunk from a resource. More... | |
virtual Bool | UnLoadResourceChunk (const Resource::ICollection *resourceCollection, const String &resourceId)=0 |
Unload (or unmap) a Lua chunk from a resource. More... | |
virtual Bool | ValidateChunk (const ConstData &chunk, const String &chunkName, Result &result)=0 |
Validate a Lua chunk data object. More... | |
virtual Data | CompileChunk (const ConstData &chunk, const String &chunkName, Bool stripDebugInfo)=0 |
Compile a Lua chunk data object. More... | |
virtual IAppPtr | CreateIApp (const ConstData &chunk, const String &chunkName)=0 |
Create an IApp interface object from a chunk. More... | |
virtual Logic::IAppProcessorPtr | CreateIAppProcessor (const ConstData &chunk, const String &resourceId, const String &info)=0 |
Create a Logic::IAppProcessor interface object from a chunk. More... | |
virtual Logic::IAppGraphPtr | CreateIAppGraph (const ConstData &chunk, const String &resourceId, const String &info)=0 |
Create a Logic::IAppGraph interface object from a chunk. More... | |
virtual Bool | GetGlobal (String &value, const String &table, const String &key)=0 |
Get a String value from a global Lua table. More... | |
virtual Bool | GetGlobal (Double &value, const String &table, const String &key)=0 |
Get a Double value from a global Lua table. More... | |
virtual Bool | SetGlobal (const String &table, const String &key, const String &value)=0 |
Set a String value to a global Lua table. More... | |
virtual Bool | SetGlobal (const String &table, const String &key, Double value)=0 |
Set a Double value to a global Lua table. More... | |
virtual Bool | CollectGarbage ()=0 |
Performs a full garbage-collection cycle. More... | |
virtual lua_State * | GetLuaState ()=0 |
Get the Lua interpreter state. More... | |
Public Member Functions inherited from Murl::IAddon | |
virtual String | GetName () const =0 |
Get the addon's name. More... | |
virtual Bool | Configure (IEngineConfiguration *engineConfig, IFileInterface *fileInterface)=0 |
Configure the addon. More... | |
virtual Bool | RegisterCustomFactoryClasses (IAppFactoryRegistry *factoryRegistry)=0 |
Register custom factory classes with the engine. More... | |
virtual Bool | UnregisterCustomFactoryClasses (IAppFactoryRegistry *factoryRegistry)=0 |
Unregister custom factory classes from the engine. More... | |
virtual Bool | RegisterCustomModuleClasses (IAppModuleRegistry *moduleRegistry)=0 |
Register custom module classes with the engine. More... | |
virtual Bool | UnregisterCustomModuleClasses (IAppModuleRegistry *moduleRegistry)=0 |
Unregister custom module classes from the engine. More... | |
virtual Bool | Init (const IAppState *appState)=0 |
Initialize the add-on. More... | |
virtual Bool | DeInit (const IAppState *appState)=0 |
Deinitialize the add-on. More... | |
Detailed Description
The Lua interpreter addon interface.
Adds a wide-ranging integration of the Murl framework to the Lua programming language, see http://www.lua.org/license.html
Member Function Documentation
◆ GetVersionNumber()
|
pure virtual |
Get the Lua interpreter version information number.
- Returns
- The Lua interpreter version information number, e.g. 503.
◆ GetVersion()
|
pure virtual |
Get the Lua interpreter version information string.
- Returns
- The Lua interpreter version information string, e.g. Lua 5.3.
◆ GetRelease()
|
pure virtual |
Get the Lua interpreter release information string.
- Returns
- The Lua interpreter release information string, e.g. Lua 5.3.1.
◆ GetCopyright()
|
pure virtual |
Get the Lua interpreter copyright information string.
- Returns
- The Lua interpreter copyright information string.
◆ GetAuthors()
|
pure virtual |
Get the Lua interpreter authors information string.
- Returns
- The Lua interpreter authors information string.
◆ OpenLibrary()
Open a Lua standard library.
Lua offers the following standard libraries:
- "bit32" Bitwise Operations
- "math" Mathematical Functions
- "string" String Manipulation
- "table" Table Manipulation
- "coroutine" Coroutine Manipulation
- "debug" Debug Library
- "package" Modules
- "io" Input and Output Facilities, may not work on mobile devices, use Murl.IFileInterface instead
- "os" Operating System Facilities, may not work on mobile devices, use Murl.System instead
The Lua Basic Functions library is opened automatically at addon's Init().
- Parameters
-
name The name of the Lua standard library to open.
- Returns
- true if successful.
◆ ReadChunk()
|
pure virtual |
Read a Lua chunk from a file.
- Parameters
-
fileInterface The file interface. fileName The name of the file to load.
- Returns
- A string containing the Lua chunk or an empty string case of any error.
◆ ReadResourceChunk()
|
pure virtual |
Read a Lua chunk from a resource.
- Parameters
-
resourceCollection The resource collection. resourceId The identifier of the resoure.
- Returns
- A string containing the Lua chunk or an empty string case of any error.
◆ LoadChunk()
|
pure virtual |
Load (or map) a Lua chunk from a file.
The loaded data must be unloaded by UnLoadChunk().
- Parameters
-
fileInterface The file interface. fileName The name of the file to load.
- Returns
- A data object containing the Lua chunk, the data object is empty in case of any error.
◆ UnLoadChunk()
|
pure virtual |
Unload (or unmap) a Lua chunk from a file.
- Parameters
-
fileInterface The file interface. chunk The chunk data object to unload.
- Returns
- true if successful.
◆ LoadResourceChunk()
|
pure virtual |
Load (or map) a Lua chunk from a resource.
The loaded data must be unloaded by UnLoadResourceChunk().
- Parameters
-
resourceCollection The resource collection. resourceId The identifier of the resoure.
- Returns
- A data object containing the Lua chunk, the data object is empty in case of any error.
◆ UnLoadResourceChunk()
|
pure virtual |
Unload (or unmap) a Lua chunk from a resource.
- Parameters
-
resourceCollection The resource collection. resourceId The identifier of the resoure.
- Returns
- true if successful.
◆ ValidateChunk()
|
pure virtual |
Validate a Lua chunk data object.
- Parameters
-
chunk The Lua chunk data object to validate. chunkName The name of the chunk used for error messages. result This return value is set for syntactic script errors.
- Returns
- true if successful, false if the chunk is empty or a syntactic error occured.
◆ CompileChunk()
|
pure virtual |
Compile a Lua chunk data object.
Warning! Compiled chunks are architecture dependent, e.g. chunks compiled on a 64 bit system are incompatible with 32 bit systems.
- Parameters
-
chunk The Lua chunk data object to compile. chunkName The name of the chunk used for error messages. stripDebugInfo Create without debug information about the function if true.
- Returns
- The compiled chunk data, the data object is empty in case of any error.
◆ CreateIApp()
|
pure virtual |
Create an IApp interface object from a chunk.
The Lua script gets the chunkName as parameter. The Lua script must return an IAppPtr instance.
- Parameters
-
chunk The Lua chunk data object to execute. chunkName The name of the chunk used for error messages.
- Returns
- The IApp interface or null in case of any error.
◆ CreateIAppProcessor()
|
pure virtual |
Create a Logic::IAppProcessor interface object from a chunk.
The Lua script gets the resourceId and the info as parameter. The Lua script return an Logic::IAppProcessorPtr instance.
- Parameters
-
chunk The Lua chunk data object to execute. resourceId The name of the chunk used for error messages. info A string with additional information passed to the script.
- Returns
- The IApp interface or null in case of any error.
◆ CreateIAppGraph()
|
pure virtual |
Create a Logic::IAppGraph interface object from a chunk.
The Lua script gets the resourceId and the info as parameter. The Lua script must return an Logic::IAppGraphPtr instance.
- Parameters
-
chunk The Lua chunk data object to execute. resourceId The name of the chunk used for error messages. info A string with additional information passed to the script.
- Returns
- The IApp interface or null in case of any error.
◆ GetGlobal() [1/2]
|
pure virtual |
Get a String value from a global Lua table.
Preforms the Lua operation value = table[key].
- Parameters
-
value Return the value of table[key]. table The name of the table. key The name of the key in the table to get the value from.
- Returns
- true if successful, false if the table or key does exists.
◆ GetGlobal() [2/2]
|
pure virtual |
Get a Double value from a global Lua table.
Preforms the Lua operation value = table[key].
- Parameters
-
value Return the value of table[key]. table The name of the table. key The name of the key in the table to get the value from.
- Returns
- true if successful, false if the table or key does exists.
◆ SetGlobal() [1/2]
|
pure virtual |
Set a String value to a global Lua table.
Preforms the Lua operation table[key] = value. If the table does not exist, a new table is created.
- Parameters
-
table The name of the table. key The name of the key in the table to set the value. value The value to set table[key].
- Returns
- true if successful, false if the table-name exists in the global environment but is not type of a table.
◆ SetGlobal() [2/2]
|
pure virtual |
Set a Double value to a global Lua table.
Preforms the Lua operation table[key] = value. If the table does not exist, a new table is created.
- Parameters
-
table The name of the table. key The name of the key in the table to set the value. value The value to set table[key].
- Returns
- true if successful, false if the table-name exists in the global environment but is not type of a table.
◆ CollectGarbage()
|
pure virtual |
Performs a full garbage-collection cycle.
- Returns
- true if successful.
◆ GetLuaState()
|
pure virtual |
Get the Lua interpreter state.
- Returns
- The Lua interpreter state.
The documentation for this interface was generated from the following file:
- murl_addons_lua_i_addon.h