nngn
|
Functions for retrieving values from the stack. More...
#include <string_view>
#include <tuple>
#include <utility>
#include <vector>
#include "utils/concepts/fundamental.h"
#include "lua.h"
#include "user.h"
Go to the source code of this file.
Classes | |
struct | nngn::lua::stack_get< std::optional< T > > |
Reads a T if a value exists at that index (no type check is performed). More... | |
struct | nngn::lua::stack_get< bool > |
Converts a value to boolean using Lua's rules (i.e. More... | |
struct | nngn::lua::stack_get< T * > |
Reads a light user data value as void* . More... | |
struct | nngn::lua::stack_get< T > |
Reads a value convertible to lua_Integer . More... | |
struct | nngn::lua::stack_get< const char * > |
Reads a C string value. More... | |
struct | nngn::lua::stack_get< std::string_view > |
Reads a string value as ptr+size. More... | |
struct | nngn::lua::stack_get< std::string > |
Reads a string value as ptr+size. More... | |
struct | nngn::lua::stack_get< lua_CFunction > |
Reads a lua_CFunction value. More... | |
struct | nngn::lua::stack_get< T & > |
Reads a user type as a full user data value (reference overload). More... | |
struct | nngn::lua::stack_get< std::tuple< Ts... > > |
Reads a sequence of values from the stack. More... | |
Namespaces | |
namespace | nngn |
namespace | nngn::lua |
Functions for retrieving values from the stack.
These implement the low-level retrieval of values from the Lua stack. Regular users almost certainly will want a higher-level interface, such as get or state_view::get. These are the underlying functions used in their implementation.
Special handling for custom types can be added by creating stack_get specializations in the nngn::lua namespace (_but note that to simply treat a type as a user value, follow the instructions in register.h). The single static
function get
should take a lua_State
and int
index and return the value.