53 const char* componentName,
const char* methodName,
55 const char* code,
Logger& logger );
83 static const char*
LoadFile(
const char* filename );
87 static const char*
Exec(
const char* command );
98 static const char*
Run();
102 static const char*
RunFunction(
const char* functionName,
Str& returnValue,
bool isRoot =
false );
141 static const char*
NewFunction(
const char* functionName,
const char* functionBody,
bool isRoot );
Client-side interface for injecting log data into the log queue.
Definition: Logger.h:30
static bool OpenTableItemByIndex(int index, bool isRoot)
Opens an item from the table on the top of the stack by its zero-based index it must be closed later ...
Definition: LuaAPI.cpp:270
static const char * Run()
Runs whatever is on top of the stack with no args and no return.
Definition: LuaAPI.cpp:216
static void CloseTableItem()
Just pops the top item off the lua stack.
Definition: LuaAPI.cpp:330
Abstract base class for scripted programming language interfaces.
Definition: ScriptAPI.h:29
A DataAccessor that reads values from the Slate Contains a default dataValue that must not be NULL...
Definition: DataReader.h:30
bool isRoot() const
True if this is the root element.
Definition: LuaNode.h:123
virtual ScriptNode * makeScriptFunction(const char *moduleName, const char *componentName, const char *methodName, FlexArray< InputInfo * > &inputs, FlexArray< SettingInfo * > &settings, const char *code, Logger &logger)
Returns a ScriptNode within the namespace of componentName that contains a function with the given me...
Definition: LuaAPI.cpp:55
static const char * NewFunction(const char *functionName, const char *functionBody, bool isRoot)
creates a new function and adds to open node, returns error message if error
Definition: LuaAPI.cpp:380
Abstract base class for nodes in tree-like scripts.
Definition: ScriptNode.h:20
static const char * LoadFile(const char *filename)
Loads the indicated file.
Definition: LuaAPI.cpp:42
static bool NewTable(const char *name, bool isRoot)
creates a new empty table and adds to open node, returns true if successful
Definition: LuaAPI.cpp:367
A wrapper for the lua programming language interface.
Definition: LuaAPI.h:42
static bool IsTable(bool isRoot)
Is the item at the top of the stack a table?
Definition: LuaAPI.cpp:258
LuaAPI()
Private constructor for singleton.
Definition: LuaAPI.cpp:430
static int GetTableSize(bool isRoot)
Returns the size of the table on the top of the stack Returns -1 if not a table.
Definition: LuaAPI.cpp:320
lua_State * lua_
Definition: LuaAPI.h:74
A DataAccessor that writes values to the Slate via its associated DataElement.
Definition: DataWriter.h:27
virtual ~LuaAPI()
Definition: LuaAPI.cpp:22
static bool GetBool(bool &readTo, bool isRoot)
gets a boolean from the top of the stack
Definition: LuaAPI.cpp:337
Replacement for standard template class string.
Definition: Str.h:12
LuaNode * rootNode_
Definition: LuaAPI.h:153
LuaState()
Definition: LuaAPI.cpp:27
static const char * Exec(const char *command)
Runs the specified command, with no return.
Definition: LuaAPI.cpp:108
static bool GetString(Str &readTo, bool isRoot)
gets a unsigned char string from the top of the stack
Definition: LuaAPI.cpp:355
~LuaState()
Definition: LuaAPI.cpp:33
static LuaAPI Instance_
Definition: LuaAPI.h:151
static bool GetNumber(double &readTo, bool isRoot)
gets a number from the top of the stack
Definition: LuaAPI.cpp:344
Implements MissionAPI in the lua programming language.
Definition: LuaMissionAPI.h:22
Contains the ScriptAPI class definition.
static int GetStackHeight()
returns the height of the stack
Definition: LuaAPI.cpp:313
static void PushNil()
Pushes a nil onto the stack.
Definition: LuaAPI.cpp:307
static const char * RunFunction(const char *functionName, Str &returnValue, bool isRoot=false)
Runs specified function from the currently open table.
Definition: LuaAPI.cpp:232
static bool OpenTableItemByName(const char *name, bool isRoot)
Opens an item from the table on the top of the stack by its name it must be closed later with CloseTa...
Definition: LuaAPI.cpp:289
Code that represents an engineering unit.
Definition: Unit.h:24
Implements ScriptNode for the LuaAPI.
Definition: LuaNode.h:26
static LuaState LUA_
Definition: LuaAPI.h:77