|
libRocket
|
#include <Variant.h>
Public Types | |
| enum | Type { NONE = '-', BYTE = 'b', CHAR = 'c', FLOAT = 'f', INT = 'i', STRING = 's', WORD = 'w', VECTOR2 = '2', COLOURF = 'g', COLOURB = 'h', SCRIPTINTERFACE = 'p', VOIDPTR = '*' } |
| Type of data stored in the variant. More... | |
Public Member Functions | |
| Variant () | |
| Variant (const Variant &) | |
| template<typename T > | |
| Variant (const T &t) | |
| ~Variant () | |
| void | Clear () |
| Clears the data structure stored by the variant. More... | |
| Type | GetType () const |
| void | Set (const Variant ©) |
| void | Set (const byte value) |
| void | Set (const char value) |
| void | Set (const float value) |
| void | Set (const int value) |
| void | Set (const word value) |
| void | Set (const char *value) |
| void | Set (void *value) |
| void | Set (const String &value) |
| void | Set (const Vector2f &value) |
| void | Set (const Colourf &value) |
| void | Set (const Colourb &value) |
| void | Set (ScriptInterface *value) |
| template<typename T > | |
| T | Get () const |
| template<typename T > | |
| bool | GetInto (T &value) const |
| Variant & | operator= (const Variant ©) |
Variant is a container that can store a selection of basic types. The variant will store the value in the native form corresponding to the version of Set that was called.
Get is templated to convert from the stored form to the requested form by using a TypeConverter.
| Rocket::Core::Variant::Variant | ( | ) |
| Rocket::Core::Variant::Variant | ( | const Variant & | ) |
Templatised constructors don't work for the copy constructor, so we have to define it explicitly.
| Rocket::Core::Variant::Variant | ( | const T & | t | ) |
Constructs a variant with internal data.
| [in] | t | Data of a supported type to set on the variant. |
| Rocket::Core::Variant::~Variant | ( | ) |
| void Rocket::Core::Variant::Clear | ( | ) |
Clears the data structure stored by the variant.
| T Rocket::Core::Variant::Get | ( | ) | const |
Templatised data accessor. TypeConverters will be used to attempt to convert from the internal representation to the requested representation.
| bool Rocket::Core::Variant::GetInto | ( | T & | value | ) | const |
Templatised data accessor. TypeConverters will be used to attempt to convert from the internal representation to the requested representation.
| [out] | value | Data in the requested type. |
| Type Rocket::Core::Variant::GetType | ( | ) | const |
Gets the current internal representation type.
Assigns another variant's internal data to this variant.
| [in] | copy | Variant to share data. |
| void Rocket::Core::Variant::Set | ( | const Variant & | copy | ) |
Shares another variant's data with this variant.
| [in] | copy | Variant to share data. |
| void Rocket::Core::Variant::Set | ( | const byte | value | ) |
Sets a byte value on this variant.
| [in] | value | New value to set. |
| void Rocket::Core::Variant::Set | ( | const char | value | ) |
Sets a signed char value on this variant.
| [in] | value | New value to set. |
| void Rocket::Core::Variant::Set | ( | const float | value | ) |
Sets a float value on this variant.
| [in] | value | New value to set. |
| void Rocket::Core::Variant::Set | ( | const int | value | ) |
Sets a signed int value on this variant.
| [in] | value | New value to set. |
| void Rocket::Core::Variant::Set | ( | const word | value | ) |
Sets a word value on this variant.
| [in] | value | New value to set. |
| void Rocket::Core::Variant::Set | ( | const char * | value | ) |
Sets a constant C string value on this variant.
| [in] | value | New value to set. |
| void Rocket::Core::Variant::Set | ( | void * | value | ) |
Sets a generic void* value on this variant.
| [in] | value | New value to set. |
| void Rocket::Core::Variant::Set | ( | const String & | value | ) |
Sets an EMP string value on this variant.
| [in] | value | New value to set. |
| void Rocket::Core::Variant::Set | ( | const Vector2f & | value | ) |
Sets a Vector2f value on this variant.
| [in] | value | New value to set. |
| void Rocket::Core::Variant::Set | ( | const Colourf & | value | ) |
Sets a Colourf value on this variant.
| [in] | value | New value to set. |
| void Rocket::Core::Variant::Set | ( | const Colourb & | value | ) |
Sets a Colourb value on this variant.
| [in] | value | New value to set. |
| void Rocket::Core::Variant::Set | ( | ScriptInterface * | value | ) |
Sets a script object value on this variant.
| [in] | value | New value to set. |
1.8.8