#include <luainstance.h>
Public Member Functions | |
~CLUAInstance () | |
void | runScript (std::string fileName) |
void | callFunction (const char *func, const char *sig,...) |
void | callFunctionError (const char *fmt,...) |
Static Public Member Functions | |
static CLUAInstance * | getInstance () |
Protected Member Functions | |
CLUAInstance () |
This class both
Sample usage looks like this:
CLUAInstance *lua = CLUAInstance::getInstance(); lua->runScript( "lua.lua" ); lua->callFunction( "test", "si>i", "string parameter", 2, &ret ); printf("Function returned: %d\n", ret );
|
Destructor. |
|
Constructor - this is protected as this class uses the singleton design pattern. |
|
Call a LUA function from C++. Here is an example of using this function to call a script function:
callFunction("f", "dd>d", x, y, &z); This calls the function "f" with two "double" arguments, returning a double.
|
|
This is an error-handling routine invoked if "callFunction" fails.
|
|
This class is an example of the Singleton Design Pattern, so there is only one instance of this object ever in use.
|
|
Run the given script.
|