utils.h
Definition: utils.h:42
Notification callback used for communication between the lua file and MoMEMta.
Definition: ILuaCallback.h:30
size_t get_index(lua_State *L, int index)
Convert a negative lua stack index to an absolute index.
Definition: utils.cc:116
int generate_cuba_inputtag(lua_State *L)
Define Lua function to generate Cuba phase-space point input-tags.
void setup_hooks(lua_State *L, void *ptr)
Register all C function in the lua userspace.
Definition: utils.cc:524
std::shared_ptr< lua_State > init_runtime(ILuaCallback *callback)
Initialize the lua runtime.
Definition: utils.cc:554
Definition: utils.h:45
momemta::any to_vectorT(lua_State *L, int index)
Convert a lua array to a typed vector, encapsulated into a momemta::any.
Definition: utils.h:150
int load_modules(lua_State *L)
Hook for the load_modules lua function. The stack must have one element:
Definition: utils.cc:422
Definition: utils.h:43
lua_State * L
The global lua state. This state must be valid for as long as this instance.
Definition: utils.h:55
momemta::any to_vector(lua_State *L, int index, Type type)
Convert a lua array to a typed vector, encapsulated into a momemta::any.
Definition: utils.cc:297
void register_modules(lua_State *L, void *ptr)
Register modules in lua userspace.
Definition: utils.cc:376
void push_any(lua_State *L, const momemta::any &value)
Convert a momemta::any to a lua type, and push it to the top of the stack.
Definition: utils.cc:271
Definition: utils.h:32
int module_table_newindex(lua_State *L)
Hook for the metatable __newindex of the module's table.
Definition: utils.cc:332
Definition: utils.h:41
< Thrown if the configuration file is not valid
Definition: utils.h:24
Definition: utils.h:46
int parameter(lua_State *L)
Hook for the parameter lua function. This function accepts one argument:
Definition: utils.cc:438
std::pair< momemta::any, bool > to_any(lua_State *L, int index)
Convert a lua type to momemta::any.
Definition: utils.cc:191
Definition: utils.h:28
void inject_parameters(lua_State *L, const ParameterSet ¶meters)
Inject parameters into the current lua state.
Definition: utils.cc:572
Definition: utils.h:44
Definition: any.h:49
Definition: utils.h:40