![]() |
VR-Link API Documentation for HLA 4
|
Loads entity type enumerations from an XML file into a DtEnumDictionary. More...
Collaboration diagram for DtEnumLoader:Public Types | |
| typedef DtEnumLoader *(* | EnumLoaderCreator )() |
| Type for the creator function for this class. See setCreator. More... | |
| typedef std::list < DtEntityTypeRange > | Applicability |
| Type for specifying the applicability of an enumeration. More... | |
| typedef std::function< bool(const DtFilename &, DtEnumDictionary &)> | FileLoaderFcn |
| The function prototype for loading an enumerations file. More... | |
| typedef std::function < unsigned(const DtFilename &)> | FilePriorityReaderFcn |
| The function prototype for loading an enumerations file. More... | |
| typedef std::function< void(xmlNodePtr, const Applicability &, DtEnumDictionary &)> | XmlEntityTypeEntryReaderFcn |
| The function prototype for loading an individual entity type from an xml node. More... | |
| typedef std::function< void(xmlNodePtr, DtEnumDictionary &)> | XmlEntryReaderFcn |
| The function prototype for loading a individual enumeration from an xml node. More... | |
Public Member Functions | |
| virtual | ~DtEnumLoader () |
| Destructor. More... | |
| virtual bool | loadFromDirectory (const DtFilename &directory, DtEnumDictionary &dict) |
| Loads all enumeration files from the given directory into the dictionary. More... | |
| virtual bool | loadFile (const DtFilename &file, DtEnumDictionary &dict) |
| Loads the individual file. More... | |
Add Interest in Enumerations | |
These methods can be used to tell the loader to read in enumerations that it does not support by default use standard formats. | |
| virtual void | addInterestInEnum (DtEnumUid uid) |
| Adds interest in a general enumeration. More... | |
| virtual void | addInterestInEnumRange (DtEnumUid lowerUid, DtEnumUid upperUid) |
| Adds interest in a range of general enumerations. More... | |
| virtual void | addInterestInEntityTypeEnum (DtEnumUid uid, DtEntityTypeField) |
| Adds interest in an entity type enumeration. More... | |
Registration/unregistration of Enumeration Reader Functions | |
These methods allow you to define custom functions for reading new file types or customizing how specific xml entries should be processed. Generally they are not needed by most users. If you wish the DtEnumLoader to read enumerations using existing functions for uids not read in by default, use #addInterestInEnumeration, addInterestInEnumRange, or addInterestInEntityTypeEnum. | |
| virtual void | registerFileLoader (const DtString &fileExt, FileLoaderFcn fcn) |
| Registers a function to load a specific file type. More... | |
| virtual void | unregisterFileLoader (const DtString &fileExt) |
| Remove a registered file loader. More... | |
| virtual void | registerFilePriorityReader (const DtString &fileExt, FilePriorityReaderFcn fcn) |
| Registers a function to read the load priority from a file. More... | |
| virtual void | unregisterFilePriorityReader (const DtString &fileExt) |
| Remove a registered priority reader. More... | |
| virtual void | registerUidEntryReader (DtEnumUid uid, XmlEntryReaderFcn fcn) |
| Registers a reader function for an enumeration with a specific uid. More... | |
| virtual void | unregisterUidEntryReader (DtEnumUid uid) |
| Remove a registered enumeration reader function. More... | |
| virtual void | registerUidRangeEntryReader (DtEnumUid lowerUid, DtEnumUid upperUid, XmlEntryReaderFcn fcn) |
| Registers a reader function for enumerations with a uid within a range of uid values (exclusive of the upperId). More... | |
| virtual void | unregisterUidRangeEntryReader (DtEnumUid lowerUid, DtEnumUid upperUid) |
| Remove a registered enumeration reader function that was defined by a range of uids. More... | |
| virtual void | registerEntityTypeUidEntryReader (DtEnumUid uid, XmlEntityTypeEntryReaderFcn fcn) |
| Registers a reader function for an entity type enumeration with a specific uid. More... | |
| virtual void | unregisterEntityTypeUidEntryReader (DtEnumUid uid) |
| Remove a registered entity type enumeration reader function. More... | |
| virtual void | registerEntityTypeFieldEntryReader (DtEntityTypeField lvl, XmlEntityTypeEntryReaderFcn fcn) |
| Registers a general reader function for an entity type enumeration for a specific field level (e.g kind, domain, etc.). More... | |
| virtual void | unregisterEntityTypeFieldEntryReader (DtEntityTypeField lvl) |
| Remove a registered entity type enumeration reader function that was defined by for a field level. More... | |
Static Public Member Functions | |
| static DtEnumLoader * | create () |
| Creates a new DtEnumLoader using the registered creator function. More... | |
| static void | setCreator (EnumLoaderCreator creator) |
| Sets the creator function used by create(). More... | |
Protected Types | |
| typedef std::map< DtString, FileLoaderFcn > | FileLoaderMap |
| typedef std::map< DtString, FilePriorityReaderFcn > | FilePriorityReaderMap |
| typedef std::map< int, XmlEntryReaderFcn > | XmlUidReaderMap |
| typedef std::pair< int, int > | XmlUidRange |
| typedef std::map< XmlUidRange, XmlEntryReaderFcn > | XmlUidRangeReaderMap |
| typedef std::map< int, XmlEntityTypeEntryReaderFcn > | XmlEntityTypeUidReaderMap |
| typedef std::map < DtEntityTypeField, XmlEntityTypeEntryReaderFcn > | XmlEntityTypeLevelReaderMap |
Protected Member Functions | |
| DtEnumLoader () | |
| Constructor is protected. More... | |
| virtual void | registerDefaultLoaders () |
| Registers default loader and reader functions for processing enums files. More... | |
| virtual bool | loadFromXml (const DtFilename &fn, DtEnumDictionary &dict) |
| Default function used to load an xml enumerations file, such as SISO-REF-010.xml or MAK-Enums.xml. More... | |
| virtual unsigned | readPriorityFromXml (const DtFilename &fn) |
| Default function used to read the priority from an xml enumerations file, such as MAK-Enums.xml. More... | |
| virtual DtEnumUid | processSingleLevelEntry (xmlNodePtr node, DtEnumDictionary::EnumMap &enums, DtString &name) const |
| Processes the node, fills the enums map and name, and returns the uid of the enumeration. More... | |
| virtual void | processMultiLevelEntry (xmlNodePtr node, DtEntityTypeField field, const DtEntityTypeRange &applic, DtEnumDictionary &dict, DtEnumUid parentUid) const |
| Processes the node, including any child nodes that also require processing, and adds all new enumerations to the dictionary. More... | |
| virtual void | setEntityTypeLevel (unsigned lvl, int lowerVal, int upperVal, DtEntityTypeRange &etRange) const |
| Sets the range of values for the field at the specified level of the entity type. More... | |
| virtual DtEntityTypeField | parseApplicability (const xmlChar *c, std::list< DtEntityTypeRange > &applics) const |
| Parses the applicability from the the xml text. More... | |
| virtual int | xmlCharToInt (const xmlChar *c) const |
| Converts an xmlChar string to an integer. More... | |
Default xml reader functions. | |
| virtual void | readEntityTypeEnum (xmlNodePtr node, DtEntityTypeField field, const Applicability &applics, DtEnumDictionary &dict) const |
| virtual void | readEntityTypesHierarchy (xmlNodePtr node, DtEnumDictionary &dict) const |
| virtual void | readEnum (xmlNodePtr node, DtEnumDictionary &dict) const |
Static Protected Attributes | |
| static EnumLoaderCreator | theCreator |
Loads entity type enumerations from an XML file into a DtEnumDictionary.
| typedef std::list<DtEntityTypeRange> DtEnumLoader::Applicability |
Type for specifying the applicability of an enumeration.
This indicates what higher level entity type fields a given enumeration can be used with. DtEntityTypeRange supports a range of values within a given level, but you may need multiple different ranges, hence the list.
| typedef DtEnumLoader*(* DtEnumLoader::EnumLoaderCreator)() |
Type for the creator function for this class. See setCreator.
| typedef std::function<bool(const DtFilename&, DtEnumDictionary&)> DtEnumLoader::FileLoaderFcn |
The function prototype for loading an enumerations file.
|
protected |
| typedef std::function<unsigned(const DtFilename&)> DtEnumLoader::FilePriorityReaderFcn |
The function prototype for loading an enumerations file.
|
protected |
| typedef std::function<void(xmlNodePtr, const Applicability&, DtEnumDictionary&)> DtEnumLoader::XmlEntityTypeEntryReaderFcn |
The function prototype for loading an individual entity type from an xml node.
|
protected |
|
protected |
| typedef std::function<void(xmlNodePtr, DtEnumDictionary&)> DtEnumLoader::XmlEntryReaderFcn |
The function prototype for loading a individual enumeration from an xml node.
|
protected |
|
protected |
|
protected |
|
virtual |
Destructor.
|
protected |
Constructor is protected.
Should call create() to create your loader. Ensures the registered creator function is called.
|
virtual |
Adds interest in an entity type enumeration.
|
virtual |
Adds interest in a general enumeration.
|
virtual |
Adds interest in a range of general enumerations.
|
static |
Creates a new DtEnumLoader using the registered creator function.
|
virtual |
Loads the individual file.
|
virtual |
Loads all enumeration files from the given directory into the dictionary.
Returns true if successful.
|
protectedvirtual |
Default function used to load an xml enumerations file, such as SISO-REF-010.xml or MAK-Enums.xml.
|
protectedvirtual |
Parses the applicability from the the xml text.
|
protectedvirtual |
Processes the node, including any child nodes that also require processing, and adds all new enumerations to the dictionary.
|
protectedvirtual |
Processes the node, fills the enums map and name, and returns the uid of the enumeration.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
Default function used to read the priority from an xml enumerations file, such as MAK-Enums.xml.
SISO-REF-010.xml is always priority 0 and is loaded first.
|
protectedvirtual |
Registers default loader and reader functions for processing enums files.
If not previously called, will be called by loadFromFiles() before starting load. Can be overridden in a subclass to provide different or additional default loaders.
|
virtual |
Registers a general reader function for an entity type enumeration for a specific field level (e.g kind, domain, etc.).
This will be used only if there is no specific uid reader specified via registerEntityTypeUidEntryReader.
|
virtual |
Registers a reader function for an entity type enumeration with a specific uid.
|
virtual |
Registers a function to load a specific file type.
|
virtual |
Registers a function to read the load priority from a file.
|
virtual |
Registers a reader function for an enumeration with a specific uid.
|
virtual |
Registers a reader function for enumerations with a uid within a range of uid values (exclusive of the upperId).
This will be used only if there is no specific uid reader specified via registerUidEntryReader.
|
static |
Sets the creator function used by create().
Use this to override what DtEnumLoader is created by the application. This is how a user would register their own subclass that might add functions for reading new all new file types or for specific enumerations.
|
protectedvirtual |
Sets the range of values for the field at the specified level of the entity type.
|
virtual |
Remove a registered entity type enumeration reader function that was defined by for a field level.
|
virtual |
Remove a registered entity type enumeration reader function.
|
virtual |
Remove a registered file loader.
|
virtual |
Remove a registered priority reader.
|
virtual |
Remove a registered enumeration reader function.
|
virtual |
Remove a registered enumeration reader function that was defined by a range of uids.
Converts an xmlChar string to an integer.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |