lua::LazyTableField Struct Reference

Lazy table field in lua (delayed table access) More...

#include <LazyTable.h>

Detailed Description

Lazy table field in lua (delayed table access)

It's a wrapper around table's field access. Evaluation of this lazy value means accessing the field of the table.

Definition at line 35 of file LazyTable.h.

Inheritance diagram for lua::LazyTableField:

Public Member Functions

virtual momemta::any operator() () const override
 Evaluate the lazy value. More...
 
void ensure_created ()
 Ensure the global table referenced by this struct exist. If not, create it.
 
void set (const momemta::any &value)
 Replace the value of the table field by a new one.
 
 LazyTableField (lua_State *L, const std::string &table_name, const std::string &key)
 
- Public Member Functions inherited from lua::Lazy
 Lazy (lua_State *L)
 

Public Attributes

std::string table_name
 The name of the global table.
 
std::string key
 The name of the field inside the table to retrieve when evaluated.
 
- Public Attributes inherited from lua::Lazy
lua_State * L
 The global lua state. This state must be valid for as long as this instance.
 

Member Function Documentation

◆ operator()()

momemta::any lua::LazyTableField::operator() ( ) const
overridevirtual

Evaluate the lazy value.

Returns
The value after evaluation

Implements lua::Lazy.

Definition at line 52 of file LazyTable.cc.


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