![]() |
VR-Forces 5.0.2 Developer's Guide
|
Loads entity type enumerations from an XML file into a DtEnumDictionary.
Public Types | |
| typedef DtEnumLoader *(* | EnumLoaderCreator )() |
| typedef std::list < DtEntityTypeRange > | Applicability |
| typedef boost::function< bool(const DtFilename &, DtEnumDictionary &)> | FileLoaderFcn |
| typedef boost::function < unsigned(const DtFilename &)> | FilePriorityReaderFcn |
| typedef boost::function< void(xmlNodePtr, const Applicability &, DtEnumDictionary &)> | XmlEntityTypeEntryReaderFcn |
| typedef boost::function< void(xmlNodePtr, DtEnumDictionary &)> | XmlEntryReaderFcn |
Public Member Functions | |
| virtual | ~DtEnumLoader () |
| virtual bool | loadFromDirectory (const DtFilename &directory, DtEnumDictionary &dict) |
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) |
| virtual void | addInterestInEnumRange (DtEnumUid lowerUid, DtEnumUid upperUid) |
| virtual void | addInterestInEntityTypeEnum (DtEnumUid uid, DtEntityTypeField) |
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) |
| virtual void | unregisterFileLoader (const DtString &fileExt) |
| virtual void | registerFilePriorityReader (const DtString &fileExt, FilePriorityReaderFcn fcn) |
| virtual void | unregisterFilePriorityReader (const DtString &fileExt) |
| virtual void | registerUidEntryReader (DtEnumUid uid, XmlEntryReaderFcn fcn) |
| virtual void | unregisterUidEntryReader (DtEnumUid uid) |
| virtual void | registerUidRangeEntryReader (DtEnumUid lowerUid, DtEnumUid upperUid, XmlEntryReaderFcn fcn) |
| virtual void | unregisterUidRangeEntryReader (DtEnumUid lowerUid, DtEnumUid upperUid) |
| virtual void | registerEntityTypeUidEntryReader (DtEnumUid uid, XmlEntityTypeEntryReaderFcn fcn) |
| virtual void | unregisterEntityTypeUidEntryReader (DtEnumUid uid) |
| virtual void | registerEntityTypeFieldEntryReader (DtEntityTypeField lvl, XmlEntityTypeEntryReaderFcn fcn) |
| virtual void | unregisterEntityTypeFieldEntryReader (DtEntityTypeField lvl) |
Static Public Member Functions | |
| static DtEnumLoader * | create () |
| static void | setCreator (EnumLoaderCreator creator) |
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 |
Static Protected Attributes | |
| static EnumLoaderCreator | theCreator |
| typedef DtEnumLoader*(* DtEnumLoader::EnumLoaderCreator)() |
Type for the creator function for this class. See setCreator.
| 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 boost::function<bool(const DtFilename&, DtEnumDictionary&)> DtEnumLoader::FileLoaderFcn |
The function prototype for loading an enumerations file.
| typedef boost::function<unsigned(const DtFilename&)> DtEnumLoader::FilePriorityReaderFcn |
The function prototype for loading an enumerations file.
| typedef boost::function<void(xmlNodePtr, const Applicability&, DtEnumDictionary&)> DtEnumLoader::XmlEntityTypeEntryReaderFcn |
The function prototype for loading an individual entity type from an xml node.
| typedef boost::function<void(xmlNodePtr, DtEnumDictionary&)> DtEnumLoader::XmlEntryReaderFcn |
The function prototype for loading a individual enumeration from an xml node.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
virtual |
Destructor.
|
protected |
Constructor is protected. Should call create() to create your loader. Ensures the registered creator function is called.
|
static |
Creates a new DtEnumLoader using the registered creator function.
|
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.
|
virtual |
Loads all enumeration files from the given directory into the dictionary. Returns true if successful.
|
virtual |
Adds interest in a general enumeration.
|
virtual |
Adds interest in a range of general enumerations.
|
virtual |
Adds interest in an entity type enumeration.
|
virtual |
Registers a function to load a specific file type.
|
virtual |
Remove a registered file loader.
|
virtual |
Registers a function to read the load priority from a file.
|
virtual |
Remove a registered priority reader.
|
virtual |
Registers a reader function for an enumeration with a specific uid.
|
virtual |
Remove a registered enumeration reader function.
|
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.
|
virtual |
Remove a registered enumeration reader function that was defined by a range of uids.
|
virtual |
Registers a reader function for an entity type enumeration with a specific uid.
|
virtual |
Remove a registered entity type enumeration reader function.
|
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 |
Remove a registered entity type enumeration reader function that was defined by for a field level.
|
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.
|
protectedvirtual |
Default function used to load an xml enumerations file, such as SISO-REF-010.xml or MAK-Enums.xml.
|
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 |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
Processes the node, fills the enums map and name, and returns the uid of the enumeration.
|
protectedvirtual |
Processes the node, including any child nodes that also require processing, and adds all new enumerations to the dictionary.
|
protectedvirtual |
Sets the range of values for the field at the specified level of the entity type.
|
protectedvirtual |
Parses the applicability from the the xml text.
Converts an xmlChar string to an integer.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |