|
Nebula
|
#include <variant.h>
An "any type" variable.
Since the Variant class has a rich set of assignment and cast operators, a variant variable can most of the time be used like a normal C++ variable.
Public Types | |
| enum | Type { Void , Byte , Short , UShort , Int , UInt , Int64 , UInt64 , Float , Double , Bool , Vec2 , Vec3 , Vec4 , Quaternion , String , Mat4 , Transform44 , Blob , Guid , Object , VoidPtr , IntArray , FloatArray , BoolArray , Vec2Array , Vec3Array , Vec4Array , StringArray , Mat4Array , BlobArray , GuidArray , NumTypes } |
| variant types More... | |
Public Member Functions | |
| Variant () | |
| default constructor | |
| Variant (byte rhs) | |
| byte constructor | |
| Variant (short rhs) | |
| short constructor | |
| Variant (ushort rhs) | |
| ushort constructor | |
| Variant (int rhs) | |
| int constructor | |
| Variant (uint rhs) | |
| uint constructor | |
| Variant (int64_t rhs) | |
| int64 constructor | |
| Variant (uint64_t rhs) | |
| uint64_t constructor | |
| Variant (float rhs) | |
| float constructor | |
| Variant (double rhs) | |
| double constructor | |
| Variant (bool rhs) | |
| bool constructor | |
| Variant (const Math::vec2 &v) | |
| vec2 constructor | |
| Variant (const Math::vec3 &v) | |
| vec4 constructor | |
| Variant (const Math::vec4 &v) | |
| vec4 constructor | |
| Variant (const Math::quat &q) | |
| quaternion constructor | |
| Variant (const Math::mat4 &m) | |
| mat4 constructor | |
| Variant (const Math::transform44 &m) | |
| transform44 constructor | |
| Variant (const Util::String &rhs) | |
| string constructor | |
| Variant (const Util::Blob &blob) | |
| blob constructor | |
| Variant (const Util::Guid &guid) | |
| guid constructor | |
| Variant (const char *chrPtr) | |
| const char constructor | |
| Variant (Core::RefCounted *ptr) | |
| object constructor | |
| Variant (void *ptr) | |
| void pointer constructor | |
| Variant (std::nullptr_t) | |
| null pointer construction | |
| Variant (const Util::Array< int > &rhs) | |
| int array constructor | |
| Variant (const Util::Array< float > &rhs) | |
| float array constructor | |
| Variant (const Util::Array< bool > &rhs) | |
| bool array constructor | |
| Variant (const Util::Array< Math::vec2 > &rhs) | |
| vec2 array constructor | |
| Variant (const Util::Array< Math::vec3 > &rhs) | |
| vec3 array constructor | |
| Variant (const Util::Array< Math::vec4 > &rhs) | |
| vec4 array constructor | |
| Variant (const Util::Array< Math::mat4 > &rhs) | |
| mat4 array constructor | |
| Variant (const Util::Array< Util::String > &rhs) | |
| string array constructor | |
| Variant (const Util::Array< Util::Blob > &rhs) | |
| blob array constructor | |
| Variant (const Util::Array< Util::Guid > &rhs) | |
| guid array constructor | |
| Variant (const Variant &rhs) | |
| copy constructor | |
| ~Variant () | |
| destructor | |
| void | SetType (Type t) |
| set type of attribute | |
| Type | GetType () const |
| get type | |
| void | Clear () |
| clear content, resets type to void | |
| void | operator= (const Variant &rhs) |
| assignment operator | |
| void | operator= (byte val) |
| byte assignment operator | |
| void | operator= (short val) |
| short assignment operator | |
| void | operator= (ushort val) |
| ushort assignment operator | |
| void | operator= (int val) |
| int assignment operator | |
| void | operator= (uint val) |
| uint assignment operator | |
| void | operator= (int64_t val) |
| int assignment operator | |
| void | operator= (uint64_t val) |
| uint assignment operator | |
| void | operator= (float val) |
| float assignment operator | |
| void | operator= (double val) |
| double assignment operator | |
| void | operator= (bool val) |
| bool assigment operator | |
| void | operator= (const Math::vec2 &val) |
| vec2 assignment operator | |
| void | operator= (const Math::vec3 &val) |
| vec3 assignment operator | |
| void | operator= (const Math::vec4 &val) |
| vec4 assignment operator | |
| void | operator= (const Math::quat &val) |
| quat assignment operator | |
| void | operator= (const Math::mat4 &val) |
| mat4 assignment operator | |
| void | operator= (const Math::transform44 &val) |
| transform44 assignment operator | |
| void | operator= (const Util::String &s) |
| string assignment operator | |
| void | operator= (const Util::Blob &val) |
| blob assignment operator | |
| void | operator= (const Util::Guid &val) |
| guid assignment operator | |
| void | operator= (const char *chrPtr) |
| char pointer assignment | |
| void | operator= (Core::RefCounted *ptr) |
| object assignment | |
| void | operator= (void *ptr) |
| object assignment | |
| void | operator= (const Util::Array< int > &rhs) |
| int array assignment | |
| void | operator= (const Util::Array< float > &rhs) |
| float array assignment | |
| void | operator= (const Util::Array< bool > &rhs) |
| bool array assignment | |
| void | operator= (const Util::Array< Math::vec2 > &rhs) |
| vec2 array assignment | |
| void | operator= (const Util::Array< Math::vec3 > &rhs) |
| vec3 array assignment | |
| void | operator= (const Util::Array< Math::vec4 > &rhs) |
| vec4 array assignment | |
| void | operator= (const Util::Array< Math::mat4 > &rhs) |
| mat4 array assignment | |
| void | operator= (const Util::Array< Util::String > &rhs) |
| string array assignment | |
| void | operator= (const Util::Array< Util::Blob > &rhs) |
| blob array assignment | |
| void | operator= (const Util::Array< Util::Guid > &rhs) |
| guid array assignment | |
| bool | operator== (const Variant &rhs) const |
| equality operator | |
| bool | operator== (byte rhs) const |
| byte equality operator | |
| bool | operator== (short rhs) const |
| short equality operator | |
| bool | operator== (ushort rhs) const |
| ushort equality operator | |
| bool | operator== (int rhs) const |
| int equality operator | |
| bool | operator== (uint rhs) const |
| uint equality operator | |
| bool | operator== (int64_t rhs) const |
| int equality operator | |
| bool | operator== (uint64_t rhs) const |
| uint equality operator | |
| bool | operator== (float rhs) const |
| float equality operator | |
| bool | operator== (double rhs) const |
| double equality operator | |
| bool | operator== (bool rhs) const |
| bool equality operator | |
| bool | operator== (const Math::vec2 &rhs) const |
| vec2 equality operator | |
| bool | operator== (const Math::vec4 &rhs) const |
| vec4 equality operator | |
| bool | operator== (const Math::quat &rhs) const |
| vec4 equality operator | |
| bool | operator== (const Util::String &rhs) const |
| string equality operator | |
| bool | operator== (const Util::Guid &rhs) const |
| guid equality operator | |
| bool | operator== (const char *chrPtr) const |
| char ptr equality operator | |
| bool | operator== (Core::RefCounted *ptr) const |
| pointer equality operator | |
| bool | operator== (void *ptr) const |
| pointer equality operator | |
| bool | operator!= (const Variant &rhs) const |
| inequality operator | |
| bool | operator!= (byte rhs) const |
| byte inequality operator | |
| bool | operator!= (short rhs) const |
| short inequality operator | |
| bool | operator!= (ushort rhs) const |
| ushort inequality operator | |
| bool | operator!= (int rhs) const |
| int inequality operator | |
| bool | operator!= (uint rhs) const |
| uint inequality operator | |
| bool | operator!= (int64_t rhs) const |
| int inequality operator | |
| bool | operator!= (uint64_t rhs) const |
| uint inequality operator | |
| bool | operator!= (float rhs) const |
| float inequality operator | |
| bool | operator!= (double rhs) const |
| double inequality operator | |
| bool | operator!= (bool rhs) const |
| bool inequality operator | |
| bool | operator!= (const Math::vec2 &rhs) const |
| vec2 inequality operator | |
| bool | operator!= (const Math::vec4 &rhs) const |
| vec4 inequality operator | |
| bool | operator!= (const Math::quat &rhs) const |
| quaternion inequality operator | |
| bool | operator!= (const Util::String &rhs) const |
| string inequality operator | |
| bool | operator!= (const Util::Guid &rhs) const |
| guid inequality operator | |
| bool | operator!= (const char *chrPtr) const |
| char ptr inequality operator | |
| bool | operator!= (Core::RefCounted *ptr) const |
| pointer equality operator | |
| bool | operator!= (void *ptr) const |
| pointer equality operator | |
| bool | operator> (const Variant &rhs) const |
| greater operator | |
| bool | operator< (const Variant &rhs) const |
| less operator | |
| bool | operator>= (const Variant &rhs) const |
| greater equal operator | |
| bool | operator<= (const Variant &rhs) const |
| less equal operator | |
| void | SetByte (byte val) |
| set byte content | |
| byte | GetByte () const |
| get byte content | |
| void | SetShort (short val) |
| set short content | |
| short | GetShort () const |
| get short content | |
| void | SetUShort (ushort val) |
| set ushort content | |
| ushort | GetUShort () const |
| get short content | |
| void | SetInt (int val) |
| set integer content | |
| int | GetInt () const |
| get integer content | |
| void | SetUInt (uint val) |
| set unsigned integer content | |
| uint | GetUInt () const |
| get unsigned integer content | |
| void | SetInt64 (int64_t val) |
| set integer content | |
| int64_t | GetInt64 () const |
| get integer content | |
| void | SetUInt64 (uint64_t val) |
| set unsigned integer content | |
| uint64_t | GetUInt64 () const |
| get unsigned integer content | |
| void | SetFloat (float val) |
| set float content | |
| float | GetFloat () const |
| get float content | |
| void | SetDouble (double val) |
| set double content | |
| double | GetDouble () const |
| get double content | |
| void | SetBool (bool val) |
| set bool content | |
| bool | GetBool () const |
| get bool content | |
| void | SetString (const Util::String &val) |
| set string content | |
| const Util::String & | GetString () const |
| get string content | |
| void | SetVec2 (const Math::vec2 &val) |
| set vec2 content | |
| Math::vec2 | GetVec2 () const |
| get vec2 content | |
| void | SetVec3 (const Math::vec3 &val) |
| set vec4 content | |
| Math::vec3 | GetVec3 () const |
| get vec4 content | |
| void | SetVec4 (const Math::vec4 &val) |
| set vec4 content | |
| Math::vec4 | GetVec4 () const |
| get vec4 content | |
| void | SetQuat (const Math::quat &val) |
| set quaternion content | |
| Math::quat | GetQuat () const |
| get quaternion content | |
| void | SetMat4 (const Math::mat4 &val) |
| set mat4 content | |
| const Math::mat4 & | GetMat4 () const |
| get mat4 content | |
| void | SetTransform44 (const Math::transform44 &val) |
| set transform44 content | |
| const Math::transform44 & | GetTransform44 () const |
| get transform44 content | |
| void | SetBlob (const Util::Blob &val) |
| set blob | |
| const Util::Blob & | GetBlob () const |
| get blob | |
| void | SetGuid (const Util::Guid &val) |
| set guid content | |
| const Util::Guid & | GetGuid () const |
| get guid content | |
| void | SetObject (Core::RefCounted *ptr) |
| set object pointer | |
| Core::RefCounted * | GetObject () const |
| get object pointer | |
| void | SetVoidPtr (void *ptr) |
| set opaque void pointer | |
| void * | GetVoidPtr () const |
| get void pointer | |
| void | SetIntArray (const Util::Array< int > &val) |
| set int array content | |
| const Util::Array< int > & | GetIntArray () const |
| get int array content | |
| void | SetFloatArray (const Util::Array< float > &val) |
| set float array content | |
| const Util::Array< float > & | GetFloatArray () const |
| get float array content | |
| void | SetBoolArray (const Util::Array< bool > &val) |
| set bool array content | |
| const Util::Array< bool > & | GetBoolArray () const |
| get bool array content | |
| void | SetVec2Array (const Util::Array< Math::vec2 > &val) |
| set vec2 array content | |
| const Util::Array< Math::vec2 > & | GetVec2Array () const |
| get vec2 array content | |
| void | SetVec3Array (const Util::Array< Math::vec3 > &val) |
| set vec4 array content | |
| const Util::Array< Math::vec3 > & | GetVec3Array () const |
| get vec4 array content | |
| void | SetVec4Array (const Util::Array< Math::vec4 > &val) |
| set vec4 array content | |
| const Util::Array< Math::vec4 > & | GetVec4Array () const |
| get vec4 array content | |
| void | SetMat4Array (const Util::Array< Math::mat4 > &val) |
| set mat4 array content | |
| const Util::Array< Math::mat4 > & | GetMat4Array () const |
| get mat4 array content | |
| void | SetStringArray (const Util::Array< Util::String > &val) |
| set string array content | |
| const Util::Array< Util::String > & | GetStringArray () const |
| get string array content | |
| void | SetGuidArray (const Util::Array< Util::Guid > &val) |
| set guid array content | |
| const Util::Array< Util::Guid > & | GetGuidArray () const |
| get guid array content | |
| void | SetBlobArray (const Util::Array< Util::Blob > &val) |
| set blob array content | |
| const Util::Array< Util::Blob > & | GetBlobArray () const |
| get blob array content | |
| template<typename TYPE> | |
| TYPE | Get () const |
| Templated get method. | |
| Util::String | ToString () const |
| convert value to string | |
| bool | SetParseString (const Util::String &string) |
| set value from string, if type doesn't match, returns false | |
| const SizeT | Size () const |
| get size of data | |
| const void * | AsVoidPtr () const |
| get pointer to data | |
| template<> | |
| byte | Get () const |
| template<> | |
| short | Get () const |
| template<> | |
| int | Get () const |
| template<> | |
| uint | Get () const |
| template<> | |
| int64_t | Get () const |
| template<> | |
| uint64_t | Get () const |
| template<> | |
| bool | Get () const |
| template<> | |
| double | Get () const |
| template<> | |
| float | Get () const |
| template<> | |
| Math::vec2 | Get () const |
| template<> | |
| Math::vec3 | Get () const |
| template<> | |
| Math::vec4 | Get () const |
| template<> | |
| Math::quat | Get () const |
| template<> | |
| Math::mat4 | Get () const |
| template<> | |
| Math::transform44 | Get () const |
| template<> | |
| Util::String | Get () const |
| template<> | |
| Util::Guid | Get () const |
| template<> | |
| Util::Blob | Get () const |
| template<> | |
| Util::Array< int > | Get () const |
| template<> | |
| Util::Array< float > | Get () const |
| template<> | |
| Util::Array< bool > | Get () const |
| template<> | |
| Util::Array< Math::vec2 > | Get () const |
| template<> | |
| Util::Array< Math::vec3 > | Get () const |
| template<> | |
| Util::Array< Math::vec4 > | Get () const |
| template<> | |
| Util::Array< Math::mat4 > | Get () const |
| template<> | |
| Util::Array< Util::String > | Get () const |
| template<> | |
| Util::Array< Util::Guid > | Get () const |
| template<> | |
| Util::Array< Util::Blob > | Get () const |
Static Public Member Functions | |
| static Variant | FromString (const Util::String &string) |
| create from string | |
| static Util::String | TypeToString (Type t) |
| convert type to string | |
| static Type | StringToType (const Util::String &str) |
| convert string to type | |
Private Member Functions | |
| void | Delete () |
| delete current content | |
| void | Copy (const Variant &rhs) |
| copy current content | |
Private Attributes | ||
| Type | type | |
| union { | ||
| byte i8 | ||
| short i16 | ||
| ushort ui16 | ||
| int i | ||
| uint u | ||
| int64_t i64 | ||
| uint64_t u64 | ||
| bool b | ||
| double d | ||
| float f [4] | ||
| Math::mat4 * m | ||
| Math::transform44 * t | ||
| Util::String * string | ||
| Util::Guid * guid | ||
| Util::Blob * blob | ||
| void * voidPtr | ||
| Core::RefCounted * object | ||
| Util::Array< int > * intArray | ||
| Util::Array< float > * floatArray | ||
| Util::Array< bool > * boolArray | ||
| Util::Array< Math::vec2 > * vec2Array | ||
| Util::Array< Math::vec3 > * float3Array | ||
| Util::Array< Math::vec4 > * vec4Array | ||
| Util::Array< Math::mat4 > * mat4Array | ||
| Util::Array< Util::String > * stringArray | ||
| Util::Array< Util::Guid > * guidArray | ||
| Util::Array< Util::Blob > * blobArray | ||
| }; | ||
| enum Util::Variant::Type |
|
inline |
default constructor
|
inline |
byte constructor
|
inline |
short constructor
|
inline |
ushort constructor
|
inline |
int constructor
|
inline |
uint constructor
|
inline |
int64 constructor
|
inline |
uint64_t constructor
|
inline |
float constructor
|
inline |
double constructor
|
inline |
bool constructor
|
inline |
vec2 constructor
|
inline |
vec4 constructor
|
inline |
vec4 constructor
|
inline |
quaternion constructor
|
inline |
mat4 constructor
|
inline |
transform44 constructor
|
inline |
string constructor
|
inline |
blob constructor
|
inline |
guid constructor
|
inline |
const char constructor
|
inline |
object constructor
|
inline |
void pointer constructor
|
inline |
null pointer construction
|
inline |
int array constructor
|
inline |
float array constructor
|
inline |
bool array constructor
|
inline |
vec2 array constructor
|
inline |
vec3 array constructor
|
inline |
vec4 array constructor
|
inline |
mat4 array constructor
|
inline |
string array constructor
|
inline |
blob array constructor
|
inline |
guid array constructor
|
inline |
copy constructor
|
inline |
destructor
|
inline |
get pointer to data
|
inline |
clear content, resets type to void
|
inlineprivate |
copy current content
|
inlineprivate |
delete current content
|
inlinestatic |
create from string
Only some types can be inferred from string, everything else will be treated as a raw string.
|
inline |
Templated get method.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
get blob
|
inline |
get blob array content
|
inline |
get bool content
|
inline |
get bool array content
|
inline |
get byte content
|
inline |
get double content
|
inline |
get float content
|
inline |
get float array content
|
inline |
get guid content
|
inline |
get guid array content
|
inline |
get integer content
|
inline |
get integer content
|
inline |
get int array content
|
inline |
get mat4 content
|
inline |
get mat4 array content
|
inline |
get object pointer
|
inline |
get quaternion content
|
inline |
get short content
|
inline |
get string content
|
inline |
get string array content
|
inline |
get transform44 content
|
inline |
get type
|
inline |
get unsigned integer content
|
inline |
get unsigned integer content
|
inline |
get short content
|
inline |
get vec2 content
|
inline |
get vec2 array content
|
inline |
get vec4 content
|
inline |
get vec4 array content
|
inline |
get vec4 content
|
inline |
get vec4 array content
|
inline |
get void pointer
|
inline |
bool inequality operator
|
inline |
byte inequality operator
|
inline |
char ptr inequality operator
|
inline |
quaternion inequality operator
|
inline |
vec2 inequality operator
|
inline |
vec4 inequality operator
|
inline |
guid inequality operator
|
inline |
string inequality operator
|
inline |
inequality operator
|
inline |
pointer equality operator
|
inline |
double inequality operator
|
inline |
float inequality operator
|
inline |
int inequality operator
|
inline |
int inequality operator
|
inline |
short inequality operator
|
inline |
uint inequality operator
|
inline |
uint inequality operator
|
inline |
ushort inequality operator
|
inline |
pointer equality operator
|
inline |
less operator
|
inline |
less equal operator
|
inline |
bool assigment operator
|
inline |
byte assignment operator
|
inline |
char pointer assignment
|
inline |
mat4 assignment operator
|
inline |
quat assignment operator
|
inline |
transform44 assignment operator
|
inline |
vec2 assignment operator
|
inline |
vec3 assignment operator
|
inline |
vec4 assignment operator
|
inline |
bool array assignment
|
inline |
float array assignment
|
inline |
int array assignment
|
inline |
mat4 array assignment
|
inline |
vec2 array assignment
|
inline |
vec3 array assignment
|
inline |
vec4 array assignment
|
inline |
blob array assignment
|
inline |
guid array assignment
|
inline |
string array assignment
|
inline |
blob assignment operator
|
inline |
guid assignment operator
|
inline |
string assignment operator
|
inline |
assignment operator
|
inline |
object assignment
|
inline |
double assignment operator
|
inline |
float assignment operator
|
inline |
int assignment operator
|
inline |
int assignment operator
|
inline |
short assignment operator
|
inline |
uint assignment operator
|
inline |
uint assignment operator
|
inline |
ushort assignment operator
|
inline |
object assignment
|
inline |
bool equality operator
|
inline |
byte equality operator
|
inline |
char ptr equality operator
|
inline |
vec4 equality operator
|
inline |
vec2 equality operator
|
inline |
vec4 equality operator
|
inline |
guid equality operator
|
inline |
string equality operator
|
inline |
equality operator
|
inline |
pointer equality operator
|
inline |
double equality operator
|
inline |
float equality operator
|
inline |
int equality operator
|
inline |
int equality operator
|
inline |
short equality operator
|
inline |
uint equality operator
|
inline |
uint equality operator
|
inline |
ushort equality operator
|
inline |
pointer equality operator
|
inline |
greater operator
|
inline |
greater equal operator
|
inline |
set blob
|
inline |
set blob array content
|
inline |
set bool content
|
inline |
set bool array content
|
inline |
set byte content
|
inline |
set double content
|
inline |
set float content
|
inline |
set float array content
|
inline |
set guid content
|
inline |
set guid array content
|
inline |
set integer content
|
inline |
set integer content
|
inline |
set int array content
|
inline |
set mat4 content
|
inline |
set mat4 array content
|
inline |
set object pointer
|
inline |
|
inline |
set quaternion content
|
inline |
set short content
|
inline |
set string content
|
inline |
set string array content
|
inline |
set transform44 content
|
inline |
set type of attribute
|
inline |
set unsigned integer content
|
inline |
set unsigned integer content
|
inline |
set ushort content
|
inline |
set vec2 content
|
inline |
set vec2 array content
|
inline |
set vec4 content
|
inline |
set vec4 array content
|
inline |
set vec4 content
|
inline |
set vec4 array content
|
inline |
set opaque void pointer
|
inline |
get size of data
|
inlinestatic |
convert string to type
|
inline |
convert value to string
|
inlinestatic |
convert type to string
| union { ... } Util::Variant |
| bool Util::Variant::b |
| Util::Blob* Util::Variant::blob |
| Util::Array<Util::Blob>* Util::Variant::blobArray |
| Util::Array<bool>* Util::Variant::boolArray |
| double Util::Variant::d |
| float Util::Variant::f[4] |
| Util::Array<Math::vec3>* Util::Variant::float3Array |
| Util::Array<float>* Util::Variant::floatArray |
| Util::Guid* Util::Variant::guid |
| Util::Array<Util::Guid>* Util::Variant::guidArray |
| int Util::Variant::i |
| short Util::Variant::i16 |
| int64_t Util::Variant::i64 |
| byte Util::Variant::i8 |
| Util::Array<int>* Util::Variant::intArray |
| Math::mat4* Util::Variant::m |
| Util::Array<Math::mat4>* Util::Variant::mat4Array |
| Core::RefCounted* Util::Variant::object |
| Util::String* Util::Variant::string |
| Util::Array<Util::String>* Util::Variant::stringArray |
| Math::transform44* Util::Variant::t |
|
private |
| uint Util::Variant::u |
| uint64_t Util::Variant::u64 |
| ushort Util::Variant::ui16 |
| Util::Array<Math::vec2>* Util::Variant::vec2Array |
| Util::Array<Math::vec4>* Util::Variant::vec4Array |
| void* Util::Variant::voidPtr |