![]() |
VR-Forces 5.0.3 Developer's Guide
|
Maintains a list of enumerations read in from files. The dictionary supports two different types of enumerations:
All enumerations have an identifying uid. This is used to differentiate one list of enumerations from another. Entity type enumerations do not need to have uids provided, as they can be identified by their higher level applicability.
Public Types | |
| typedef std::map< int, DtEnumInfo > | EnumMap |
| typedef std::map< DtEntityType, DtString > | EntityTypeDescriptionMap |
Public Member Functions | |
| DtEnumDictionary () | |
| virtual | ~DtEnumDictionary () |
| virtual void | print (std::ostream &strm) const |
Entity Type Enumerations | |
Functions for adding and looking up entity type enumerations. | |
| virtual EnumMap | entityTypeEnumValues (DtEntityTypeField fieldLevel, const DtEntityType &higherLevelFields=DtEntityType::defaultType()) const |
| virtual int | entityTypeValueFromName (DtEntityTypeField fieldLevel, const DtString &name, const DtEntityType &higherLevelFields=DtEntityType::defaultType()) const |
| virtual DtString | entityTypeNameFromValue (DtEntityTypeField fieldLevel, const DtEntityType &entityType) const |
| virtual DtString | displayName (const DtEntityType &, bool includeKind=true, int stopAt=DtSubcategoryField, bool *isDeprecated=0) |
| virtual void | findEntriesContaining (const DtString &text, EntityTypeDescriptionMap &results, int maxResults) |
| virtual bool | isDeprecatedEntityTypeValue (DtEntityTypeField fieldLevel, const DtEntityType &entityType) const |
| virtual void | addEntityTypeEnum (DtEntityTypeField fieldLevel, const EnumMap &enums, const DtEntityTypeRange &applic=DtEntityTypeRange::AllEntityTypes()) |
| virtual void | addEntityTypeEnumWithUid (DtEnumUid uid, DtEntityTypeField fieldLevel, const EnumMap &enums, const DtEntityTypeRange &applic=DtEntityTypeRange::AllEntityTypes()) |
General Enumerations | |
Functions for adding and looking up general enumerations. | |
| virtual void | addEnum (DtEnumUid uid, const EnumMap &list, const DtString &name) |
| virtual const EnumMap & | enumValues (DtEnumUid uid) const |
| virtual DtString | enumName (DtEnumUid uid) const |
| virtual std::vector< DtEnumUid > | enumUid (const DtString &name) const |
| virtual int | enumValueFromName (DtEnumUid uid, const DtString &n) const |
| virtual DtString | enumNameFromValue (DtEnumUid uid, int v) const |
| virtual bool | isDeprecatedValue (DtEnumUid uid, int val) const |
Static Public Attributes | |
| static const unsigned | theMakUidRangeStart = 1000000 |
| static const unsigned | theMakUidRangeEnd = 2000000 |
| static const unsigned | theVrfUidRangeStart = 2000000 |
| static const unsigned | theVrfUidRangeEnd = 3000000 |
| static const unsigned | theAssignedUidRangeStart = 10000000 |
Protected Types | |
| typedef std::multimap < DtString, DtEnumUid > | NameToUidMap |
| typedef std::map< DtEnumUid, DtString > | UidToNameMap |
| typedef std::map< DtEnumUid, EnumMap > | UidEnumMap |
| typedef std::vector< EnumMap > | UidEnumList |
| typedef std::map < DtEntityTypeRange, DtEnumUid > | TypeRangeUidMap |
| typedef std::vector < TypeRangeUidMap > | EntityTypeUidList |
| typedef std::multimap < DtString, std::pair < DtEntityType, DtString > > | DescriptionEntityTypeMap |
Protected Member Functions | |
| virtual void | mergeEnumMap (EnumMap &dest, const EnumMap &src) const |
| virtual DtEnumUid | getAssignedUid () |
| virtual void | printMap (const EnumMap &enumMap, std::ostream &strm, unsigned indentLvl) const |
| virtual void | printMap (const TypeRangeUidMap &enumMap, std::ostream &strm, unsigned indentLvl) const |
Static Protected Member Functions | |
| static void | setEntityTypeField (DtEntityType &entityType, DtEntityTypeField field, int val) |
| static int | getEntityTypeField (const DtEntityType &entityType, DtEntityTypeField field) |
Protected Attributes | |
| DtEnumUid | myNextAssignedUid |
Entity Type Enumeration Storage | |
| UidEnumMap | myEntityTypeEnums |
| EntityTypeUidList | myEntityTypeApplicabilityList |
| DescriptionEntityTypeMap | myEntityTypeDescriptions |
| UidEnumMap | myEnums |
| NameToUidMap | myNameToUidMap |
| UidToNameMap | myUidToNameMap |
Static Protected Attributes | |
| static const EnumMap | theEmptyMap |
| typedef std::map<int, DtEnumInfo> DtEnumDictionary::EnumMap |
| typedef std::map<DtEntityType, DtString> DtEnumDictionary::EntityTypeDescriptionMap |
|
protected |
Needs to be a multimap because there is no guarantee text is unique.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Needs to be a multimap because items on different entity type branches may have matching names.
| DtEnumDictionary::DtEnumDictionary | ( | ) |
Constructor - constructs an empty dictionary.
|
virtual |
Destructor.
|
virtual |
Returns the map of enumerated values that are defined at the given field level. If higherLevelFields are specified, then it finds the values at that level that are applicable to the higher level fields of the given entity type. Example:
|
virtual |
Returns the specific entity type field enumerated value that matches the specified name. Will use the specified higher level entity type fields to determine which of the enumerations at the specified field level will be searched.
|
virtual |
Returns the specific entity type field enumerated value name that matches the specified entity type.
|
virtual |
Given the entity type, return a name that best represents the type. The last non-wildcarded item will be used as the name.
|
virtual |
Finds entity type descriptions containing the specified text.
|
virtual |
Returns true if the the specified entity type has been deprecated at the given field level.
|
virtual |
Adds an enumeration at the given field level, with an optional applicability. If no applicability is specified then it is assumed it is relevant to all higher level entity types (e.g. -1:-1:-1:-1:-1:-1:-1).
|
virtual |
Adds an enumeration with a specified uid at the given field level, with an optional applicability. If no applicability is specified then it is assumed it is relevant to all higher level entity types (e.g. -1:-1:-1:-1:-1:-1:-1).
|
virtual |
Adds a new enum and list of values to the dictionary. If already present, merges the new list with the existing, preferring the existing where they conflict.
Returns the enumerated values and descriptions for the enumeration with the given uid.
Returns the name of the enumeration with the given uid.
Returns the uids of any enumerations with the given name. Usually there is only one, but there is no guarantee of unique names.
Maps the name of enumerated value of a given enumeration to its value.
Maps an enumerated value of a given enumeration to its name.
Returns true if this enumerated value has been deprecated.
|
virtual |
Prints the lists of enumerations within this dictionary to the given stream.
|
protectedvirtual |
Merges the src map into the dest map, keeping values in the dest when they conflict.
|
protectedvirtual |
For enumerations without configured uids, assign one from the pool of values starting with theAssignedUidRangeStart.
|
protectedvirtual |
Prints the enum map to the specified stream with indentation.
|
protectedvirtual |
Prints the enum map to the specified stream with indentation.
|
staticprotected |
Sets the specified field in the entity type with the given value.
|
staticprotected |
Returns the value of the specified field in the entity type.
|
static |
The start of the general MAK uid range.
|
static |
The end of the general MAK uid range.
|
static |
The start of the VRF uid range.
|
static |
The end of the VRF uid range.
|
static |
Some entity enumerations are not defined with a uid, but the dictionary will assign one from a pool of ids starting with this value.
|
protected |
All of the defined entity type enumerations, mapped by uid, where uids are assigned when not defined by the calling application.
|
protected |
A map to provide lookups from entity type applicability in higher level fields to the uid of the available enumerated values. This, for example, provides a lookup to find the uid of the category enumeration for all military, ground, US entities.
|
protected |
Map of entity type descriptions to their enumerated types.
|
protected |
All of the defined general enumerations mapped by uid. uid must be defined when added to this dictionary.
|
protected |
Map of descriptive enumeration names to their uids.
|
protected |
Map of uids to their descriptive enumeration names.
|
protected |
The next uid that can be assigned to an entity type enumeration without a uid defined.
|
staticprotected |