daeAtomicType Class Reference

#include <daeAtomicType.h>

Inheritance diagram for daeAtomicType:
Inheritance graph
[legend]

List of all members.

Public Types

enum  daeAtomicTypes {
  BoolType, EnumType, CharType, ShortType,
  IntType, UIntType, LongType, ULongType,
  FloatType, DoubleType, StringRefType, ElementRefType,
  MemoryRefType, RawRefType, ResolverType, IDResolverType,
  TokenType, ExtensionType
}

Public Member Functions

daeCharalign (daeChar *ptr)
virtual void arrayToString (daeArray &array, std::ostringstream &buffer)
virtual daeInt compare (daeChar *value1, daeChar *value2)
virtual daeInt compareArray (daeArray &value1, daeArray &value2)
virtual void copy (daeChar *src, daeChar *dst)=0
virtual void copyArray (daeArray &src, daeArray &dst)
virtual daeMemoryRef create ()=0
virtual daeArraycreateArray ()=0
 daeAtomicType (DAE &dae)
virtual void destroy (daeMemoryRef obj)=0
daeInt getAlignment ()
daeStringRefArraygetNameBindings ()
daeStringRef getPrintFormat ()
daeStringRef getScanFormat ()
daeInt getSize ()
daeEnum getTypeEnum ()
daeStringRef getTypeString ()
virtual daeBool memoryToString (daeChar *src, std::ostringstream &dst)=0
virtual void setDocument (daeArray &array, daeDocument *doc)
virtual void setDocument (daeChar *value, daeDocument *doc)
virtual daeBool stringToArray (daeChar *src, daeArray &array)
virtual daeBool stringToMemory (daeChar *src, daeChar *dst)
virtual ~daeAtomicType ()

Public Attributes

daeStringRefArray _nameBindings

Protected Attributes

daeInt _alignment
DAE_dae
daeInt _maxStringLength
daeStringRef _printFormat
daeStringRef _scanFormat
daeInt _size
daeEnum _typeEnum
daeStringRef _typeString

Detailed Description

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:

Types are also able to align data pointers appropriately.

Definition at line 48 of file daeAtomicType.h.


Member Enumeration Documentation

An enum for identifying the different atomic types

Enumerator:
BoolType 

bool atomic type

EnumType 

enum atomic type

CharType 

character atomic type

ShortType 

short integer atomic type

IntType 

integer atomic type

UIntType 

unsigned integer atomic type

LongType 

long integer atomic type

ULongType 

unsigned long integer atomic type

FloatType 

floating point atomic type

DoubleType 

double precision floating point atomic type

StringRefType 

string reference atomic type

ElementRefType 

element reference atomic type

MemoryRefType 

memory reference atomic type

RawRefType 

void reference atomic type

ResolverType 

resolver atomic type

IDResolverType 

ID resolver atomic type

TokenType 

string token atomic type

ExtensionType 

extension atomic type

Definition at line 241 of file daeAtomicType.h.


Constructor & Destructor Documentation

virtual daeAtomicType::~daeAtomicType (  )  [inline, virtual]

destructor

Definition at line 54 of file daeAtomicType.h.

daeAtomicType::daeAtomicType ( DAE dae  ) 

constructor


Member Function Documentation

daeChar* daeAtomicType::align ( daeChar ptr  )  [inline]

Performs an alignment based on the alignment for this type.

Parameters:
ptr Pointer to be aligned.
Returns:
Returns the aligned pointer computed via (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.

Parameters:
array The array of data.
buffer The buffer to write into.
virtual daeInt daeAtomicType::compare ( daeChar value1,
daeChar value2 
) [virtual]

Performs a virtual comparison operation between two values of the same atomic type.

Parameters:
value1 Memory location of the first value.
value2 Memory location of the second value.
Returns:
Returns a positive integer if value1 > value2, a negative integer if value1 < value2, and 0 if value1 == value2.

Reimplemented in daeStringRefType, daeResolverType, and daeIDResolverType.

virtual daeInt daeAtomicType::compareArray ( daeArray value1,
daeArray value2 
) [virtual]

Array version of the compare function.

Parameters:
value1 First array to compare.
value2 Second array to compare.
Returns:
Returns a positive integer if value1 > value2, a negative integer if value1 < value2, and 0 if value1 == value2.
virtual void daeAtomicType::copy ( daeChar src,
daeChar dst 
) [pure virtual]

Performs a virtual copy operation.

Parameters:
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.

virtual void daeAtomicType::copyArray ( daeArray src,
daeArray dst 
) [virtual]

Array version of the copy function.

Parameters:
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.

Returns:
Returns a pointer to a new value. The memory 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*.

Returns:
Returns a daeArray*. This array should be freed by the caller with operator delete.

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.

Parameters:
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.

Returns:
Returns the alignment in bytes.

Definition at line 191 of file daeAtomicType.h.

daeStringRefArray& daeAtomicType::getNameBindings (  )  [inline]

Gets the array of strings as name bindings for this type.

Returns:
Returns the array of strings.

Definition at line 151 of file daeAtomicType.h.

daeStringRef daeAtomicType::getPrintFormat (  )  [inline]

Gets the printf format used for this type.

Returns:
Returns the printf format.
Note:
Warning - this field is only for convenience and may not always work. It is used only when the print functions are left to the base implementation.

Definition at line 184 of file daeAtomicType.h.

daeStringRef daeAtomicType::getScanFormat (  )  [inline]

Gets the scanf format used for this type.

Returns:
Returns the scanf format.
Note:
Warning - this field is only for convenience and may not always work. It is used only when the read functions are left to the base implementation.

Definition at line 174 of file daeAtomicType.h.

daeInt daeAtomicType::getSize (  )  [inline]

Gets the size in bytes for this atomic type.

Returns:
Returns the size of the atomic type in bytes.

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.

Returns:
Returns the enum associated with this atomic type.

Definition at line 158 of file daeAtomicType.h.

daeStringRef daeAtomicType::getTypeString (  )  [inline]

Gets the string associated with this type.

Returns:
Returns 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.

Parameters:
src Source of the raw data from which to get the typed items.
dst Destination to output the string version of the elements to.
Returns:
Returns true if the operation was successful, false if not successful.

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.

Parameters:
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.

Parameters:
value Memory location of the atomic type value.
doc The new document.

Reimplemented in daeResolverType.

Definition at line 214 of file daeAtomicType.h.

virtual daeBool daeAtomicType::stringToArray ( daeChar src,
daeArray array 
) [virtual]

Reads a whitespace separated list of atomic items into an array. The array is cleared before writing into it.

Parameters:
src Whitespace separated list of items.
array The output array of data.
Returns:
Returns true if the operation was successful, false otherwise.
virtual daeBool daeAtomicType::stringToMemory ( daeChar src,
daeChar dst 
) [virtual]

Reads an atomic typed item into the destination runtime memory.

Parameters:
src Source string.
dst Raw binary location to store the resulting value.
Returns:
Returns true if the operation was successful, false if not successful.

Reimplemented in daeBoolType, daeFloatType, daeDoubleType, daeStringRefType, daeTokenType, daeEnumType, daeResolverType, and daeIDResolverType.


Member Data Documentation

Definition at line 226 of file daeAtomicType.h.

DAE* daeAtomicType::_dae [protected]

Definition at line 224 of file daeAtomicType.h.

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.

Definition at line 229 of file daeAtomicType.h.

Definition at line 230 of file daeAtomicType.h.

Definition at line 225 of file daeAtomicType.h.

Definition at line 227 of file daeAtomicType.h.

Definition at line 228 of file daeAtomicType.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


colladadom
Author(s): Du Hung Hou, Khronos.org, Marcus Barnes, Greg Corson, Herbert Law, Sebastian Schwarz, Steven Thomas, John Hsu (ros package), Tim Field (ros package)
autogenerated on Fri Jan 11 09:29:11 2013