GenericContainer
GenericContainer a tool for C++ programming
Loading...
Searching...
No Matches
GenericContainerInterface_lua.hh
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*\
2 | |
3 | Copyright (C) 2013 |
4 | |
5 | , __ , __ |
6 | /|/ \ /|/ \ |
7 | | __/ _ ,_ | __/ _ ,_ |
8 | | \|/ / | | | | \|/ / | | | |
9 | |(__/|__/ |_/ \_/|/|(__/|__/ |_/ \_/|/ |
10 | /| /| |
11 | \| \| |
12 | |
13 | Enrico Bertolazzi |
14 | Dipartimento di Ingegneria Industriale |
15 | Università degli Studi di Trento |
16 | email: enrico.bertolazzi@unitn.it |
17 | |
18\*--------------------------------------------------------------------------*/
19
20#pragma once
21
22#ifndef GENERIC_CONTAINER_INTERFACE_LUA_HH
23#define GENERIC_CONTAINER_INTERFACE_LUA_HH
24
25#ifdef __clang__
26#pragma clang diagnostic ignored "-Wpoison-system-directories"
27#endif
28
29#include "GenericContainer.hh"
30
31namespace GC_namespace {
32
38
49 void
51 void * void_L,
52 char const * global_var,
54 );
55
66 void
68 void * void_L,
69 GenericContainer const & gc,
70 char const * global_var
71 );
72
81 /* lua_State * */ void * void_L;
82 public:
85
88
96 void execute( char const cmd[] );
97
107 void call( GenericContainer const & arguments, GenericContainer & res );
108
116 void do_file( char const fname[] );
117
126 void
127 GC_to_global( GenericContainer const & gc, char const global_var[] ) {
128 Lua_GC_to_global( void_L, gc, global_var );
129 }
130
139 void
140 global_to_GC( char const var[], GenericContainer & gc ) {
141 Lua_global_to_GC( void_L, var, gc );
142 }
143
155 int
157 int argc,
158 char const ** argv,
159 char const ** messages,
160 char const * prompt
161 ); // launch interpret mode
162 };
163
167
168}
169
170#endif
The GenericContainer class provides a flexible container for storing heterogeneous data types.
Definition GenericContainer.hh:614
void call(GenericContainer const &arguments, GenericContainer &res)
Call a Lua function with arguments from a GenericContainer.
LuaInterpreter()
Constructor that initializes the Lua interpreter.
int interactive(int argc, char const **argv, char const **messages, char const *prompt)
Launch an interactive Lua interpreter mode.
void global_to_GC(char const var[], GenericContainer &gc)
Convert a Lua global variable into a GenericContainer.
Definition GenericContainerInterface_lua.hh:140
~LuaInterpreter()
Destructor that closes the Lua interpreter.
void GC_to_global(GenericContainer const &gc, char const global_var[])
Store a GenericContainer as a Lua global variable.
Definition GenericContainerInterface_lua.hh:127
void do_file(char const fname[])
Load and execute a Lua script file.
void execute(char const cmd[])
Execute a Lua command string.
void Lua_global_to_GC(void *void_L, char const *global_var, GenericContainer &gc)
Convert a Lua global variable to a GenericContainer.
void Lua_GC_to_global(void *void_L, GenericContainer const &gc, char const *global_var)
Convert a GenericContainer to a Lua global variable.
Definition GenericContainer.cc:68