32 #if !defined(LUTOK_STATE_HPP)
33 #define LUTOK_STATE_HPP
37 #if defined(_LIBCPP_VERSION) || __cplusplus >= 201103L
55 typedef int (*cxx_function)(state&);
59 extern const int registry_index;
80 #if defined(_LIBCPP_VERSION) || __cplusplus >= 201103L
81 std::shared_ptr< impl >
_pimpl;
83 std::tr1::shared_ptr< impl >
_pimpl;
90 explicit state(
void*);
116 bool next(
const int);
121 void pcall(
const int,
const int,
const int);
137 template<
typename Type > Type*
to_userdata(
const int);
145 #endif // !defined(LUTOK_STATE_HPP)
void set_global(const std::string &)
Wrapper around lua_setglobal.
Definition: state.cpp:777
int get_top(void)
Wrapper around lua_gettop.
Definition: state.cpp:384
bool get_metafield(const int, const std::string &)
Wrapper around luaL_getmetafield.
Definition: state.cpp:341
void push_string(const std::string &)
Wrapper around lua_pushstring.
Definition: state.cpp:729
Internal implementation for lutok::state.
Definition: state.cpp:219
Type * to_userdata(const int)
Wrapper around lua_touserdata.
Definition: state.ipp:59
void load_string(const std::string &)
Wrapper around luaL_loadstring.
Definition: state.cpp:510
void get_global_table(void)
Pushes a reference to the global table onto the stack.
Definition: state.cpp:318
std::string to_string(const int)
Wrapper around lua_tostring.
Definition: state.cpp:871
void pop(const int)
Wrapper around lua_pop.
Definition: state.cpp:654
void push_value(const int)
Wrapper around lua_pushvalue.
Definition: state.cpp:739
std::tr1::shared_ptr< impl > _pimpl
Pointer to the shared internal implementation.
Definition: state.hpp:77
long to_integer(const int)
Wrapper around lua_tointeger.
Definition: state.cpp:838
void * new_userdata_voidp(const size_t)
Wrapper around lua_newuserdata.
Definition: state.cpp:538
void raw_set(const int)
Wrapper around lua_rawset.
Definition: state.cpp:762
void open_all(void)
Wrapper around luaL_openlibs.
Definition: state.cpp:577
void open_table(void)
Wrapper around luaopen_table.
Definition: state.cpp:622
bool is_string(const int)
Wrapper around lua_isstring.
Definition: state.cpp:454
state(void)
Initializes the Lua state.
Definition: state.cpp:242
void new_table(void)
Wrapper around lua_newtable.
Definition: state.cpp:521
void * raw_state(void)
Gets the internal lua_State object.
Definition: state.cpp:901
~state(void)
Destructor for the Lua state.
Definition: state.cpp:268
bool is_table(const int)
Wrapper around lua_istable.
Definition: state.cpp:466
A RAII model for the Lua state.
Definition: state.hpp:76
int upvalue_index(const int)
Wrapper around lua_upvalueindex.
Definition: state.cpp:888
void set_metatable(const int)
Wrapper around lua_setmetatable.
Definition: state.cpp:792
bool is_number(const int)
Wrapper around lua_isnumber.
Definition: state.cpp:442
void push_boolean(const bool)
Wrapper around lua_pushboolean.
Definition: state.cpp:666
bool is_function(const int)
Wrapper around lua_isfunction.
Definition: state.cpp:418
void * to_userdata_voidp(const int)
Wrapper around lua_touserdata.
Definition: state.cpp:856
bool next(const int)
Wrapper around lua_next.
Definition: state.cpp:552
void open_base(void)
Wrapper around luaopen_base.
Definition: state.cpp:589
bool is_nil(const int)
Wrapper around lua_isnil.
Definition: state.cpp:430
bool to_boolean(const int)
Wrapper around lua_toboolean.
Definition: state.cpp:825
void pcall(const int, const int, const int)
Wrapper around lua_pcall.
Definition: state.cpp:643
void raw_get(const int)
Wrapper around lua_rawget.
Definition: state.cpp:749
bool is_boolean(const int)
Wrapper around lua_isboolean.
Definition: state.cpp:406
void push_nil(void)
Wrapper around lua_pushnil.
Definition: state.cpp:717
void push_cxx_closure(cxx_function, const int)
Wrapper around lua_pushcclosure.
Definition: state.cpp:680
Type * new_userdata(void)
Wrapper around lua_newuserdata.
Definition: state.ipp:46
Gateway to the raw C state of Lua.
Definition: c_gate.hpp:55
void set_table(const int)
Wrapper around lua_settable.
Definition: state.cpp:807
void get_global(const std::string &)
Wrapper around lua_getglobal.
Definition: state.cpp:302
void insert(const int)
Wrapper around lua_insert.
Definition: state.cpp:394
void open_string(void)
Wrapper around luaopen_string.
Definition: state.cpp:603
void close(void)
Terminates this Lua session.
Definition: state.cpp:284
bool get_metatable(const int)
Wrapper around lua_getmetatable.
Definition: state.cpp:353
void get_table(const int)
Wrapper around lua_gettable.
Definition: state.cpp:368
void load_file(const std::string &)
Wrapper around luaL_loadfile.
Definition: state.cpp:493
bool is_userdata(const int)
Wrapper around lua_isuserdata.
Definition: state.cpp:478
void push_cxx_function(cxx_function)
Wrapper around lua_pushcfunction.
Definition: state.cpp:696
void push_integer(const int)
Wrapper around lua_pushinteger.
Definition: state.cpp:709
Definition: c_gate.hpp:37