#include <daeAtomicType.h>
The daeAtomicType
class implements a standard interface for data elements in the reflective object system.
daeAtomicType
provides a central virtual interface that can be used by the rest of the reflective object system.
The atomic type system if very useful for file IO and building automatic tools for data inspection and manipulation, such as hierarchy examiners and object editors.
Types provide the following symantic operations:
print()
memoryToString()
stringToMemory()
Types are also able to align data pointers appropriately.
Definition at line 48 of file daeAtomicType.h.
An enum for identifying the different atomic types
Definition at line 241 of file daeAtomicType.h.
virtual daeAtomicType::~daeAtomicType | ( | ) | [inline, virtual] |
destructor
Definition at line 54 of file daeAtomicType.h.
daeAtomicType::daeAtomicType | ( | DAE & | dae | ) |
constructor
Performs an alignment based on the alignment for this type.
ptr | Pointer to be aligned. |
(ptr+alignment-1)&(~(alignment-1).
Definition at line 206 of file daeAtomicType.h.
virtual void daeAtomicType::arrayToString | ( | daeArray & | array, | |
std::ostringstream & | buffer | |||
) | [virtual] |
Converts an array of atomic items into a whitespace separated string.
array | The array of data. | |
buffer | The buffer to write into. |
Performs a virtual comparison operation between two values of the same atomic type.
value1 | Memory location of the first value. | |
value2 | Memory location of the second value. |
Reimplemented in daeStringRefType, daeResolverType, and daeIDResolverType.
Array version of the compare function.
value1 | First array to compare. | |
value2 | Second array to compare. |
Performs a virtual copy operation.
src | Memory location of the value to copy from. | |
dst | Memory location of the value to copy to. |
Implemented in daeBoolType, daeIntType, daeLongType, daeUIntType, daeULongType, daeShortType, daeFloatType, daeDoubleType, daeStringRefType, daeTokenType, daeElementRefType, daeEnumType, daeRawRefType, daeResolverType, and daeIDResolverType.
Array version of the copy function.
src | Array to copy from. | |
dst | Array to copy to. |
virtual daeMemoryRef daeAtomicType::create | ( | ) | [pure virtual] |
Creates a new object of the appropriate type for this daeAtomicType and returns it as a pointer. The return value must be freed by calling destroy.
Implemented in daeBoolType, daeIntType, daeLongType, daeUIntType, daeULongType, daeShortType, daeFloatType, daeDoubleType, daeStringRefType, daeTokenType, daeElementRefType, daeEnumType, daeRawRefType, daeResolverType, and daeIDResolverType.
virtual daeArray* daeAtomicType::createArray | ( | ) | [pure virtual] |
Creates a daeTArray of the appropriate type (e.g. daeTArray<int>, daeTArray<daeIDRef>) and returns it as a daeArray*.
Implemented in daeBoolType, daeIntType, daeLongType, daeUIntType, daeULongType, daeShortType, daeFloatType, daeDoubleType, daeStringRefType, daeTokenType, daeElementRefType, daeEnumType, daeRawRefType, daeResolverType, and daeIDResolverType.
virtual void daeAtomicType::destroy | ( | daeMemoryRef | obj | ) | [pure virtual] |
Deletes an object previously allocated with create.
obj | The object previously allocated with create. |
Implemented in daeBoolType, daeIntType, daeLongType, daeUIntType, daeULongType, daeShortType, daeFloatType, daeDoubleType, daeStringRefType, daeTokenType, daeElementRefType, daeEnumType, daeRawRefType, daeResolverType, and daeIDResolverType.
daeInt daeAtomicType::getAlignment | ( | ) | [inline] |
Gets the alignment in bytes necessary for this type on this platform.
Definition at line 191 of file daeAtomicType.h.
daeStringRefArray& daeAtomicType::getNameBindings | ( | ) | [inline] |
Gets the array of strings as name bindings for this type.
Definition at line 151 of file daeAtomicType.h.
daeStringRef daeAtomicType::getPrintFormat | ( | ) | [inline] |
Gets the printf format used for this type.
Definition at line 184 of file daeAtomicType.h.
daeStringRef daeAtomicType::getScanFormat | ( | ) | [inline] |
Gets the scanf format used for this type.
Definition at line 174 of file daeAtomicType.h.
daeInt daeAtomicType::getSize | ( | ) | [inline] |
Gets the size in bytes for this atomic type.
Definition at line 164 of file daeAtomicType.h.
daeEnum daeAtomicType::getTypeEnum | ( | ) | [inline] |
Gets the enum associated with this atomic type. This is not scalable and only works for base types, otherwise 'extension' is used.
Definition at line 158 of file daeAtomicType.h.
daeStringRef daeAtomicType::getTypeString | ( | ) | [inline] |
Gets the string associated with this type.
Definition at line 197 of file daeAtomicType.h.
virtual daeBool daeAtomicType::memoryToString | ( | daeChar * | src, | |
std::ostringstream & | dst | |||
) | [pure virtual] |
Prints an atomic typed element into a destination string.
src | Source of the raw data from which to get the typed items. | |
dst | Destination to output the string version of the elements to. |
Implemented in daeBoolType, daeIntType, daeLongType, daeUIntType, daeULongType, daeShortType, daeFloatType, daeDoubleType, daeStringRefType, daeElementRefType, daeEnumType, daeRawRefType, daeResolverType, and daeIDResolverType.
virtual void daeAtomicType::setDocument | ( | daeArray & | array, | |
daeDocument * | doc | |||
) | [inline, virtual] |
Same as the previous method, but works on an array of objects.
values | Array of the atomic type values. | |
doc | The new document. |
Reimplemented in daeResolverType.
Definition at line 221 of file daeAtomicType.h.
virtual void daeAtomicType::setDocument | ( | daeChar * | value, | |
daeDocument * | doc | |||
) | [inline, virtual] |
Notifies an object when the containing document changes.
value | Memory location of the atomic type value. | |
doc | The new document. |
Reimplemented in daeResolverType.
Definition at line 214 of file daeAtomicType.h.
Reads a whitespace separated list of atomic items into an array. The array is cleared before writing into it.
src | Whitespace separated list of items. | |
array | The output array of data. |
Reads an atomic typed item into the destination runtime memory.
src | Source string. | |
dst | Raw binary location to store the resulting value. |
Reimplemented in daeBoolType, daeFloatType, daeDoubleType, daeStringRefType, daeTokenType, daeEnumType, daeResolverType, and daeIDResolverType.
daeInt daeAtomicType::_alignment [protected] |
Definition at line 226 of file daeAtomicType.h.
DAE* daeAtomicType::_dae [protected] |
Definition at line 224 of file daeAtomicType.h.
daeInt daeAtomicType::_maxStringLength [protected] |
Definition at line 231 of file daeAtomicType.h.
An array of strings as name bindings for this type.
Definition at line 237 of file daeAtomicType.h.
daeStringRef daeAtomicType::_printFormat [protected] |
Definition at line 229 of file daeAtomicType.h.
daeStringRef daeAtomicType::_scanFormat [protected] |
Definition at line 230 of file daeAtomicType.h.
daeInt daeAtomicType::_size [protected] |
Definition at line 225 of file daeAtomicType.h.
daeEnum daeAtomicType::_typeEnum [protected] |
Definition at line 227 of file daeAtomicType.h.
daeStringRef daeAtomicType::_typeString [protected] |
Definition at line 228 of file daeAtomicType.h.