Classes | |
| struct | NativeFunction |
| struct | NativeFunction< void > |
| struct | Pushable |
| struct | Reference |
| struct | StateWrapper |
| struct | Table |
| struct | Value |
| struct | Value< bool > |
| struct | Value< CFunction > |
| struct | Value< char[n]> |
| struct | Value< const char * > |
| struct | Value< const char[n]> |
| struct | Value< const T > |
| struct | Value< double > |
| struct | Value< FieldVector > |
| struct | Value< float > |
| struct | Value< long double > |
| struct | Value< NativeFunction< R > > |
| struct | Value< Pushable > |
| struct | Value< Reference > |
| struct | Value< signedchar > |
| struct | Value< signedint > |
| struct | Value< signedlong int > |
| struct | Value< signedlong long int > |
| struct | Value< signedshort > |
| struct | Value< std::nullptr_t > |
| struct | Value< std::string > |
| struct | Value< std::tuple< A... > > |
| struct | Value< Table > |
| struct | Value< U & > |
| struct | Value< U * > |
| struct | Value< unsigned char > |
| struct | Value< unsigned int > |
| struct | Value< unsigned long int > |
| struct | Value< unsigned long long int > |
| struct | Value< unsigned short > |
| struct | Value< volatile T > |
Typedefs | |
| using | FieldVector = std::vector< std::pair< 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 std::string &name, V value) |
| template<typename V > | |
| static V | getGlobal (State *state, const std::string &name) |
| template<typename... R> | |
| static void | setFields (State *state, int index, R &&...args) |
| static void | setFields (State *state, int index, const FieldVector &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 R , typename... A> | |
| static R | apply (State *state, int pos, R(*fun)(A...)) |
| template<typename R , typename... A> | |
| static R | apply (State *state, R(*fun)(A...)) |
| template<typename R , typename... A> | |
| static R | apply (State *state, int pos, const std::function< R(A...)> &fun) |
| template<typename R , typename... A> | |
| static R | apply (State *state, const std::function< R(A...)> &fun) |
| 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 FieldVector &methods=FieldVector(), const FieldVector &meta_methods=FieldVector()) |
| template<typename T > | |
| static void | registerUserType (State *state, const std::string &ctor_name, const FieldVector &methods=FieldVector(), const FieldVector &meta_methods=FieldVector()) |
| using luwra::CFunction = typedef lua_CFunction |
| using luwra::FieldVector = typedef std::vector<std::pair<Pushable, Pushable>> |
A collection of key-value pairs.
| using luwra::Integer = typedef lua_Integer |
| using luwra::Number = typedef lua_Number |
| using luwra::State = typedef lua_State |
|
inlinestatic |
Synonym for direct with a function pointer which lets you omit all template parameters. The stack layout will be inferred using the signature of the given function pointer.
|
inlinestatic |
Same as apply(state, 1, fun).
|
inlinestatic |
Synonym for direct with a function object which lets you omit all template parameters. The stack layout will be inferred using the template parameter to your std::function object.
|
inlinestatic |
Same as apply(state, 1, fun).
|
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 |
|
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 |