Typedefs | |
| using | MemberMap = std::map< Pushable, Pushable > |
| using | Integer = lua_Integer |
| using | Number = lua_Number |
| using | State = lua_State |
| using | CFunction = lua_CFunction |
Functions | |
| static bool | equal (State *state, int index1, int index2) |
| static void | setMetatable (State *state, const char *name) |
| template<typename V > | |
| static void | setGlobal (State *state, const char *name, V &&value) |
| template<typename V > | |
| static V | getGlobal (State *state, const char *name) |
| template<typename... R> | |
| static void | setFields (State *state, int index, R &&...args) |
| static void | setFields (State *state, int index, const MemberMap &fields) |
| template<typename V , typename K > | |
| static V | getField (State *state, int index, K &&key) |
| template<typename S , typename F , typename... X> | |
| static internal::Layout< S >::ReturnType | direct (State *state, int pos, F &&hook, X &&...args) |
| template<typename S , typename F , typename... A> | |
| static internal::Layout< S >::ReturnType | direct (State *state, F &&hook, A &&...args) |
| template<typename T > | |
| static internal::CallableInfo< T >::ReturnType | apply (State *state, int pos, T &&obj) |
| template<typename T > | |
| static internal::CallableInfo< T >::ReturnType | apply (State *state, T &&obj) |
| template<typename S , typename F , typename... A> | |
| static size_t | map (State *state, int pos, F &&hook, A &&...args) |
| template<typename S , typename F , typename... A> | |
| static size_t | map (State *state, F &&hook, A &&...args) |
| static Table | getGlobalsTable (State *state) |
| template<typename T > | |
| static size_t | push (State *state, T &&value) |
| template<typename T1 , typename T2 , typename... TR> | |
| size_t | push (State *state, T1 &&value, T2 &&head, TR &&...rest) |
| template<typename T > | |
| static T | read (State *state, int index) |
| template<typename U , typename... A> | |
| static internal::StripUserType< U > & | construct (State *state, A &&...args) |
| template<typename U > | |
| static void | registerUserType (State *state, const MemberMap &methods=MemberMap(), const MemberMap &meta_methods=MemberMap()) |
| template<typename S > | |
| static void | registerUserType (State *state, const char *ctor_name, const MemberMap &methods=MemberMap(), const MemberMap &meta_methods=MemberMap()) |
| using luwra::CFunction = typedef lua_CFunction |
| using luwra::Integer = typedef lua_Integer |
| using luwra::MemberMap = typedef std::map<Pushable, Pushable> |
Map of members
| using luwra::Number = typedef lua_Number |
| using luwra::State = typedef lua_State |
|
inlinestatic |
A version of direct which tries to infer the stack layout from the given Callable. It allows you to omit the template parameters since the compiler is able to infer the parameter and return types.
|
inlinestatic |
Same as apply(state, 1, obj).
|
inlinestatic |
Construct a user type value on the stack.
| state | Lua state |
| args | Constructor arguments |
|
inlinestatic |
Retrieve values from the stack and invoke a Callable with them.
| S | Signature in the form of R(A...) where A is a sequence of types, which shall be retrieved from the stack, and R the return type of hook |
| F | An instance of Callable which accepts parameters X..., A... and returns R (this parameter should be inferable and can be omitted) |
| X | Extra argument types |
| state | Lua state instance |
| pos | Index of the first value |
| hook | Callable value |
| args | Extra arguments which shall be be passed to hook before the stack values |
hook
|
inlinestatic |
Same as direct(state, 1, hook).
|
inlinestatic |
Check if two values are equal.
| state | Lua state |
| index1 | Index of left-hand side value |
| index2 | Index of right-hand side value |
|
inlinestatic |
Retrieve a field from a table.
|
inlinestatic |
Retrieve a global value.
| state | Lua state |
| name | Global name |
Retrieve the table containing all global values.
| state | Lua state |
|
inlinestatic |
Similiar to direct but pushes the result of the given Callable onto the stack.
|
inlinestatic |
Same as map(state, 1, hook).
|
inlinestatic |
Convenient wrapped for Value<T>::push.
| size_t luwra::push | ( | State * | state, |
| T1 && | value, | ||
| T2 && | head, | ||
| TR &&... | rest | ||
| ) |
Allows you to push multiple values at once.
|
inlinestatic |
Convenient wrapper for Value<T>::read.
|
inlinestatic |
Register the metatable for user type T. This function allows you to register methods which are shared across all instances of this type.
By default a garbage-collector hook and string representation function are added as meta methods. Both can be overwritten.
| U | User type struct or class |
| state | Lua state |
| methods | Map of methods |
| meta_methods | Map of meta methods |
|
inlinestatic |
Same as the other registerUserType but registers the constructor as well. The template parameter is a signature U(A...) where U is the user type and A... its constructor parameters.
|
inlinestatic |
Set multiple fields at once. Allows you to provide multiple key-value pairs.
| state | Lua state |
| index | Table index |
| args | Key-value pairs |
|
inlinestatic |
Register a value as a global.
| state | Lua state |
| name | Global name |
| value | Global value |
|
inlinestatic |
Set a registered metatable for the value on top of the stack.
| state | Lua state |
| name | Metatable name |