The Nebula Device 3: Util::Variant Class Reference

The Nebula Device 3

Util::Variant Class Reference

#include <variant.h>


Detailed Description

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.

(C) 2006 RadonLabs GmbH.

Public Types

enum  Type
 variant types

Public Member Functions

 Variant ()
 default constructor
 Variant (const Variant &rhs)
 copy constructor
 Variant (int rhs)
 int constructor
 Variant (float rhs)
 float constructor
 Variant (bool rhs)
 bool constructor
 Variant (const Math::float4 &v)
 float4 constructor
 Variant (const Math::matrix44 &m)
 matrix44 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 (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::float4 > &rhs)
 float4 array constructor
 Variant (const Util::Array< Math::matrix44 > &rhs)
 matrix44 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 ()
 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= (int val)
 int assignment operator
void operator= (float val)
 float assignment operator
void operator= (bool val)
 bool assigment operator
void operator= (const Math::float4 &val)
 float4 assignment operator
void operator= (const Math::matrix44 &val)
 matrix44 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= (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::float4 > &rhs)
 float4 array assignment
void operator= (const Util::Array< Math::matrix44 > &rhs)
 matrix44 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== (int rhs) const
 int equality operator
bool operator== (float rhs) const
 float equality operator
bool operator== (bool rhs) const
 bool equality operator
bool operator== (const Math::float4 &rhs) const
 float4 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!= (const Variant &rhs) const
 inequality operator
bool operator!= (int rhs) const
 int inequality operator
bool operator!= (float rhs) const
 float inequality operator
bool operator!= (bool rhs) const
 bool inequality operator
bool operator!= (const Math::float4 &rhs) const
 float4 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
void SetInt (int val)
 set integer content
int GetInt () const
 get integer content
void SetFloat (float val)
 set float content
float GetFloat () const
 get float 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::StringGetString () const
 get string content
void SetFloat4 (const Math::float4 &val)
 set float4 content
Math::float4 GetFloat4 () const
 get float4 content
void SetMatrix44 (const Math::matrix44 &val)
 set matrix44 content
const Math::matrix44GetMatrix44 () const
 get matrix44 content
void SetBlob (const Util::Blob &val)
 set blob
const Util::BlobGetBlob () const
 get blob
void SetGuid (const Util::Guid &val)
 set guid content
const Util::GuidGetGuid () const
 get guid content
void SetObject (Core::RefCounted *ptr)
 set object pointer
Core::RefCountedGetObject () const
 get object 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 SetFloat4Array (const Util::Array< Math::float4 > &val)
 set float4 array content
const Util::Array
< Math::float4 > & 
GetFloat4Array () const
 get float4 array content
void SetMatrix44Array (const Util::Array< Math::matrix44 > &val)
 set matrix44 array content
const Util::Array
< Math::matrix44 > & 
GetMatrix44Array () const
 get matrix44 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

Static Public Member Functions

static Util::String TypeToString (Type t)
 convert type to string
static Type StringToType (const Util::String &str)
 convert string to type