![]() |
VR-Link API Documentation for HLA 1.3
|
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: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 DtOMTTree * | omtTree () |
| virtual void | fillDefaultDatatypeRepList () |
| fills the simple database with the usual suspects. | |
| virtual void | addDatatypeRep (DtDatatypeRep *) |
| virtual void | addDefinedDatatypeRep (DtDatatypeRep *) |
| virtual DtDatatypeRep * | getSimpleDatatypeRep (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 DtStringTree * | createStringTreeRep (const DtDatatypeFedNode *currFedNode, const void *value, int size, int &returnSize, unsigned int currentOffset=0, DtObjectHistory *=0) |
| Creates a string tree from a datatype. | |
| virtual DtStringTree * | 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 DtString | convertStringTreeToString (DtStringTree *) |
| Flatten a string tree. | |
| virtual DtDatatypeEnum | getDatatypeEnum (const DtString &datatypeName) |
Static Public Member Functions | |
| static DtDatatypeManager * | defaultInstance () |
| 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 | |
| DtOMTTree * | myOMTTree |
| std::map< DtString, DtDatatypeEnum > | myDatatypeTypeMap |
| DatatypeNameRepNameMap | myDatatypeToRepMap |
| RepNamePtrMap | myNameToRepMap |
| DtString | myDefaultDelimiter |
| std::map< DtString, DtString > | myDelimiterMap |
Static Protected Attributes | |
| static DtDatatypeManager * | theDatatypeManager |
| Protected member data. | |
Private Member Functions | |
| DtDatatypeManager () | |
| default constructor | |
| DtDatatypeManager (const DtDatatypeManager &orig) | |
| Copy Constructor. | |
| DtDatatypeManager & | operator= (const DtDatatypeManager &rhs) |
| Assignment Operator. | |
This class handles the conversion between a byte stream and an English readable view of the data in an OMT Tree.
typedef std::map<DtString,DtString> DtDatatypeManager::DatatypeNameRepNameMap [protected] |
typedef std::map<DtString,DtDatatypeRep*> DtDatatypeManager::RepNamePtrMap [protected] |
| virtual DtDatatypeManager::~DtDatatypeManager | ( | ) | [virtual] |
destructor
| DtDatatypeManager::DtDatatypeManager | ( | ) | [private] |
default constructor
| DtDatatypeManager::DtDatatypeManager | ( | const DtDatatypeManager & | orig | ) | [private] |
Copy Constructor.
| virtual void DtDatatypeManager::addDatatypeRep | ( | DtDatatypeRep * | ) | [virtual] |
| virtual void DtDatatypeManager::addDefinedDatatypeRep | ( | 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] |
| virtual DtString DtDatatypeManager::convertStringTreeToString | ( | DtStringTree * | ) | [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
| datatypeName | The Name of the datatype that is defined in value |
| value | A series of bytes from the network. |
| size | The total size of bytes in value |
| returnSize | This 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] |
| static DtDatatypeManager* DtDatatypeManager::defaultInstance | ( | ) | [static] |
returns the one single rule handler
| virtual void DtDatatypeManager::fillDefaultDatatypeRepList | ( | ) | [virtual] |
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.
| parentTree | A 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.
| datatypeName | The Name of the datatype that is defined in value |
| value | A series of bytes from the network. |
| size | The total size of bytes in value |
| returnSize | This 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.
std::map<DtString,DtDatatypeEnum> DtDatatypeManager::myDatatypeTypeMap [protected] |
DtString DtDatatypeManager::myDefaultDelimiter [protected] |
std::map<DtString,DtString> DtDatatypeManager::myDelimiterMap [protected] |
RepNamePtrMap DtDatatypeManager::myNameToRepMap [protected] |
DtOMTTree* DtDatatypeManager::myOMTTree [protected] |
DtDatatypeManager* DtDatatypeManager::theDatatypeManager [static, protected] |
Protected member data.