VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtAttributeData Class Referenceabstract

Detailed Description

This abstract class provides the interface for type-independent attribute data storage. It allows type-safe access to attribute values through dynamic casting and defines operations common to all attribute types.

#include <attribute_data.h>

Inheritance diagram for makVre::DtAttributeData:
[legend]

Public Member Functions

 DtAttributeData ()
 
virtual ~DtAttributeData ()
 
virtual const std::string & type () const =0
 
virtual std::size_t typeHash () const =0
 
template<typename T>
DtAttributeDataType< T > & as ()
 
template<typename T>
const DtAttributeDataType< T > & as () const
 
virtual std::string getAsString () const =0
 
virtual bool setFromString (const std::string &newValue)=0
 
virtual const void * raw () const =0
 

Constructor & Destructor Documentation

◆ DtAttributeData()

makVre::DtAttributeData::DtAttributeData ( )
inline

Default constructor.

◆ ~DtAttributeData()

virtual makVre::DtAttributeData::~DtAttributeData ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ type()

virtual const std::string & makVre::DtAttributeData::type ( ) const
pure virtual

Gets the type name of this attribute data.

Returns
String representation of the data type

Implemented in makVre::DtAttributeDataType< T >.

◆ typeHash()

virtual std::size_t makVre::DtAttributeData::typeHash ( ) const
pure virtual

Gets a hash of the type for faster comparisons.

Returns
Hash code for the data type

Implemented in makVre::DtAttributeDataType< T >.

◆ as() [1/2]

template<typename T>
DtAttributeDataType< T > & makVre::DtAttributeData::as ( )
inline

Casts this attribute data to a specific type.

Template Parameters
TThe type to cast to
Returns
Reference to this object as the requested type
Note
No type checking is performed; use verifyType() first to ensure safety

◆ as() [2/2]

template<typename T>
const DtAttributeDataType< T > & makVre::DtAttributeData::as ( ) const
inline

Casts this attribute data to a specific type (const version)

Template Parameters
TThe type to cast to
Returns
Const reference to this object as the requested type
Note
No type checking is performed; use verifyType() first to ensure safety

◆ getAsString()

virtual std::string makVre::DtAttributeData::getAsString ( ) const
pure virtual

Gets the attribute value as a string.

Returns
String representation of the current value

Implemented in makVre::DtAttributeDataType< T >.

◆ setFromString()

virtual bool makVre::DtAttributeData::setFromString ( const std::string & newValue)
pure virtual

Sets the attribute value from a string.

Parameters
newValueString representation of the value to set
Returns
True if conversion and setting succeeded, false otherwise

Implemented in makVre::DtAttributeDataType< T >.

◆ raw()

virtual const void * makVre::DtAttributeData::raw ( ) const
pure virtual

Gets a raw pointer to the attribute data.

Returns
Void pointer to the raw data

Implemented in makVre::DtAttributeDataType< T >.


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