Lua-API++
2015-02-12-3
Lua-API++ library
|
Owner of a single stack slot. More...
Public Member Functions | |
Life cycle | |
Value (Valref src) | |
Create a copy of referenced value. | |
Value (Valobj src, Context &context) | |
Promote native value. | |
Value (Temporary src) | |
Take ownership of expression result. | |
Value & | operator= (Valobj newValue) |
Assign new value to owned stack slot. | |
Value (Value &&) | |
It is possible to return Value from functions. More... | |
~Value () noexcept | |
Public Member Functions inherited from Valref | |
Valref (const Valref &) noexcept=default | |
Copy constructor. More... | |
template<typename ValueType > | |
Valref & | operator= (ValueType &&val) |
Assignment. More... | |
template<typename T > | |
T | cast () const |
Explicit checked conversion to supported types. More... | |
template<typename T > | |
T | optcast (const T &backupValue=T()) const noexcept |
Safe conversion to supported types [Lua 5.2- only]. More... | |
template<typename T > | |
T | to () const noexcept |
Unchecked conversion to supported types. More... | |
template<typename T > | |
T | to (const T &backupValue) const noexcept |
Safe conversion to supported types. More... | |
operator bool () const | |
operator int () const | |
operator unsigned int () const | |
operator long long () const | |
operator unsigned long long () const | |
operator float () const | |
operator double () const | |
operator CFunction () const | |
operator LightUserData () const | |
operator const char * () const | |
operator std::string () const | |
template<typename T > | |
bool | is () const noexcept |
Check if the value convertible to given type. More... | |
bool | isInteger () const noexcept |
Check if the value is an integer number [Lua 5.3+ only] More... | |
ValueType | type () const noexcept |
Actual type of referenced value. | |
bool | operator== (Valobj &&rhs) const |
bool | operator!= (Valobj &&rhs) const |
bool | operator< (Valobj &&rhs) const |
bool | operator> (Valobj &&rhs) const |
bool | operator<= (Valobj &&rhs) const |
bool | operator>= (Valobj &&rhs) const |
Temporary | operator[] (Valobj &&index_) const noexcept |
Indexation. | |
template<typename... Args> | |
Temporary | operator() (Args &&...args) const noexcept |
Natural call form. More... | |
template<typename... Args> | |
Temporary | call (Args &&...args) const noexcept |
Call method. More... | |
template<typename... Args> | |
Temporary | pcall (Args &&...args) const noexcept |
Protected call method. More... | |
Temporary | upvalue (size_t index) const noexcept |
Upvalue access inside closures. More... | |
Valset | getUpvalues () const noexcept |
Retrieve upvalues and their names. More... | |
ClosureInfo | getClosureInfo () const noexcept |
Retrieve information about closure [Lua 5.2+ only]. More... | |
size_t | getClosureInfo () const noexcept |
Retrieve information about closure [Lua 5.1 only]. More... | |
Temporary | len () const noexcept |
Length [Lua 5.2+ only]. | |
size_t | rawlen () const noexcept |
Raw length (no metamethods) [Lua 5.2+ only]. | |
size_t | len () const noexcept |
Length [Lua 5.1 only]. | |
Temporary | mt () const noexcept |
Metatable. More... | |
Temporary | linked () const noexcept |
Linked value [Lua 5.3+ only]. More... | |
Additional Inherited Members | |
Related Functions inherited from Valref | |
bool | operator== (Valobj &&lhs, const Valref &rhs) |
bool | operator!= (Valobj &&lhs, const Valref &rhs) |
bool | operator< (Valobj &&lhs, const Valref &rhs) |
bool | operator> (Valobj &&lhs, const Valref &rhs) |
bool | operator<= (Valobj &&lhs, const Valref &rhs) |
bool | operator>= (Valobj &&lhs, const Valref &rhs) |
Temporary | operator& (Valobj &&lhs, Valobj &&rhs) const noexcept |
Concatenation. More... | |
Temporary | operator- (Valobj &&lhs) |
[Lua 5.2+ only] More... | |
Temporary | operator+ (Valobj &&lhs, const Valobj &rhs) noexcept |
[Lua 5.2+ only] More... | |
Temporary | operator- (Valobj &&lhs, const Valobj &rhs) noexcept |
[Lua 5.2+ only] More... | |
Temporary | operator* (Valobj &&lhs, const Valobj &rhs) noexcept |
[Lua 5.2+ only] More... | |
Temporary | operator/ (Valobj &&lhs, const Valobj &rhs) noexcept |
[Lua 5.2+ only] More... | |
Temporary | operator% (Valobj &&lhs, const Valobj &rhs) noexcept |
[Lua 5.2+ only] More... | |
Temporary | operator^ (Valobj &&lhs, const Valobj &rhs) noexcept |
Power [Lua 5.2+ only]. More... | |
Temporary | idiv (Valobj &&lhs, Valobj &&rhs) |
Integer division [Lua 5.3+ only]. More... | |
Temporary | band (Valobj &&lhs, Valobj &&rhs) |
Bitwise AND [Lua 5.3+ only]. More... | |
Temporary | bor (Valobj &&lhs, Valobj &&rhs) |
Bitwise OR [Lua 5.3+ only]. More... | |
Temporary | bxor (Valobj &&lhs, Valobj &&rhs) |
Bitwise XOR [Lua 5.3+ only]. More... | |
Temporary | bneg (Valobj &&lhs) |
Bitwise NOT [Lua 5.3+ only]. More... | |
Temporary | shl (Valobj &&lhs, Valobj &&rhs) |
Bit shift left [Lua 5.3+ only]. More... | |
Temporary | shr (Valobj &&lhs, Valobj &&rhs) |
Bit shift right [Lua 5.3+ only]. More... | |
Owner of a single stack slot.
This is basically a Valref which allocates its own slot on creation and frees it when destroyed. Its purpose is to anchor some value for repeated use.