xoreos  0.0.5
Public Member Functions | Private Attributes | List of all members
Aurora::Lua::Variable Class Reference

#include <variable.h>

Collaboration diagram for Aurora::Lua::Variable:
Collaboration graph
[legend]

Public Member Functions

 Variable (Type type, const Common::UString &exactType="")
 
 Variable (bool value)
 
 Variable (int32 value)
 
 Variable (float value)
 
 Variable (const char *value)
 
 Variable (const Common::UString &value)
 
 Variable (const TableRef &value)
 
 Variable (const FunctionRef &value)
 
 Variable (void *value, const Common::UString &exactType)
 
 Variable (const Variable &var)
 
 ~Variable ()
 
void setType (Type type, const Common::UString &exactType="")
 
Variableoperator= (const Variable &var)
 
Variableoperator= (bool value)
 
Variableoperator= (int32 value)
 
Variableoperator= (float value)
 
Variableoperator= (const char *value)
 
Variableoperator= (const Common::UString &value)
 
Variableoperator= (const TableRef &value)
 
Variableoperator= (const FunctionRef &value)
 
Variableoperator= (void *value)
 
bool operator== (const Variable &var) const
 
bool operator!= (const Variable &var) const
 
Type getType () const
 
const Common::UStringgetExactType () const
 
bool getBool () const
 
int32 getInt () const
 
float getFloat () const
 
Common::UStringgetString ()
 
const Common::UStringgetString () const
 
TableRefgetTable ()
 
const TableRefgetTable () const
 
const FunctionRefgetFunction () const
 
void * getRawUserType () const
 
template<typename T >
T * getUserType () const
 

Private Attributes

Type _type
 
Common::UString _exactType
 
union {
   bool   _bool
 
   float   _float
 
   Common::UString *   _string
 
   TableRef *   _table
 
   FunctionRef *   _function
 
   void *   _data
 
_value
 

Detailed Description

Definition at line 36 of file variable.h.

Constructor & Destructor Documentation

◆ Variable() [1/10]

Aurora::Lua::Variable::Variable ( Type  type,
const Common::UString exactType = "" 
)

Definition at line 35 of file variable.cpp.

References setType().

Here is the call graph for this function:

◆ Variable() [2/10]

Aurora::Lua::Variable::Variable ( bool  value)

Definition at line 39 of file variable.cpp.

References Aurora::Lua::kTypeBoolean, and setType().

Here is the call graph for this function:

◆ Variable() [3/10]

Aurora::Lua::Variable::Variable ( int32  value)

Definition at line 44 of file variable.cpp.

References Aurora::Lua::kTypeNumber, and setType().

Here is the call graph for this function:

◆ Variable() [4/10]

Aurora::Lua::Variable::Variable ( float  value)

Definition at line 49 of file variable.cpp.

References Aurora::Lua::kTypeNumber, and setType().

Here is the call graph for this function:

◆ Variable() [5/10]

Aurora::Lua::Variable::Variable ( const char *  value)

Definition at line 54 of file variable.cpp.

References Aurora::Lua::kTypeString, and setType().

Here is the call graph for this function:

◆ Variable() [6/10]

Aurora::Lua::Variable::Variable ( const Common::UString value)

Definition at line 59 of file variable.cpp.

References Aurora::Lua::kTypeString, and setType().

Here is the call graph for this function:

◆ Variable() [7/10]

Aurora::Lua::Variable::Variable ( const TableRef value)

Definition at line 64 of file variable.cpp.

References Aurora::Lua::kTypeTable, and setType().

Here is the call graph for this function:

◆ Variable() [8/10]

Aurora::Lua::Variable::Variable ( const FunctionRef value)

Definition at line 69 of file variable.cpp.

References Aurora::Lua::kTypeFunction, and setType().

Here is the call graph for this function:

◆ Variable() [9/10]

Aurora::Lua::Variable::Variable ( void *  value,
const Common::UString exactType 
)

Definition at line 74 of file variable.cpp.

References Common::UString::empty(), Aurora::Lua::kTypeUserType, and setType().

Here is the call graph for this function:

◆ Variable() [10/10]

Aurora::Lua::Variable::Variable ( const Variable var)

Definition at line 81 of file variable.cpp.

◆ ~Variable()

Aurora::Lua::Variable::~Variable ( )

Definition at line 85 of file variable.cpp.

References Aurora::Lua::kTypeNone, and setType().

Here is the call graph for this function:

Member Function Documentation

◆ getBool()

bool Aurora::Lua::Variable::getBool ( ) const

Definition at line 287 of file variable.cpp.

References _type, _value, and Aurora::Lua::kTypeBoolean.

Referenced by Aurora::Lua::TableRef::getBooleanAt(), and Aurora::Lua::Stack::pushVariable().

Here is the caller graph for this function:

◆ getExactType()

const Common::UString & Aurora::Lua::Variable::getExactType ( ) const

Definition at line 283 of file variable.cpp.

References _exactType.

Referenced by Aurora::Lua::Stack::pushVariable().

Here is the caller graph for this function:

◆ getFloat()

float Aurora::Lua::Variable::getFloat ( ) const

Definition at line 303 of file variable.cpp.

References _type, _value, and Aurora::Lua::kTypeNumber.

Referenced by Aurora::Lua::TableRef::getFloatAt(), and Aurora::Lua::Stack::pushVariable().

Here is the caller graph for this function:

◆ getFunction()

const FunctionRef & Aurora::Lua::Variable::getFunction ( ) const

Definition at line 343 of file variable.cpp.

References _type, _value, and Aurora::Lua::kTypeFunction.

Referenced by Aurora::Lua::TableRef::getFunctionAt(), Aurora::Lua::ScriptManager::getGlobalFunction(), and Aurora::Lua::Stack::pushVariable().

Here is the caller graph for this function:

◆ getInt()

int32 Aurora::Lua::Variable::getInt ( ) const

Definition at line 295 of file variable.cpp.

References _type, _value, and Aurora::Lua::kTypeNumber.

Referenced by Aurora::Lua::TableRef::getIntAt().

Here is the caller graph for this function:

◆ getRawUserType()

void * Aurora::Lua::Variable::getRawUserType ( ) const

Definition at line 351 of file variable.cpp.

References _type, _value, and Aurora::Lua::kTypeUserType.

Referenced by Aurora::Lua::getRawCppObjectFromVariable(), Aurora::Lua::TableRef::getRawUserTypeAt(), getUserType(), and Aurora::Lua::Stack::pushVariable().

Here is the caller graph for this function:

◆ getString() [1/2]

Common::UString & Aurora::Lua::Variable::getString ( )

Definition at line 319 of file variable.cpp.

References _type, _value, and Aurora::Lua::kTypeString.

Referenced by Aurora::Lua::TableRef::getStringAt(), and Aurora::Lua::Stack::pushVariable().

Here is the caller graph for this function:

◆ getString() [2/2]

const Common::UString & Aurora::Lua::Variable::getString ( ) const

Definition at line 311 of file variable.cpp.

References _type, _value, and Aurora::Lua::kTypeString.

◆ getTable() [1/2]

TableRef & Aurora::Lua::Variable::getTable ( )

◆ getTable() [2/2]

const TableRef & Aurora::Lua::Variable::getTable ( ) const

Definition at line 335 of file variable.cpp.

References _type, _value, and Aurora::Lua::kTypeTable.

◆ getType()

Type Aurora::Lua::Variable::getType ( ) const

Definition at line 279 of file variable.cpp.

References _type.

Referenced by Aurora::Lua::getRawCppObjectFromVariable(), and Aurora::Lua::Stack::pushVariable().

Here is the caller graph for this function:

◆ getUserType()

template<typename T >
T * Aurora::Lua::Variable::getUserType ( ) const
inline

Definition at line 97 of file variable.h.

References getRawUserType().

Here is the call graph for this function:

◆ operator!=()

bool Aurora::Lua::Variable::operator!= ( const Variable var) const

Definition at line 275 of file variable.cpp.

◆ operator=() [1/9]

Variable & Aurora::Lua::Variable::operator= ( const Variable var)

Definition at line 148 of file variable.cpp.

References _exactType, _function, _string, _table, _type, _value, Aurora::Lua::kTypeFunction, Aurora::Lua::kTypeString, Aurora::Lua::kTypeTable, and setType().

Here is the call graph for this function:

◆ operator=() [2/9]

Variable & Aurora::Lua::Variable::operator= ( bool  value)

Definition at line 173 of file variable.cpp.

References _type, _value, and Aurora::Lua::kTypeBoolean.

◆ operator=() [3/9]

Variable & Aurora::Lua::Variable::operator= ( int32  value)

Definition at line 182 of file variable.cpp.

References _type, _value, and Aurora::Lua::kTypeNumber.

◆ operator=() [4/9]

Variable & Aurora::Lua::Variable::operator= ( float  value)

Definition at line 191 of file variable.cpp.

References _type, _value, and Aurora::Lua::kTypeNumber.

◆ operator=() [5/9]

Variable & Aurora::Lua::Variable::operator= ( const char *  value)

Definition at line 200 of file variable.cpp.

References _type, _value, and Aurora::Lua::kTypeString.

◆ operator=() [6/9]

Variable & Aurora::Lua::Variable::operator= ( const Common::UString value)

Definition at line 209 of file variable.cpp.

References _type, _value, and Aurora::Lua::kTypeString.

◆ operator=() [7/9]

Variable & Aurora::Lua::Variable::operator= ( const TableRef value)

Definition at line 218 of file variable.cpp.

References _exactType, _type, _value, and Aurora::Lua::kTypeTable.

◆ operator=() [8/9]

Variable & Aurora::Lua::Variable::operator= ( const FunctionRef value)

Definition at line 228 of file variable.cpp.

References _type, _value, and Aurora::Lua::kTypeFunction.

◆ operator=() [9/9]

Variable & Aurora::Lua::Variable::operator= ( void *  value)

Definition at line 237 of file variable.cpp.

References _type, _value, and Aurora::Lua::kTypeUserType.

◆ operator==()

bool Aurora::Lua::Variable::operator== ( const Variable var) const

◆ setType()

void Aurora::Lua::Variable::setType ( Type  type,
const Common::UString exactType = "" 
)

Member Data Documentation

◆ _bool

bool Aurora::Lua::Variable::_bool

Definition at line 87 of file variable.h.

Referenced by operator==().

◆ _data

void* Aurora::Lua::Variable::_data

Definition at line 92 of file variable.h.

Referenced by operator==().

◆ _exactType

Common::UString Aurora::Lua::Variable::_exactType
private

Definition at line 84 of file variable.h.

Referenced by getExactType(), operator=(), and setType().

◆ _float

float Aurora::Lua::Variable::_float

Definition at line 88 of file variable.h.

Referenced by operator==().

◆ _function

FunctionRef* Aurora::Lua::Variable::_function

Definition at line 91 of file variable.h.

Referenced by operator=().

◆ _string

Common::UString* Aurora::Lua::Variable::_string

Definition at line 89 of file variable.h.

Referenced by operator=(), and operator==().

◆ _table

TableRef* Aurora::Lua::Variable::_table

Definition at line 90 of file variable.h.

Referenced by operator=().

◆ _type

Type Aurora::Lua::Variable::_type
private

◆ _value

union { ... } Aurora::Lua::Variable::_value

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