nngn
Loading...
Searching...
No Matches
nngn::lua::detail::table_base< CRTP > Class Template Reference

CRTP base for stack table types. More...

#include <table.h>

Inheritance diagram for nngn::lua::detail::table_base< CRTP >:
Collaboration diagram for nngn::lua::detail::table_base< CRTP >:

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
 

Detailed Description

template<typename CRTP>
class nngn::lua::detail::table_base< CRTP >

CRTP base for stack table types.

Member Function Documentation

◆ begin()

template<typename CRTP >
table_iter< const CRTP > nngn::lua::detail::table_base< CRTP >::begin ( void ) const

lua_next-based iteration.

◆ begin_op()

template<typename CRTP >
int nngn::lua::detail::table_base< CRTP >::begin_op ( void ) const
inlineprivate
Here is the call graph for this function:

◆ crtp()

template<typename CRTP >
const CRTP & nngn::lua::detail::table_base< CRTP >::crtp ( void ) const
inlineprivate
Here is the caller graph for this function:

◆ end()

template<typename CRTP >
table_iter< const CRTP > nngn::lua::detail::table_base< CRTP >::end ( void ) const

Sentinel for begin.

◆ end_op()

template<typename CRTP >
void nngn::lua::detail::table_base< CRTP >::end_op ( int ) const
inlineprivate

◆ get_common()

template<typename CRTP >
template<op_mode mode, typename T >
T nngn::lua::detail::table_base< CRTP >::get_common ( auto && k,
T && def = T{} ) const
protected
Here is the call graph for this function:

◆ get_field()

template<typename CRTP >
template<typename T >
T nngn::lua::detail::table_base< CRTP >::get_field ( auto && k,
T && def = T{} ) const

Gets field, with optional default value.

◆ ibegin()

template<typename CRTP >
table_seq_iter< const CRTP > nngn::lua::detail::table_base< CRTP >::ibegin ( void ) const

ipairs-style iteration.

See also
nngn::lua::ipairs

◆ iend()

template<typename CRTP >
table_seq_iter< const CRTP > nngn::lua::detail::table_base< CRTP >::iend ( void ) const

Sentinel for ibegin.

◆ operator[]()

template<typename CRTP >
template<typename K >
table_proxy< CRTP, std::decay_t< K > > nngn::lua::detail::table_base< CRTP >::operator[] ( K && k) const

◆ raw_get()

template<typename CRTP >
template<typename T >
T nngn::lua::detail::table_base< CRTP >::raw_get ( auto && k,
T && def = T{} ) const

Gets field without meta methods.

◆ raw_set()

template<typename CRTP >
void nngn::lua::detail::table_base< CRTP >::raw_set ( auto && k,
auto && v ) const

Sets a table field without meta methods.

Here is the caller graph for this function:

◆ set() [1/2]

template<typename CRTP >
void nngn::lua::detail::table_base< CRTP >::set ( auto && k,
auto && v ) const

Sets a table field.

Here is the caller graph for this function:

◆ set() [2/2]

template<typename CRTP >
template<typename ... Ts>
void nngn::lua::detail::table_base< CRTP >::set ( std::tuple< Ts... > && t) const

Sets multiple table fields.

Parameters
ta tuple of {k0, v0, k1, v1, ...}

◆ set_common()

template<typename CRTP >
template<op_mode mode>
void nngn::lua::detail::table_base< CRTP >::set_common ( auto && k,
auto && v ) const
protected

◆ size()

template<typename CRTP >
lua_Integer nngn::lua::detail::table_base< CRTP >::size ( void ) const
See also
lua_len
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: