quic/qbox
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
gs::LuaFile_Tool Class Reference

Public Member Functions

 LuaFile_Tool (std::string _orig_name="")
 Constructor.
 
int config (cci::cci_broker_handle a_broker, const char *a_config_file, char *a_images_dir=NULL)
 Makes the configuration.
 

Protected Member Functions

int setParamsFromLuaTable (cci::cci_broker_handle a_broker, lua_State *L, int t, char *level=NULL)
 Traverse a Lua table setting global variables as parameters (recursive)
 
void set_g_vars_from_cmdline (lua_State *L, const key_val_args &a_lua_globalvars)
 set global variables passed from command line arguments using -D | –define_luagvar
 

Member Function Documentation

◆ config()

int gs::LuaFile_Tool::config ( cci::cci_broker_handle  a_broker,
const char a_config_file,
char a_images_dir = NULL 
)

Makes the configuration.

Configure parameters from a lua file.

May be called several times with several configuration files

Example usage:

int sc_main(int argc, char *argv[]) {
luareader.config("file.lua");
luareader.config("other_file.lua");
}
Definition target.h:160
Definition luafile_tool.h:54
Parameters
a_brokercci brocker handle
a_config_filelua config file
a_lua_globalvarsglobal variables that needs to be set on the lua config
a_images_dirdirectory including software images.

To set lua global variables set_g_vars_from_cmdline() can be called here: set_g_vars_from_cmdline(L, a_lua_globalvars);

◆ set_g_vars_from_cmdline()

void gs::LuaFile_Tool::set_g_vars_from_cmdline ( lua_State L,
const key_val_args &  a_lua_globalvars 
)
protected

set global variables passed from command line arguments using -D | –define_luagvar

accepts only these data types: booleans, numbers and strings

Parameters
Llua_State*
a_lua_globalvarsstd::vector of std::pairs of lua passed global variables.

◆ setParamsFromLuaTable()

int gs::LuaFile_Tool::setParamsFromLuaTable ( cci::cci_broker_handle  a_broker,
lua_State L,
int  t,
char level = NULL 
)
protected

Traverse a Lua table setting global variables as parameters (recursive)

Parameters
LLua state
tLua index
level(only for recursion) parameter name prefixed
Returns
number of elements if lua array or error if negative

The documentation for this class was generated from the following files: