Voxellancer  0.3
A game about voxels in space
 All Classes Functions Pages
LuaWrapper Class Reference
Collaboration diagram for LuaWrapper:
[legend]

Classes

struct  _pop
 
struct  _pop< 0, Ts...>
 
struct  _pop< 1, T >
 

Public Member Functions

void loadScript (const std::string &script)
 
void loadString (const std::string &script)
 
void removeScript (const std::string &script)
 
void reloadScripts ()
 
bool has (const std::string &fun)
 
template<typename... Ret, typename... Args>
_pop< sizeof...(Ret), Ret...>::type call (const std::string &fun, const Args &...args)
 
template<typename Return , typename Class , typename... Args>
void Register (const std::string &name, Class *obj, Return(Class::*const method)(Args...))
 
template<typename Return , typename... Args>
void Register (const std::string &name, std::function< Return(Args...)> function)
 
template<typename Return , typename... Args>
void Register (const std::string &name, Return(*function)(Args...))
 
template<typename... Return, typename... Args>
void Register (const std::string &name, std::function< std::tuple< Return...>(Args...)> function)
 
template<typename... Return, typename... Args>
void Register (const std::string &name, std::tuple< Return...>(*function)(Args...))
 
void Unregister (const std::string &name)
 
void operator= (LuaWrapper &)=delete
 

Static Public Member Functions

static void reloadAll ()
 

Protected Member Functions

void luaError ()
 
void pushFunc (const std::string &func) const
 
void callFunc (const int numArgs, const int numRet)
 
void popStack (const int index)
 
template<typename T , typename... Ts>
void push (const T value, const Ts...values) const
 
void push () const
 
void push (const std::string &value) const
 
void push (const char *value) const
 
void push (const int8_t value) const
 
void push (const uint8_t value) const
 
void push (const int16_t value) const
 
void push (const uint16_t value) const
 
void push (const int32_t value) const
 
void push (const uint32_t value) const
 
void push (const int64_t value) const
 
void push (const uint64_t value) const
 
void push (const float value) const
 
void push (const double value) const
 
void push (const bool value) const
 
void push (const glm::vec3 &value) const
 
template<typename T >
fetch (const int index) const
 
template<typename... T>
_pop< sizeof...(T), T...>::type pop ()
 
template<>
int fetch (const int index) const
 
template<>
double fetch (const int index) const
 
template<>
float fetch (const int index) const
 
template<>
unsigned long fetch (const int index) const
 
template<>
bool fetch (const int index) const
 

Protected Attributes

lua_State * m_state
 
std::vector< std::string > m_scripts
 
int m_err
 
std::map< std::string,
std::unique_ptr
< BaseLuaFunction > > 
m_functions
 

Static Protected Attributes

static std::list< LuaWrapper * > s_instances
 

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