COLLADA 1.4 DOM: daeAtomicType Class Reference

COLLADA

daeAtomicType Class Reference

#include <daeAtomicType.h>

Inheritance diagram for daeAtomicType:

Inheritance graph
[legend]
Collaboration diagram for daeAtomicType:

Collaboration graph
[legend]
List of all members.

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.

Public Types

enum  daeAtomicTypes {
  BoolType, EnumType, CharType, ShortType,
  IntType, UIntType, LongType, ULongType,
  FloatType, DoubleType, StringRefType, ElementRefType,
  MemoryRefType, RawRefType, ResolverType, IDResolverType,
  TokenType, ExtensionType
}
 An enum for identifying the different atomic types. More...

Public Member Functions

virtual ~daeAtomicType ()
 destructor
 daeAtomicType ()
 constructor
virtual daeBool memoryToString (daeChar *src, daeChar *dst, daeInt dstSize)
 Prints an atomic typed element into a destination string.
virtual daeBool stringToMemory (daeChar *src, daeChar *dst)
 Reads an atomic typed item into the destination runtime memory.
virtual void resolve (daeElementRef element, daeMetaAttributeRef ma)
 Resolves a reference, if indeed this type is a reference type.
virtual daeBool getUsesStrings ()
 Determines if this atomic type requires a special string-based parse state.
daeStringRefArraygetNameBindings ()
 Gets the array of strings as name bindings for this type.
daeEnum getTypeEnum ()
 Gets the enum associated with this atomic type.
daeInt getSize ()
 Gets the size in bytes for this atomic type.
daeStringRef getScanFormat ()
 Gets the scanf format used for this type.
daeStringRef getPrintFormat ()
 Gets the printf format used for this type.
daeInt getAlignment ()
 Gets the alignment in bytes necessary for this type on this platform.
daeStringRef getTypeString ()
 Gets the string associated with this type.
daeChar * align (daeChar *ptr)
 Performs an alignment based on the alignment for this type.

Static Public Member Functions

static daeInt append (daeAtomicType *t)
 Appends a new type to the global list of types.
static void initializeKnownTypes ()
 Performs a static initialization of all known atomic types.
static void uninitializeKnownTypes ()
 Performs an uninitialization for all known types, freeing associated memory.
static void initializeKnownBaseTypes ()
 Performs a static initialization of all known base atomic types.
static const daeAtomicTypegetByIndex (daeInt index)
 Gets a type from the list of types, based on its index.
static daeInt getCount ()
 Gets the number of known atomic types.
static daeAtomicTypeget (daeStringRef type)
 Finds a type by its string name.
static daeAtomicTypeget (daeEnum type)
 Finds a type by its enum.

Public Attributes

daeStringRefArray _nameBindings
 An array of strings as name bindings for this type.

Protected Attributes

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

Member Enumeration Documentation

enum daeAtomicType::daeAtomicTypes
 

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


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).

daeInt daeAtomicType::append daeAtomicType t  )  [static]
 

Appends a new type to the global list of types.

Parameters:
t Type to append.
Returns:
Returns the index of the type in the list of types.

daeAtomicType * daeAtomicType::get daeEnum  type  )  [static]
 

Finds a type by its enum.

Parameters:
type Enum representing the desired type.
Returns:
Returns the type with the corresponding enum.

daeAtomicType * daeAtomicType::get daeStringRef  type  )  [static]
 

Finds a type by its string name.

Parameters:
type String name of the type.
Returns:
Returns the type with the corresponding name.

daeInt daeAtomicType::getAlignment  )  [inline]
 

Gets the alignment in bytes necessary for this type on this platform.

Returns:
Returns the alignment in bytes.

const daeAtomicType * daeAtomicType::getByIndex daeInt  index  )  [static]
 

Gets a type from the list of types, based on its index.

Parameters:
index Index of the type to retrieve.
Returns:
Returns the daeAtomicType indicated by index.

daeInt daeAtomicType::getCount  )  [static]
 

Gets the number of known atomic types.

Returns:
Returns the number of known atomic types.

daeStringRefArray& daeAtomicType::getNameBindings  )  [inline]
 

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

Returns:
Returns the array of strings.

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.

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.

daeInt daeAtomicType::getSize  )  [inline]
 

Gets the size in bytes for this atomic type.

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

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.

daeStringRef daeAtomicType::getTypeString  )  [inline]
 

Gets the string associated with this type.

Returns:
Returns the string associated with this type.

virtual daeBool daeAtomicType::getUsesStrings  )  [inline, virtual]
 

Determines if this atomic type requires a special string-based parse state.

Returns:
Returns true if this type requires string contents parsing, false if not.

Reimplemented in daeStringRefType, daeTokenType, and daeResolverType.

daeBool daeAtomicType::memoryToString daeChar *  src,
daeChar *  dst,
daeInt  dstSize
[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.
dstSize Number of bytes available in the destination memory.
Returns:
Returns true if the operation was successful, false if not successful.

Reimplemented in daeBoolType, daeIntType, daeLongType, daeUIntType, daeULongType, daeShortType, daeFloatType, daeDoubleType, daeStringRefType, daeElementRefType, daeEnumType, daeRawRefType, daeResolverType, and daeIDResolverType.

void daeAtomicType::resolve daeElementRef  element,
daeMetaAttributeRef  ma
[virtual]
 

Resolves a reference, if indeed this type is a reference type.

Parameters:
element The containing element.
ma The deaMetaAttribute where the resolved reference should be placed.

Reimplemented in daeResolverType, and daeIDResolverType.

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, daeStringRefType, daeEnumType, daeResolverType, and daeIDResolverType.


The documentation for this class was generated from the following files:
  • C:/SVN_wf/COLLADA_DOM/include/dae/daeAtomicType.h
  • C:/SVN_wf/COLLADA_DOM/src/dae/daeAtomicType.cpp

©2005 Sony Computer Entertainment Inc.. All Rights Reserved.
Generated on Fri Feb 10 16:46:45 2006 for COLLADA 1.4 DOM by doxygen 1.4.3