dtUtil::KeyFrameDecoder< RecordableT, FrameDataT > Class Template Reference

A class that fills key frame data with DOM parsing. More...

#include <keyframedecoder.h>

List of all members.

Public Types

typedef RecordableT RecordableType
typedef FrameDataT FrameDataType
 The type of object of interest. RecordableTypes know how to create, serialize, and deserialize FrameDataTypes.
typedef std::vector
< dtCore::RefPtr
< FrameDataType > > 
FrameDataPtrContainer
 The data to be saved from the object of interest.
typedef std::pair< double,
FrameDataPtrContainer
KeyFrame
 A container to hold each source's frame data.
typedef std::vector< KeyFrameKeyFrameContainer
 The time stamp applied to the entire container of frame data.
typedef std::vector
< dtCore::RefPtr
< RecordableType > > 
RecordablePtrContainer
 The container of KeyFrame data.

Public Member Functions

 KeyFrameDecoder (const RecordablePtrContainer &sources, KeyFrameContainer &kfc)
 The container of sources of frame data.
 ~KeyFrameDecoder ()
void Walk (XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc)

Protected Member Functions

void DecodeFrameStamp (XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *fs, FrameDataPtrContainer &fdc)
 Walks the frame stamp tag to find each source's data and asks the source to deserialize the XML tag into a data package.
FrameDataTypeDecodeSourceData (XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *e, unsigned int index)


Detailed Description

template<typename RecordableT, typename FrameDataT>
class dtUtil::KeyFrameDecoder< RecordableT, FrameDataT >

A class that fills key frame data with DOM parsing.

Developed for the dtCore::Recorder class, it assumes a DOM tree's structure, and uses existing recordable instances to "decode", or deserialize, the XML hierarchy into a data package, known here as a FrameDataType.

Requires the following layout in XML: Top FrameStamp, Attr="Time" Source

"Time" is required to an attribute name, and its value is assumed to be a double precision floating point number. A 'Source' tag is given to a RecordableType instance and deserialized into usable data.


Member Typedef Documentation

template<typename RecordableT, typename FrameDataT>
typedef RecordableT dtUtil::KeyFrameDecoder< RecordableT, FrameDataT >::RecordableType

template<typename RecordableT, typename FrameDataT>
typedef FrameDataT dtUtil::KeyFrameDecoder< RecordableT, FrameDataT >::FrameDataType

The type of object of interest. RecordableTypes know how to create, serialize, and deserialize FrameDataTypes.

template<typename RecordableT, typename FrameDataT>
typedef std::vector< dtCore::RefPtr<FrameDataType> > dtUtil::KeyFrameDecoder< RecordableT, FrameDataT >::FrameDataPtrContainer

The data to be saved from the object of interest.

template<typename RecordableT, typename FrameDataT>
typedef std::pair<double,FrameDataPtrContainer> dtUtil::KeyFrameDecoder< RecordableT, FrameDataT >::KeyFrame

A container to hold each source's frame data.

template<typename RecordableT, typename FrameDataT>
typedef std::vector<KeyFrame> dtUtil::KeyFrameDecoder< RecordableT, FrameDataT >::KeyFrameContainer

The time stamp applied to the entire container of frame data.

template<typename RecordableT, typename FrameDataT>
typedef std::vector< dtCore::RefPtr<RecordableType> > dtUtil::KeyFrameDecoder< RecordableT, FrameDataT >::RecordablePtrContainer

The container of KeyFrame data.


Constructor & Destructor Documentation

template<typename RecordableT, typename FrameDataT>
dtUtil::KeyFrameDecoder< RecordableT, FrameDataT >::KeyFrameDecoder ( const RecordablePtrContainer sources,
KeyFrameContainer kfc 
) [inline]

The container of sources of frame data.

The constructor.

Parameters:
sources The RecordableType instances that are needed for deserializing the XML information.
kfc The KeyFrameContainer provided will be appended during loading. If only loaded data is wished to be contained, then the container should be cleared before executing the Walk.

template<typename RecordableT, typename FrameDataT>
dtUtil::KeyFrameDecoder< RecordableT, FrameDataT >::~KeyFrameDecoder (  )  [inline]


Member Function Documentation

template<typename RecordableT, typename FrameDataT>
void dtUtil::KeyFrameDecoder< RecordableT, FrameDataT >::Walk ( XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *  doc  )  [inline]

template<typename RecordableT, typename FrameDataT>
void dtUtil::KeyFrameDecoder< RecordableT, FrameDataT >::DecodeFrameStamp ( XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *  doc,
XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *  fs,
FrameDataPtrContainer fdc 
) [inline, protected]

Walks the frame stamp tag to find each source's data and asks the source to deserialize the XML tag into a data package.

template<typename RecordableT, typename FrameDataT>
FrameDataType* dtUtil::KeyFrameDecoder< RecordableT, FrameDataT >::DecodeSourceData ( XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *  doc,
XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *  e,
unsigned int  index 
) [inline, protected]


http://www.delta3d.org
2.0.0 generated 14 Feb 2008