#include <LuaVariable.hpp>
Public Types | |
| typedef std::vector< LuaValue > | KeyList |
| A sequence of keys, used to access nested tables. | |
Public Member Functions | |
| const LuaValue & | operator= (const LuaValue &rhs) |
| LuaValue | value () const |
| LuaVariable | operator[] (const LuaValue &key) const |
| LuaValueList | operator() (const LuaValueList ¶ms) |
| LuaValueList | operator() () |
| LuaValueList | operator() (const LuaValue ¶m) |
| LuaValueList | operator() (const LuaValue ¶m1, const LuaValue ¶m2) |
| LuaValueList | operator() (const LuaValue ¶m1, const LuaValue ¶m2, const LuaValue ¶m3) |
| LuaValueList | operator() (const LuaValue ¶m1, const LuaValue ¶m2, const LuaValue ¶m3, const LuaValue ¶m4) |
| LuaValueList | operator() (const LuaValue ¶m1, const LuaValue ¶m2, const LuaValue ¶m3, const LuaValue ¶m4, const LuaValue ¶m5) |
| bool | operator== (const LuaValue &rhs) const |
| bool | operator== (const LuaVariable &rhs) const |
| bool | operator!= (const LuaVariable &rhs) const |
| const KeyList & | getKeys () const |
| void | pushLastTable () |
| lua_State * | getState () |
Private Member Functions | |
| LuaVariable (lua_State *state, const LuaValue &key, const KeyList &predKeys=KeyList()) | |
| void | pushTheReferencedValue () const |
Private Attributes | |
| lua_State * | state_ |
The Lua state in which this LuaVariable lives. | |
| KeyList | keys_ |
Friends | |
| class | LuaState |
LuaValue, a LuaVariable necessarily has a real counterpart in a Lua state. Thus, when something is assigned to a LuaVariable, the value of the corresponding variable in the Lua state is changed, too.
LuaVariables cannot be directly constructed. They are designed to be returned by LuaState's subscript operator.
Definition at line 43 of file LuaVariable.hpp.
|
|
A sequence of keys, used to access nested tables.
Definition at line 247 of file LuaVariable.hpp. |
|
||||||||||||||||
|
Constructs a
|
|
|
Returns the sequence of keys used to reach this variable.
Definition at line 253 of file LuaVariable.hpp. References keys_. |
|
|
Returns the LuaState in which this
Definition at line 271 of file LuaVariable.hpp. References state_. |
|
|
Checks whether this
Definition at line 243 of file LuaVariable.hpp. |
|
||||||||||||||||||||||||
|
Assuming that this
|
|
||||||||||||||||||||
|
Assuming that this
|
|
||||||||||||||||
|
Assuming that this
|
|
||||||||||||
|
Assuming that this
|
|
|
Assuming that this
|
|
|
Assuming that this
|
|
|
Assuming that this
|
|
|
Assigns a new value to this
|
|
|
Checks whether this
Definition at line 234 of file LuaVariable.hpp. |
|
|
Checks whether the value stored in this variable is equal to the value at
Definition at line 225 of file LuaVariable.hpp. References value(). |
|
|
Assuming that this
|
|
|
Pushes into the Lua stack the table storing this variable. Now, let's try to make this clearer... First, every Lua variable is stored in a table (even global variables, because Lua stores them in a "table of globals"). So, this method will find the table where this variable is stored (traversing a sequence of nested tables, if necessary), and push it onto the Lua stack (of the
|
|
|
Pushes onto the Lua stack the value referenced by this
|
|
|
Returns the value associated with this variable. If the variable does not exist, returns
Referenced by operator==(). |
|
|
Definition at line 45 of file LuaVariable.hpp. |
|
|
The sequence of keys used to get to this variable. For a global variable, this will consist of a single key; for variables inside nested tables, this sequence can be arbitrarily long.
Just to relate this with the parameters passed to the constructor: this sequence equals to Definition at line 312 of file LuaVariable.hpp. Referenced by getKeys(), operator!=(), and operator==(). |
|
|
The Lua state in which this
Definition at line 303 of file LuaVariable.hpp. Referenced by getState(), operator!=(), and operator==(). |
1.4.6