VR-Link API Documentation for HLA 1.3
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions

This class handles the conversion between a byte stream and an English readable view of the data in an OMT Tree. More...

+ Collaboration diagram for DtDatatypeManager:

List of all members.

Public Types

enum  DtDatatypeEnum {
  SIMPLE = 1, ENUMERATED, COMPLEX, ARRAY,
  VARIANT, FIXED, DEFINED, DATATYPE_MAX
}

Public Member Functions

virtual ~DtDatatypeManager ()
 destructor
virtual void initOMTData (DtOMTTree *omtTree)
 Fills the datatype type tree with OMT information This function is required at initialization.
virtual DtOMTTreeomtTree ()
virtual void fillDefaultDatatypeRepList ()
 fills the simple database with the usual suspects.
virtual void addDatatypeRep (DtDatatypeRep *)
virtual void addDefinedDatatypeRep (DtDatatypeRep *)
virtual DtDatatypeRepgetSimpleDatatypeRep (const DtString &datatypeName)
virtual std::map< DtString,
DtDatatypeRep * >::iterator 
getNameRepMapList ()
 get a list of all representations.
virtual std::map< DtString,
DtDatatypeRep * >::iterator 
getNameRepMapListEnd ()
virtual void addDelimiterMap (const DtString &datatype, const DtString &delimiter)
 A delimiter is the divider between elements in an array, complex, or fixed.
virtual void removeDelimiterMap (const DtString &datatype)
virtual void setDefaultDelimiter (const DtString &str)
 if no delimiter is specified, this function uses this
virtual DtString getDelimiterMap (const DtString &datatypeName, bool *isAvailable=0)
 get the delimiter for this datatype or the default if its undefined
virtual std::map< DtString,
DtString >::iterator 
getDelimiterList ()
virtual std::map< DtString,
DtString >::iterator 
getDelimiterListEnd ()
virtual void readFile (DtString str)
 Read the datatype mapping file.
virtual void writeFile (DtString str)
 Write out to the datatype mapping file.
virtual void addRepMapping (const DtString &datatype, const DtString &rep)
virtual void removeRepMapping (const DtString &datatype)
virtual bool modifyRepMapping (const DtString &datatype, const DtString &rep)
 Modify a mapping.
virtual std::map< DtString,
DtString >::iterator 
getRepMapList ()
 Get a list of all the Representation mappings.
virtual std::map< DtString,
DtString >::iterator 
getRepMapListEnd ()
virtual DtString getStringRep (const DtDatatypeFedNode *currFedNode, const void *value, int size, int &returnSize)
 Get the string representation from the datatype and the value The size input is the size that the network says the datatype is, but that gets modified to the actual size read.
virtual DtString getStringRep (const DtString &datatypeName, const void *value, int size, int &returnSize)
virtual DtStringTreecreateStringTreeRep (const DtDatatypeFedNode *currFedNode, const void *value, int size, int &returnSize, unsigned int currentOffset=0, DtObjectHistory *=0)
 Creates a string tree from a datatype.
virtual DtStringTreecreateStringTreeRep (const DtString &datatypeName, const void *value, int size, int &returnSize, const DtOMTNode *omtNode=0, unsigned int currentOffset=0, DtStringTree *strParentTree=0, DtObjectHistory *=0)
virtual DtString convertStringTreeToString (DtStringTree *)
 Flatten a string tree.
virtual DtDatatypeEnum getDatatypeEnum (const DtString &datatypeName)

Static Public Member Functions

static DtDatatypeManagerdefaultInstance ()
 returns the one single rule handler

Protected Types

typedef std::map< DtString,
DtString
DatatypeNameRepNameMap
typedef std::map< DtString,
DtDatatypeRep * > 
RepNamePtrMap

Protected Member Functions

virtual void checkOrphanMappings ()
virtual void checkObjOrphans (DtObjectClassFedNode *objClass)
virtual void checkIntOrphans (DtInteractionClassFedNode *intClass)
virtual void getDefaultRep (const void *value, int size, int &returnSize, DtString &returnString)
 Helper functions for getStringRep and createStringTreeRep.
virtual void getDatatypeRep (const DtString &datatypeName, const void *value, int size, int &returnSize, DtString &returnString)
virtual void getEnumRep (const DtString &datatypeName, const void *value, int size, int &returnSize, DtString &returnString)
virtual void getVariantRep (const DtString &datatypeName, const void *value, int size, int &returnSize, DtString &returnString)
virtual void getArrayRep (const DtString &datatypeName, const void *value, int size, int &returnSize, DtString &returnString)
virtual void createComplexTreeRep (const DtOMTNode *omtNode, const DtString &datatypeName, const void *value, int size, int &returnSize, DtStringTree *strTree, DtStringTree *strParentTree=0, unsigned int currentOffset=0, DtObjectHistory *=0)
 Helper functions for createStringTreeRep.
virtual void createArrayTreeRep (const DtOMTNode *omtNode, const DtString &datatypeName, const void *value, int size, int &returnSize, DtStringTree *strTree, DtStringTree *strParentTree=0, unsigned int currentOffset=0, DtObjectHistory *=0)
virtual void processMappings (DtlObjPtr &ptr)
 Helper function for the datatype Mapping file.
virtual int getComplexDatatypeCount (DtComplexComponentNode *compNode, DtComplexDatatypeNode *parentNode, const void *value, int valueSize, int alreadyRead, const DtStringTree *strTree=0, const DtStringTree *parentTree=0)
 Complex and array datatypes have an undetermined amount of elements This function returns the correct element count.
virtual int getArrayDatatypeCount (DtArrayDatatypeNode *arrayNode, const void *value, int valueSize, const DtStringTree *strTree=0, const DtStringTree *parentTree=0)

Protected Attributes

DtOMTTreemyOMTTree
std::map< DtString,
DtDatatypeEnum
myDatatypeTypeMap
DatatypeNameRepNameMap myDatatypeToRepMap
RepNamePtrMap myNameToRepMap
DtString myDefaultDelimiter
std::map< DtString, DtStringmyDelimiterMap

Static Protected Attributes

static DtDatatypeManagertheDatatypeManager
 Protected member data.

Private Member Functions

 DtDatatypeManager ()
 default constructor
 DtDatatypeManager (const DtDatatypeManager &orig)
 Copy Constructor.
DtDatatypeManageroperator= (const DtDatatypeManager &rhs)
 Assignment Operator.

Detailed Description

This class handles the conversion between a byte stream and an English readable view of the data in an OMT Tree.


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
SIMPLE 
ENUMERATED 

A basic datatype such as int or bool.

COMPLEX 

An Enumeration that maps an integer to a string value.

ARRAY 

A collection of different data types in one.

VARIANT 

A collection of the same datatype in one.

FIXED 

A datatype that could be of a different type at runtime.

DEFINED 

A fixed set of a collection of different data types.

DATATYPE_MAX 

An INTERNALLY defined set of different data types.


Constructor & Destructor Documentation

destructor

default constructor

Copy Constructor.


Member Function Documentation

virtual void DtDatatypeManager::addDatatypeRep ( DtDatatypeRep ) [virtual]
virtual void DtDatatypeManager::addDelimiterMap ( const DtString datatype,
const DtString delimiter 
) [virtual]

A delimiter is the divider between elements in an array, complex, or fixed.

For example, if the delimiter is :. Then an array of ints would look like this: 4:67:2:1

virtual void DtDatatypeManager::addRepMapping ( const DtString datatype,
const DtString rep 
) [virtual]
virtual void DtDatatypeManager::checkIntOrphans ( DtInteractionClassFedNode intClass) [protected, virtual]
virtual void DtDatatypeManager::checkObjOrphans ( DtObjectClassFedNode objClass) [protected, virtual]
virtual void DtDatatypeManager::checkOrphanMappings ( ) [protected, virtual]

Flatten a string tree.

This basically converts any function created by createStringTreeRep to the same result as getStringRep

virtual void DtDatatypeManager::createArrayTreeRep ( const DtOMTNode omtNode,
const DtString datatypeName,
const void *  value,
int  size,
int &  returnSize,
DtStringTree strTree,
DtStringTree strParentTree = 0,
unsigned int  currentOffset = 0,
DtObjectHistory = 0 
) [protected, virtual]
virtual void DtDatatypeManager::createComplexTreeRep ( const DtOMTNode omtNode,
const DtString datatypeName,
const void *  value,
int  size,
int &  returnSize,
DtStringTree strTree,
DtStringTree strParentTree = 0,
unsigned int  currentOffset = 0,
DtObjectHistory = 0 
) [protected, virtual]

Helper functions for createStringTreeRep.

virtual DtStringTree* DtDatatypeManager::createStringTreeRep ( const DtDatatypeFedNode currFedNode,
const void *  value,
int  size,
int &  returnSize,
unsigned int  currentOffset = 0,
DtObjectHistory = 0 
) [virtual]

Creates a string tree from a datatype.

This can be a single string if this is a simple datatype, or a more elaborate structure on more complex datatype. Note that this is a 'create' function and the caller is responsible for deleting the string tree

Parameters:
datatypeNameThe Name of the datatype that is defined in value
valueA series of bytes from the network.
sizeThe total size of bytes in value
returnSizeThis gets filled with the actual number of bytes read. If there is a problem and the number of bytes is too many, this returns -1.
virtual DtStringTree* DtDatatypeManager::createStringTreeRep ( const DtString datatypeName,
const void *  value,
int  size,
int &  returnSize,
const DtOMTNode omtNode = 0,
unsigned int  currentOffset = 0,
DtStringTree strParentTree = 0,
DtObjectHistory = 0 
) [virtual]

returns the one single rule handler

fills the simple database with the usual suspects.

virtual int DtDatatypeManager::getArrayDatatypeCount ( DtArrayDatatypeNode arrayNode,
const void *  value,
int  valueSize,
const DtStringTree strTree = 0,
const DtStringTree parentTree = 0 
) [protected, virtual]
virtual void DtDatatypeManager::getArrayRep ( const DtString datatypeName,
const void *  value,
int  size,
int &  returnSize,
DtString returnString 
) [protected, virtual]
virtual int DtDatatypeManager::getComplexDatatypeCount ( DtComplexComponentNode compNode,
DtComplexDatatypeNode parentNode,
const void *  value,
int  valueSize,
int  alreadyRead,
const DtStringTree strTree = 0,
const DtStringTree parentTree = 0 
) [protected, virtual]

Complex and array datatypes have an undetermined amount of elements This function returns the correct element count.

Parameters:
parentTreeA filled string tree.
virtual DtDatatypeEnum DtDatatypeManager::getDatatypeEnum ( const DtString datatypeName) [virtual]
virtual void DtDatatypeManager::getDatatypeRep ( const DtString datatypeName,
const void *  value,
int  size,
int &  returnSize,
DtString returnString 
) [protected, virtual]
virtual void DtDatatypeManager::getDefaultRep ( const void *  value,
int  size,
int &  returnSize,
DtString returnString 
) [protected, virtual]

Helper functions for getStringRep and createStringTreeRep.

virtual std::map<DtString,DtString>::iterator DtDatatypeManager::getDelimiterList ( ) [virtual]
virtual std::map<DtString,DtString>::iterator DtDatatypeManager::getDelimiterListEnd ( ) [virtual]
virtual DtString DtDatatypeManager::getDelimiterMap ( const DtString datatypeName,
bool *  isAvailable = 0 
) [virtual]

get the delimiter for this datatype or the default if its undefined

virtual void DtDatatypeManager::getEnumRep ( const DtString datatypeName,
const void *  value,
int  size,
int &  returnSize,
DtString returnString 
) [protected, virtual]
virtual std::map<DtString,DtDatatypeRep*>::iterator DtDatatypeManager::getNameRepMapList ( ) [virtual]

get a list of all representations.

virtual std::map<DtString,DtDatatypeRep*>::iterator DtDatatypeManager::getNameRepMapListEnd ( ) [virtual]
virtual std::map<DtString,DtString>::iterator DtDatatypeManager::getRepMapList ( ) [virtual]

Get a list of all the Representation mappings.

virtual std::map<DtString,DtString>::iterator DtDatatypeManager::getRepMapListEnd ( ) [virtual]
virtual DtDatatypeRep* DtDatatypeManager::getSimpleDatatypeRep ( const DtString datatypeName) [virtual]
virtual DtString DtDatatypeManager::getStringRep ( const DtDatatypeFedNode currFedNode,
const void *  value,
int  size,
int &  returnSize 
) [virtual]

Get the string representation from the datatype and the value The size input is the size that the network says the datatype is, but that gets modified to the actual size read.

Parameters:
datatypeNameThe Name of the datatype that is defined in value
valueA series of bytes from the network.
sizeThe total size of bytes in value
returnSizeThis gets filled with the actual number of bytes read. If there is a problem and the number of bytes is too many, this returns -1.
virtual DtString DtDatatypeManager::getStringRep ( const DtString datatypeName,
const void *  value,
int  size,
int &  returnSize 
) [virtual]
virtual void DtDatatypeManager::getVariantRep ( const DtString datatypeName,
const void *  value,
int  size,
int &  returnSize,
DtString returnString 
) [protected, virtual]
virtual void DtDatatypeManager::initOMTData ( DtOMTTree omtTree) [virtual]

Fills the datatype type tree with OMT information This function is required at initialization.

virtual bool DtDatatypeManager::modifyRepMapping ( const DtString datatype,
const DtString rep 
) [virtual]

Modify a mapping.

Do not do anything if the mapping does not exist returns true if a mapping is modified, false otherwise

virtual DtOMTTree* DtDatatypeManager::omtTree ( ) [inline, virtual]
DtDatatypeManager& DtDatatypeManager::operator= ( const DtDatatypeManager rhs) [private]

Assignment Operator.

virtual void DtDatatypeManager::processMappings ( DtlObjPtr ptr) [protected, virtual]

Helper function for the datatype Mapping file.

virtual void DtDatatypeManager::readFile ( DtString  str) [virtual]

Read the datatype mapping file.

virtual void DtDatatypeManager::removeDelimiterMap ( const DtString datatype) [virtual]
virtual void DtDatatypeManager::removeRepMapping ( const DtString datatype) [virtual]
virtual void DtDatatypeManager::setDefaultDelimiter ( const DtString str) [virtual]

if no delimiter is specified, this function uses this

virtual void DtDatatypeManager::writeFile ( DtString  str) [virtual]

Write out to the datatype mapping file.


Member Data Documentation

Protected member data.


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

Document ID: Generated on Mon May 14 08:06:18 EDT 2012 from SVN revision 114750
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)