Tramway SDK v0.1.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
tram::Value Class Reference

Generic, type-safe union. More...

#include <value.h>

Public Member Functions

 Value ()
 
 ~Value ()
 
 Value (const Value &other)
 
Valueoperator= (const Value &other)
 
bool operator== (const Value &other) const
 
 Value (bool value)
 
 Value (name_t value)
 
 Value (const char *value)
 
 Value (int8_t value)
 
 Value (int16_t value)
 
 Value (int64_t value)
 
 Value (uint8_t value)
 
 Value (uint16_t value)
 
 Value (uint64_t value)
 
 Value (double value)
 
 Value (int32_t value)
 
 Value (uint32_t value)
 
 Value (vec2 value)
 
 Value (vec3 value)
 
 Value (vec4 value)
 
 Value (quat value)
 
 Value (float value)
 
 operator bool () const
 
 operator name_t () const
 
 operator const char * () const
 
 operator int8_t () const
 
 operator int16_t () const
 
 operator int64_t () const
 
 operator uint8_t () const
 
 operator uint16_t () const
 
 operator uint64_t () const
 
 operator double () const
 
 operator int32_t () const
 
 operator uint32_t () const
 
 operator float () const
 
 operator vec2 () const
 
 operator vec3 () const
 
 operator vec4 () const
 
 operator quat () const
 
bool IsBool () const
 
bool IsInt () const
 
bool IsFloat () const
 
bool IsName () const
 
bool IsString () const
 
bool IsVec2 () const
 
bool IsVec3 () const
 
bool IsVec4 () const
 
bool IsQuat () const
 
int GetInt () const
 
float GetFloat () const
 
std::string ToString ()
 
Type GetType () const
 

Protected Member Functions

void AssertType (Type type) const
 

Protected Attributes

Type type
 
union {
   bool   bool_value
 
   name_t   name_value
 
   const char *   string_value
 
   int32_t   int32_value
 
   uint32_t   uint32_value
 
   float   float_value
 
   vec2   vec2_value
 
   vec3   vec3_value
 
   vec4   vec4_value
 
   quat   quat_value
 
}; 
 

Friends

class ValuePtr
 

Detailed Description

Generic, type-safe union.

Constructor & Destructor Documentation

◆ Value() [1/19]

tram::Value::Value ( )
inline

◆ ~Value()

tram::Value::~Value ( )
inline

◆ Value() [2/19]

tram::Value::Value ( const Value other)
inline

◆ Value() [3/19]

tram::Value::Value ( bool  value)
inline

◆ Value() [4/19]

tram::Value::Value ( name_t  value)
inline

◆ Value() [5/19]

tram::Value::Value ( const char *  value)
inline

◆ Value() [6/19]

tram::Value::Value ( int8_t  value)
inline

◆ Value() [7/19]

tram::Value::Value ( int16_t  value)
inline

◆ Value() [8/19]

tram::Value::Value ( int64_t  value)
inline

◆ Value() [9/19]

tram::Value::Value ( uint8_t  value)
inline

◆ Value() [10/19]

tram::Value::Value ( uint16_t  value)
inline

◆ Value() [11/19]

tram::Value::Value ( uint64_t  value)
inline

◆ Value() [12/19]

tram::Value::Value ( double  value)
inline

◆ Value() [13/19]

tram::Value::Value ( int32_t  value)
inline

◆ Value() [14/19]

tram::Value::Value ( uint32_t  value)
inline

◆ Value() [15/19]

tram::Value::Value ( vec2  value)
inline

◆ Value() [16/19]

tram::Value::Value ( vec3  value)
inline

◆ Value() [17/19]

tram::Value::Value ( vec4  value)
inline

◆ Value() [18/19]

tram::Value::Value ( quat  value)
inline

◆ Value() [19/19]

tram::Value::Value ( float  value)
inline

Member Function Documentation

◆ AssertType()

void tram::Value::AssertType ( Type  type) const
inlineprotected

◆ GetFloat()

float tram::Value::GetFloat ( ) const
inline

◆ GetInt()

int tram::Value::GetInt ( ) const
inline

◆ GetType()

Type tram::Value::GetType ( ) const
inline

◆ IsBool()

bool tram::Value::IsBool ( ) const
inline

◆ IsFloat()

bool tram::Value::IsFloat ( ) const
inline

◆ IsInt()

bool tram::Value::IsInt ( ) const
inline

◆ IsName()

bool tram::Value::IsName ( ) const
inline

◆ IsQuat()

bool tram::Value::IsQuat ( ) const
inline

◆ IsString()

bool tram::Value::IsString ( ) const
inline

◆ IsVec2()

bool tram::Value::IsVec2 ( ) const
inline

◆ IsVec3()

bool tram::Value::IsVec3 ( ) const
inline

◆ IsVec4()

bool tram::Value::IsVec4 ( ) const
inline

◆ operator bool()

tram::Value::operator bool ( ) const
inline

◆ operator const char *()

tram::Value::operator const char * ( ) const
inline

◆ operator double()

tram::Value::operator double ( ) const
inline

◆ operator float()

tram::Value::operator float ( ) const
inline

◆ operator int16_t()

tram::Value::operator int16_t ( ) const
inline

◆ operator int32_t()

tram::Value::operator int32_t ( ) const
inline

◆ operator int64_t()

tram::Value::operator int64_t ( ) const
inline

◆ operator int8_t()

tram::Value::operator int8_t ( ) const
inline

◆ operator name_t()

tram::Value::operator name_t ( ) const
inline

◆ operator quat()

tram::Value::operator quat ( ) const
inline

◆ operator uint16_t()

tram::Value::operator uint16_t ( ) const
inline

◆ operator uint32_t()

tram::Value::operator uint32_t ( ) const
inline

◆ operator uint64_t()

tram::Value::operator uint64_t ( ) const
inline

◆ operator uint8_t()

tram::Value::operator uint8_t ( ) const
inline

◆ operator vec2()

tram::Value::operator vec2 ( ) const
inline

◆ operator vec3()

tram::Value::operator vec3 ( ) const
inline

◆ operator vec4()

tram::Value::operator vec4 ( ) const
inline

◆ operator=()

Value & tram::Value::operator= ( const Value other)
inline

◆ operator==()

bool tram::Value::operator== ( const Value other) const
inline

◆ ToString()

std::string tram::Value::ToString ( )
inline

Friends And Related Function Documentation

◆ ValuePtr

friend class ValuePtr
friend

Member Data Documentation

◆ 

union { ... } tram::Value::@45

◆ bool_value

bool tram::Value::bool_value

◆ float_value

float tram::Value::float_value

◆ int32_value

int32_t tram::Value::int32_value

◆ name_value

name_t tram::Value::name_value

◆ quat_value

quat tram::Value::quat_value

◆ string_value

const char* tram::Value::string_value

◆ type

Type tram::Value::type
protected

◆ uint32_value

uint32_t tram::Value::uint32_value

◆ vec2_value

vec2 tram::Value::vec2_value

◆ vec3_value

vec3 tram::Value::vec3_value

◆ vec4_value

vec4 tram::Value::vec4_value

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