DigitalSpaces::DIVariant Struct Reference
[Containers]

#include <ContainerInterfaces.h>

Inherits DigitalSpaces::DIObjectBase.

Inherited by DigitalSpaces::Variant.


Detailed Description

An interface used to pass around data of indertimate type.

Designed for use with DISettingMap, but may be used elsewhere. The reference implementation is available as DigitalSpaces::Variant, in ContainerImplementations.h


Public Member Functions

Inspection functions
Each of these functions checks if the stored data is of the specified type.

It does not check if the data can be converted to the type.

bool isEmpty ()
 Checks if the container never been assigned a value.
bool isDIPtr ()
bool isBool ()
bool isInt ()
bool isUInt ()
bool isDouble ()
bool isString ()
bool isVector ()
bool isQuaternion ()
bool isColour ()
bool isSettingMap ()
Extraction functions
Each of these functions attempts to extract the data as the specified type.

Note that if the data is not of the type specified, the implementation may try to convert it. How sucessful this will be depends on the implementation.

DIObjectBasegetDIPtr ()
 Returns an object interface, or NULL if not a DIPtr.
bool getBool ()
 Returns the boolean value, or false if not a boolean.
signed int getInt ()
 Returns the integer value, or 0 if not an integer.
unsigned int getUInt ()
 Returns the unsigned integer value, or 0 if not an unsigned integer.
double getDouble ()
 Returns the double precision floating point value, or 0.0 if not a double precision floating point value.
const char * getString ()
 Returns the value of the string, or attempts a conversion from the object type to a string, and returns a pointer to the resulting string.
void getVector (out_Vector3f *value)
 Returns the vector value, or 0,0,0 if not a vector.
void getQuaternion (out_Quaternionf *)
 Returns the quaternion value, or 1,0,0,0 (IDENTITY) if not a quaternion.
void getColour (out_Vector4f *)
 Returns the colour value, or 0,0,0,0 if not a vector.
DISettingMapgetSettingMap ()
 Returns an interface to the contained SettingMap, or NULL if not a SettingMap.
Assignment functions
void setDIPtr (DIObjectBase *value)
 Assign an object interface to the object.
void setBool (bool value)
 Assign a boolean value to the object.
void setInt (signed int value)
 Assign an integer value to the object.
void setUInt (unsigned int value)
 Assign an unsigned integer value to the object.
void setDouble (double value)
 Assign a double precision floating point value to the object.
void setString (const char *value)
 Assign a string to the object.
void setVector (in_Vector3f *value)
 Assign a vector value to the object.
void setQuaternion (in_Quaternionf *value)
 Assign a quaternion value to the object.
void setColour (in_Vector4f *value)
 Assign a colour value to the object.
void setSettingMap (DISettingMap *value)
 Assign a SettingMap to the object.

Member Function Documentation

bool DigitalSpaces::DIVariant::isEmpty (  ) 

Checks if the container never been assigned a value.

The only way for this to return true is for none of the Assignment functions to have ever been called.

Reimplemented in DigitalSpaces::Variant.

bool DigitalSpaces::DIVariant::isDIPtr (  ) 

Reimplemented in DigitalSpaces::Variant.

bool DigitalSpaces::DIVariant::isBool (  ) 

Reimplemented in DigitalSpaces::Variant.

bool DigitalSpaces::DIVariant::isInt (  ) 

Reimplemented in DigitalSpaces::Variant.

bool DigitalSpaces::DIVariant::isUInt (  ) 

Reimplemented in DigitalSpaces::Variant.

bool DigitalSpaces::DIVariant::isDouble (  ) 

Reimplemented in DigitalSpaces::Variant.

bool DigitalSpaces::DIVariant::isString (  ) 

Reimplemented in DigitalSpaces::Variant.

bool DigitalSpaces::DIVariant::isVector (  ) 

Reimplemented in DigitalSpaces::Variant.

bool DigitalSpaces::DIVariant::isQuaternion (  ) 

Reimplemented in DigitalSpaces::Variant.

bool DigitalSpaces::DIVariant::isColour (  ) 

Reimplemented in DigitalSpaces::Variant.

bool DigitalSpaces::DIVariant::isSettingMap (  ) 

Reimplemented in DigitalSpaces::Variant.

DIObjectBase* DigitalSpaces::DIVariant::getDIPtr (  ) 

Returns an object interface, or NULL if not a DIPtr.

Reimplemented in DigitalSpaces::Variant.

bool DigitalSpaces::DIVariant::getBool (  ) 

Returns the boolean value, or false if not a boolean.

Note that the "error" return is also a legitimate return value.

Reimplemented in DigitalSpaces::Variant.

signed int DigitalSpaces::DIVariant::getInt (  ) 

Returns the integer value, or 0 if not an integer.

Note that the "error" return is also a legitimate return value.

Reimplemented in DigitalSpaces::Variant.

unsigned int DigitalSpaces::DIVariant::getUInt (  ) 

Returns the unsigned integer value, or 0 if not an unsigned integer.

Note that the "error" return is also a legitimate return value.

Reimplemented in DigitalSpaces::Variant.

double DigitalSpaces::DIVariant::getDouble (  ) 

Returns the double precision floating point value, or 0.0 if not a double precision floating point value.

Note that the "error" return is also a legitimate return value.

Reimplemented in DigitalSpaces::Variant.

const char* DigitalSpaces::DIVariant::getString (  ) 

Returns the value of the string, or attempts a conversion from the object type to a string, and returns a pointer to the resulting string.

Note that the conversion result is stored in a temporary variable, and will not remain valid after another call to this function.

Reimplemented in DigitalSpaces::Variant.

void DigitalSpaces::DIVariant::getVector ( out_Vector3f value  ) 

Returns the vector value, or 0,0,0 if not a vector.

Note that the "error" return is also a legitimate return value.

Parameters:
value Adress of a out_Vector3f structure to be filled in with the contained value.

Reimplemented in DigitalSpaces::Variant.

void DigitalSpaces::DIVariant::getQuaternion ( out_Quaternionf  ) 

Returns the quaternion value, or 1,0,0,0 (IDENTITY) if not a quaternion.

Note that the "error" return is also a legitimate return value.

Parameters:
value Adress of a out_Quaternionf structure to be filled in with the contained value.

Reimplemented in DigitalSpaces::Variant.

void DigitalSpaces::DIVariant::getColour ( out_Vector4f  ) 

Returns the colour value, or 0,0,0,0 if not a vector.

Note that the "error" return is also a legitimate return value.

Parameters:
value Adress of a out_Vector4f structure to be filled in with the contained value.

Reimplemented in DigitalSpaces::Variant.

DISettingMap* DigitalSpaces::DIVariant::getSettingMap (  ) 

Returns an interface to the contained SettingMap, or NULL if not a SettingMap.

Note that this is an interface to the stored SettingMap, and altering it will alter the stored value.

Reimplemented in DigitalSpaces::Variant.

void DigitalSpaces::DIVariant::setDIPtr ( DIObjectBase value  ) 

Assign an object interface to the object.

Reimplemented in DigitalSpaces::Variant.

void DigitalSpaces::DIVariant::setBool ( bool  value  ) 

Assign a boolean value to the object.

Reimplemented in DigitalSpaces::Variant.

void DigitalSpaces::DIVariant::setInt ( signed int  value  ) 

Assign an integer value to the object.

Reimplemented in DigitalSpaces::Variant.

void DigitalSpaces::DIVariant::setUInt ( unsigned int  value  ) 

Assign an unsigned integer value to the object.

Reimplemented in DigitalSpaces::Variant.

void DigitalSpaces::DIVariant::setDouble ( double  value  ) 

Assign a double precision floating point value to the object.

Reimplemented in DigitalSpaces::Variant.

void DigitalSpaces::DIVariant::setString ( const char *  value  ) 

Assign a string to the object.

Note that the string is copied for storage, and altering the original string will not affect this object.

Reimplemented in DigitalSpaces::Variant.

void DigitalSpaces::DIVariant::setVector ( in_Vector3f value  ) 

Assign a vector value to the object.

Note that the vector is copied for storage, and altering the original vector will not affect this object.

Reimplemented in DigitalSpaces::Variant.

void DigitalSpaces::DIVariant::setQuaternion ( in_Quaternionf value  ) 

Assign a quaternion value to the object.

Note that the quaternion is copied for storage, and altering the original quaternion will not affect this object.

Reimplemented in DigitalSpaces::Variant.

void DigitalSpaces::DIVariant::setColour ( in_Vector4f value  ) 

Assign a colour value to the object.

Note that the colour is copied for storage, and altering the original colour will not affect this object.

Reimplemented in DigitalSpaces::Variant.

void DigitalSpaces::DIVariant::setSettingMap ( DISettingMap value  ) 

Assign a SettingMap to the object.

Note that the object makes a duplicate of the SettingMap specified by value, and altering the origin SettingMap will not affect the SettingMap stored here.

Reimplemented in DigitalSpaces::Variant.


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

Generated on Sun Aug 31 17:46:28 2008 for Digital Spaces by  doxygen 1.5.6