VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Protected Attributes
DtReaderWriterPropertyFactory Class Reference

Specialized type of reader/writer factory that supports properties. More...

Inheritance diagram for DtReaderWriterPropertyFactory:
Inheritance graph
[legend]

Public Types

typedef std::map< DtString,
DtPropertyRollUpFunction
RollUpRules
- Public Types inherited from DtReaderWriterFactory
typedef DtReaderWriter *(* DtRWCreatorFcn )(const DtString &name, DtReaderWriterRegistry *parentRegistry)
typedef void(* DtRWCopyFcn )(const DtReaderWriter *source, DtReaderWriter *dest)
typedef int(* DtRwGetSizeFcn )(const DtReaderWriter *source)
typedef bool(* DtRwCompareFcn )(const DtReaderWriter *lhs, const DtReaderWriter *rhs)
typedef char *(* DtRwEncodeFcn )(const DtReaderWriter *source, char *)
typedef const char *(* DtRwDecodeFcn )(DtReaderWriter *source, const char *)
typedef std::map< DtString,
DtRwFunctions
DtRwFunctionMap

Public Member Functions

 DtReaderWriterPropertyFactory (bool registerDefaults=true)
virtual ~DtReaderWriterPropertyFactory ()
virtual bool defaultRollUpFunction (const DtReaderWriter *source, DtReaderWriter *destination)
 Default rule is to simply copy the source to the destination.
virtual DtPropertyRollUpFunction defaultRollUpRule () const
virtual void setDefaultRollUpRule (DtPropertyRollUpFunction)
virtual void setRollUpRule (const DtString &type, DtPropertyRollUpFunction fcn)
 Sets the roll up function for the given type. If a roll up function exists it is replaced.
virtual bool rollUpReaderWriter (const DtReaderWriter *source, DtReaderWriter *destination, const DtMergePath &) const
 Rolls up the source with the destination according to the roll up rule of the reader/writer type.
virtual const RollUpRulesrollUpRules () const
virtual RollUpRulesrollUpRules ()
- Public Member Functions inherited from DtReaderWriterFactory
 DtReaderWriterFactory (bool registerDefaults=true)
virtual std::set< DtStringxmlTypes () const
 Returns all the xml types.
virtual DtString mapXmlToRwType (const DtString &xmlType) const
 Maps the xml type to reader/writer type.
virtual DtString mapRwToXmlType (const DtString &rwType) const
 Maps the reader/writer type to xml type.
virtual DtReaderWritercreateItem (const DtString &type, const DtString &name, DtReaderWriterRegistry *parentRegistry) const
 Creates a new RW type based on the type string provided, with the specified name and parent registry.
virtual bool copyReaderWriter (const DtReaderWriter *sourceRw, DtReaderWriter *destRw) const
 Uses the operator= method on the RW objects to assign sourceRw to destRw.
virtual bool compareReaderWriter (const DtReaderWriter *sourceRw, const DtReaderWriter *destRw) const
 Uses the operator== method on the RW objects to check for equality.
virtual DtReaderWritercloneReaderWriter (const DtString &name, const DtReaderWriter *sourceRw, DtReaderWriterRegistry *parentRegistry) const
 Creates a clone of the RW object to create a clone of the specified object.
void addDefaultRwCreators ()
 Non-virtual since it is called by the constructor.
template<typename T_RWType >
void registerType (const DtString &rwTypeString)
 Registers a new RW type with the factory.
template<typename T_RWType >
void registerTypeWithoutSerialization (const DtString &rwTypeString)
 Registers type without buffer serialization.
const DtRwFunctionMapfunctionMap () const
bool typeRegistered (const DtString &rwTypeString) const
 Returns true if the specific type is registered.
virtual int getSize (const DtReaderWriter *) const
virtual charencode (const DtReaderWriter *, char *) const
 Encodes the variable bindings into the supplied buffer.
virtual const chardecode (DtReaderWriter *, const char *)
 Decodes the variable bindings from the specified buffer.

Protected Attributes

RollUpRules myRollUpRules
DtPropertyRollUpFunction myDefaultRollUpRule
- Protected Attributes inherited from DtReaderWriterFactory
DtRwFunctionMap myRwFunctionMap
StringMap myRwToXmlType
StringMap myXmlToRwType
std::set< DtStringmyXmlTypes

Additional Inherited Members

- Protected Types inherited from DtReaderWriterFactory
typedef std::map< DtString,
DtString
StringMap
- Protected Member Functions inherited from DtReaderWriterFactory
virtual void mapRwToXml (const DtString &rwType, const DtString &xmlType)
 Maps rw to xml type. If xml type already exists mapping is ignored.
- Static Protected Member Functions inherited from DtReaderWriterFactory
template<typename T_RWType >
static DtReaderWritercreateRWType (const DtString &name, DtReaderWriterRegistry *parentRegistry)
 Templated utility function that acts as a creator for the specified reader writer type.
template<typename T_RWType >
static void copyRwType (const DtReaderWriter *sourceRw, DtReaderWriter *destRw)
 Templated utility function that copies values from one RW to another.
template<typename T_RWType >
static bool compareRwType (const DtReaderWriter *sourceRw, const DtReaderWriter *destRw)
 Templated utility function that copies values from one RW to another.
template<typename T_RWType >
static int getRwSize (const DtReaderWriter *sourceRw)
 Templated utility function that gets the size of the reader/writer item.
template<typename T_RWType >
static charencodeRwType (const DtReaderWriter *sourceRw, char *buf)
 Templated utility function that encodes the reader/writer item.
template<typename T_RWType >
static const chardecodeRwType (DtReaderWriter *sourceRw, const char *buf)
 Templated utility function that decodes the reader/writer item.

Detailed Description

Specialized type of reader/writer factory that supports properties.

Member Typedef Documentation

Constructor & Destructor Documentation

DtReaderWriterPropertyFactory::DtReaderWriterPropertyFactory ( bool  registerDefaults = true)
virtual DtReaderWriterPropertyFactory::~DtReaderWriterPropertyFactory ( )
virtual

Member Function Documentation

virtual bool DtReaderWriterPropertyFactory::defaultRollUpFunction ( const DtReaderWriter source,
DtReaderWriter destination 
)
virtual

Default rule is to simply copy the source to the destination.

virtual DtPropertyRollUpFunction DtReaderWriterPropertyFactory::defaultRollUpRule ( ) const
virtual
virtual void DtReaderWriterPropertyFactory::setDefaultRollUpRule ( DtPropertyRollUpFunction  )
virtual
virtual void DtReaderWriterPropertyFactory::setRollUpRule ( const DtString type,
DtPropertyRollUpFunction  fcn 
)
virtual

Sets the roll up function for the given type. If a roll up function exists it is replaced.

virtual bool DtReaderWriterPropertyFactory::rollUpReaderWriter ( const DtReaderWriter source,
DtReaderWriter destination,
const DtMergePath  
) const
virtual

Rolls up the source with the destination according to the roll up rule of the reader/writer type.

If no type exists then will use default roll up rule

virtual const RollUpRules& DtReaderWriterPropertyFactory::rollUpRules ( ) const
inlinevirtual
virtual RollUpRules& DtReaderWriterPropertyFactory::rollUpRules ( )
inlinevirtual

Member Data Documentation

RollUpRules DtReaderWriterPropertyFactory::myRollUpRules
protected
DtPropertyRollUpFunction DtReaderWriterPropertyFactory::myDefaultRollUpRule
protected

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

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)