Murl::Addons::Lua::IAddon Interface Referenceabstract

The Lua interpreter addon interface. More...

#include "murl_addons_lua_i_addon.h"

Inheritance diagram for Murl::Addons::Lua::IAddon:

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

virtual UInt32 Murl::Addons::Lua::IAddon::GetVersionNumber ( ) const
pure virtual

Get the Lua interpreter version information number.

Returns
The Lua interpreter version information number, e.g. 503.

◆ GetVersion()

virtual String Murl::Addons::Lua::IAddon::GetVersion ( ) const
pure virtual

Get the Lua interpreter version information string.

Returns
The Lua interpreter version information string, e.g. Lua 5.3.

◆ GetRelease()

virtual String Murl::Addons::Lua::IAddon::GetRelease ( ) const
pure virtual

Get the Lua interpreter release information string.

Returns
The Lua interpreter release information string, e.g. Lua 5.3.1.

◆ GetCopyright()

virtual String Murl::Addons::Lua::IAddon::GetCopyright ( ) const
pure virtual

Get the Lua interpreter copyright information string.

Returns
The Lua interpreter copyright information string.

◆ GetAuthors()

virtual String Murl::Addons::Lua::IAddon::GetAuthors ( ) const
pure virtual

Get the Lua interpreter authors information string.

Returns
The Lua interpreter authors information string.

◆ OpenLibrary()

virtual Bool Murl::Addons::Lua::IAddon::OpenLibrary ( const String name)
pure virtual

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
nameThe name of the Lua standard library to open.
Returns
true if successful.

◆ ReadChunk()

virtual String Murl::Addons::Lua::IAddon::ReadChunk ( IFileInterface fileInterface,
const String fileName 
)
pure virtual

Read a Lua chunk from a file.

Parameters
fileInterfaceThe file interface.
fileNameThe name of the file to load.
Returns
A string containing the Lua chunk or an empty string case of any error.

◆ ReadResourceChunk()

virtual String Murl::Addons::Lua::IAddon::ReadResourceChunk ( const Resource::ICollection resourceCollection,
const String resourceId 
)
pure virtual

Read a Lua chunk from a resource.

Parameters
resourceCollectionThe resource collection.
resourceIdThe identifier of the resoure.
Returns
A string containing the Lua chunk or an empty string case of any error.

◆ LoadChunk()

virtual ConstData Murl::Addons::Lua::IAddon::LoadChunk ( IFileInterface fileInterface,
const String fileName 
)
pure virtual

Load (or map) a Lua chunk from a file.

The loaded data must be unloaded by UnLoadChunk().

Parameters
fileInterfaceThe file interface.
fileNameThe 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()

virtual Bool Murl::Addons::Lua::IAddon::UnLoadChunk ( IFileInterface fileInterface,
ConstData chunk 
)
pure virtual

Unload (or unmap) a Lua chunk from a file.

Parameters
fileInterfaceThe file interface.
chunkThe chunk data object to unload.
Returns
true if successful.

◆ LoadResourceChunk()

virtual ConstData Murl::Addons::Lua::IAddon::LoadResourceChunk ( const Resource::ICollection resourceCollection,
const String resourceId 
)
pure virtual

Load (or map) a Lua chunk from a resource.

The loaded data must be unloaded by UnLoadResourceChunk().

Parameters
resourceCollectionThe resource collection.
resourceIdThe identifier of the resoure.
Returns
A data object containing the Lua chunk, the data object is empty in case of any error.

◆ UnLoadResourceChunk()

virtual Bool Murl::Addons::Lua::IAddon::UnLoadResourceChunk ( const Resource::ICollection resourceCollection,
const String resourceId 
)
pure virtual

Unload (or unmap) a Lua chunk from a resource.

Parameters
resourceCollectionThe resource collection.
resourceIdThe identifier of the resoure.
Returns
true if successful.

◆ ValidateChunk()

virtual Bool Murl::Addons::Lua::IAddon::ValidateChunk ( const ConstData chunk,
const String chunkName,
Result result 
)
pure virtual

Validate a Lua chunk data object.

Parameters
chunkThe Lua chunk data object to validate.
chunkNameThe name of the chunk used for error messages.
resultThis return value is set for syntactic script errors.
Returns
true if successful, false if the chunk is empty or a syntactic error occured.

◆ CompileChunk()

virtual Data Murl::Addons::Lua::IAddon::CompileChunk ( const ConstData chunk,
const String chunkName,
Bool  stripDebugInfo 
)
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
chunkThe Lua chunk data object to compile.
chunkNameThe name of the chunk used for error messages.
stripDebugInfoCreate without debug information about the function if true.
Returns
The compiled chunk data, the data object is empty in case of any error.

◆ CreateIApp()

virtual IAppPtr Murl::Addons::Lua::IAddon::CreateIApp ( const ConstData chunk,
const String chunkName 
)
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
chunkThe Lua chunk data object to execute.
chunkNameThe name of the chunk used for error messages.
Returns
The IApp interface or null in case of any error.

◆ CreateIAppProcessor()

virtual Logic::IAppProcessorPtr Murl::Addons::Lua::IAddon::CreateIAppProcessor ( const ConstData chunk,
const String resourceId,
const String info 
)
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
chunkThe Lua chunk data object to execute.
resourceIdThe name of the chunk used for error messages.
infoA string with additional information passed to the script.
Returns
The IApp interface or null in case of any error.

◆ CreateIAppGraph()

virtual Logic::IAppGraphPtr Murl::Addons::Lua::IAddon::CreateIAppGraph ( const ConstData chunk,
const String resourceId,
const String info 
)
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
chunkThe Lua chunk data object to execute.
resourceIdThe name of the chunk used for error messages.
infoA string with additional information passed to the script.
Returns
The IApp interface or null in case of any error.

◆ GetGlobal() [1/2]

virtual Bool Murl::Addons::Lua::IAddon::GetGlobal ( String value,
const String table,
const String key 
)
pure virtual

Get a String value from a global Lua table.

Preforms the Lua operation value = table[key].

Parameters
valueReturn the value of table[key].
tableThe name of the table.
keyThe 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]

virtual Bool Murl::Addons::Lua::IAddon::GetGlobal ( Double value,
const String table,
const String key 
)
pure virtual

Get a Double value from a global Lua table.

Preforms the Lua operation value = table[key].

Parameters
valueReturn the value of table[key].
tableThe name of the table.
keyThe 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]

virtual Bool Murl::Addons::Lua::IAddon::SetGlobal ( const String table,
const String key,
const String value 
)
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
tableThe name of the table.
keyThe name of the key in the table to set the value.
valueThe 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]

virtual Bool Murl::Addons::Lua::IAddon::SetGlobal ( const String table,
const String key,
Double  value 
)
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
tableThe name of the table.
keyThe name of the key in the table to set the value.
valueThe 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()

virtual Bool Murl::Addons::Lua::IAddon::CollectGarbage ( )
pure virtual

Performs a full garbage-collection cycle.

Returns
true if successful.

◆ GetLuaState()

virtual lua_State* Murl::Addons::Lua::IAddon::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


Copyright © 2011-2018 Spraylight GmbH.