nngn
|
CRTP base for stack table types. More...
#include <table.h>
Public Member Functions | |
template<typename K > | |
table_proxy< CRTP, std::decay_t< K > > | operator[] (K &&k) const |
lua_Integer | size (void) const |
table_iter< const CRTP > | begin (void) const |
lua_next -based iteration. | |
table_iter< const CRTP > | end (void) const |
Sentinel for begin. | |
table_seq_iter< const CRTP > | ibegin (void) const |
ipairs -style iteration. | |
table_seq_iter< const CRTP > | iend (void) const |
Sentinel for ibegin. | |
template<typename T > | |
T | raw_get (auto &&k, T &&def=T{}) const |
Gets field without meta methods. | |
template<typename T > | |
T | get_field (auto &&k, T &&def=T{}) const |
Gets field, with optional default value. | |
void | raw_set (auto &&k, auto &&v) const |
Sets a table field without meta methods. | |
void | set (auto &&k, auto &&v) const |
Sets a table field. | |
template<typename ... Ts> | |
void | set (std::tuple< Ts... > &&t) const |
Sets multiple table fields. | |
Protected Member Functions | |
template<op_mode mode, typename T > | |
T | get_common (auto &&k, T &&def=T{}) const |
template<op_mode mode> | |
void | set_common (auto &&k, auto &&v) const |
Private Member Functions | |
const CRTP & | crtp (void) const |
int | begin_op (void) const |
void | end_op (int) const |
CRTP base for stack table types.
table_iter< const CRTP > nngn::lua::detail::table_base< CRTP >::begin | ( | void | ) | const |
lua_next
-based iteration.
|
inlineprivate |
|
inlineprivate |
table_iter< const CRTP > nngn::lua::detail::table_base< CRTP >::end | ( | void | ) | const |
Sentinel for begin.
|
inlineprivate |
|
protected |
T nngn::lua::detail::table_base< CRTP >::get_field | ( | auto && | k, |
T && | def = T{} ) const |
Gets field, with optional default value.
table_seq_iter< const CRTP > nngn::lua::detail::table_base< CRTP >::ibegin | ( | void | ) | const |
ipairs
-style iteration.
table_seq_iter< const CRTP > nngn::lua::detail::table_base< CRTP >::iend | ( | void | ) | const |
Sentinel for ibegin.
table_proxy< CRTP, std::decay_t< K > > nngn::lua::detail::table_base< CRTP >::operator[] | ( | K && | k | ) | const |
T nngn::lua::detail::table_base< CRTP >::raw_get | ( | auto && | k, |
T && | def = T{} ) const |
Gets field without meta methods.
void nngn::lua::detail::table_base< CRTP >::raw_set | ( | auto && | k, |
auto && | v ) const |
Sets a table field without meta methods.
void nngn::lua::detail::table_base< CRTP >::set | ( | auto && | k, |
auto && | v ) const |
Sets a table field.
void nngn::lua::detail::table_base< CRTP >::set | ( | std::tuple< Ts... > && | t | ) | const |
Sets multiple table fields.
t | a tuple of {k0, v0, k1, v1, ...} |
|
protected |
lua_Integer nngn::lua::detail::table_base< CRTP >::size | ( | void | ) | const |