![]() |
VR-Link API Documentation for HLA 1516
|
Maintains a list of enumerations read in from files. More...
Collaboration diagram for DtEnumDictionary:Classes | |
| struct | EnumInformation |
Public Types | |
| typedef std::map< int, DtEnumInfo > | EnumMap |
| typedef std::map< DtEntityType, DtString > | EntityTypeDescriptionMap |
| typedef std::map< DtEnumUid, EnumInformation > | UidToNameMap |
Public Member Functions | |
| DtEnumDictionary () | |
| Constructor - constructs an empty dictionary. More... | |
| virtual | ~DtEnumDictionary () |
| Destructor. More... | |
| virtual void | print (std::ostream &strm) const |
| Prints the lists of enumerations within this dictionary to the given stream. More... | |
| const UidToNameMap & | uidToNameMap () const |
Entity Type Enumerations | |
Functions for adding and looking up entity type enumerations. | |
| virtual EnumMap | entityTypeEnumValues (DtEntityTypeField fieldLevel, const DtEntityType &higherLevelFields=DtEntityType::defaultType()) const |
| Returns the map of enumerated values that are defined at the given field level. More... | |
| virtual int | entityTypeValueFromName (DtEntityTypeField fieldLevel, const DtString &name, const DtEntityType &higherLevelFields=DtEntityType::defaultType()) const |
| Returns the specific entity type field enumerated value that matches the specified name. More... | |
| virtual DtString | entityTypeNameFromValue (DtEntityTypeField fieldLevel, const DtEntityType &entityType) const |
| Returns the specific entity type field enumerated value name that matches the specified entity type. More... | |
| virtual DtString | displayName (const DtEntityType &, bool includeKind=true, int stopAt=DtSubcategoryField, bool *isDeprecated=0) const |
| Given the entity type, return a name that best represents the type. More... | |
| virtual void | findEntriesContaining (const DtString &text, EntityTypeDescriptionMap &results, int maxResults) |
| Finds entity type descriptions containing the specified text. More... | |
| virtual bool | isDeprecatedEntityTypeValue (DtEntityTypeField fieldLevel, const DtEntityType &entityType) const |
| Returns true if the the specified entity type has been deprecated at the given field level. More... | |
| virtual void | addEntityTypeEnum (DtEntityTypeField fieldLevel, const EnumMap &enums, const DtEntityTypeRange &applic=DtEntityTypeRange::AllEntityTypes()) |
| Adds an enumeration at the given field level, with an optional applicability. More... | |
| virtual void | addEntityTypeEnumWithUid (DtEnumUid uid, DtEntityTypeField fieldLevel, const EnumMap &enums, const DtEntityTypeRange &applic=DtEntityTypeRange::AllEntityTypes()) |
| Adds an enumeration with a specified uid at the given field level, with an optional applicability. More... | |
General Enumerations | |
Functions for adding and looking up general enumerations. | |
| virtual void | addEnum (DtEnumUid uid, const EnumMap &list, const DtString &name, const DtString &description="") |
| Adds a new enum and list of values to the dictionary. More... | |
| virtual void | merge (const DtEnumDictionary &) |
| Merges the contents of the supplied dictionary into this dictionary. More... | |
| virtual const EnumMap & | enumValues (DtEnumUid uid) const |
| Returns the enumerated values and descriptions for the enumeration with the given uid. More... | |
| virtual int | nextId (DtEnumUid uid, bool startFromUser=true) const |
| Given the enum id, with the map, return the next highest key, assuming an ordered EnumMap Returns the name of the enumeration with the given uid. More... | |
| virtual DtString | enumName (DtEnumUid uid) const |
| Adds a new enum and list of values to the dictionary. More... | |
| virtual DtString | enumDescription (DtEnumUid uid) const |
| Adds a new enum and list of values to the dictionary. More... | |
| virtual std::vector< DtEnumUid > | enumUid (const DtString &name) const |
| Returns the uids of any enumerations with the given name. More... | |
| virtual int | enumValueFromName (DtEnumUid uid, const DtString &n) const |
| Maps the name of enumerated value of a given enumeration to its value. More... | |
| virtual DtString | enumNameFromValue (DtEnumUid uid, int v) const |
| Maps an enumerated value of a given enumeration to its name. More... | |
| virtual bool | hasNameFromValue (DtEnumUid uid, int val) const |
| Returns true if the name and value exist. More... | |
| virtual bool | removeValue (DtEnumUid uid, int val) |
| Removes the value from the enum. Returns true if remove successful. More... | |
| virtual bool | isDeprecatedValue (DtEnumUid uid, int val) const |
| Returns true if this enumerated value has been deprecated. More... | |
Static Public Attributes | |
| static const unsigned | theMakUidRangeStart = 1000000 |
| The start of the general MAK uid range. More... | |
| static const unsigned | theMakUidRangeEnd = 2000000 |
| The end of the general MAK uid range. More... | |
| static const unsigned | theVrfUidRangeStart = 2000000 |
| The start of the VRF uid range. More... | |
| static const unsigned | theVrfUidRangeEnd = 3000000 |
| The end of the VRF uid range. More... | |
| static const unsigned | theAssignedUidRangeStart = 10000000 |
| Some entity enumerations are not defined with a uid, but the dictionary will assign one from a pool of ids starting with this value. More... | |
Protected Types | |
| typedef std::multimap < DtString, DtEnumUid > | NameToUidMap |
| 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 |
| Merges the src map into the dest map, keeping values in the dest when they conflict. More... | |
| virtual DtEnumUid | getAssignedUid () |
| For enumerations without configured uids, assign one from the pool of values starting with theAssignedUidRangeStart. More... | |
| virtual void | printMap (const EnumMap &enumMap, std::ostream &strm, unsigned indentLvl) const |
| Prints the enum map to the specified stream with indentation. More... | |
| virtual void | printMap (const TypeRangeUidMap &enumMap, std::ostream &strm, unsigned indentLvl) const |
| Prints the enum map to the specified stream with indentation. More... | |
Static Protected Member Functions | |
| static void | setEntityTypeField (DtEntityType &entityType, DtEntityTypeField field, int val) |
| Sets the specified field in the entity type with the given value. More... | |
| static int | getEntityTypeField (const DtEntityType &entityType, DtEntityTypeField field) |
| Returns the value of the specified field in the entity type. More... | |
Protected Attributes | |
| DtEnumUid | myNextAssignedUid |
| The next uid that can be assigned to an entity type enumeration without a uid defined. More... | |
Entity Type Enumeration Storage | |
| UidEnumMap | myEntityTypeEnums |
| All of the defined entity type enumerations, mapped by uid, where uids are assigned when not defined by the calling application. More... | |
| EntityTypeUidList | myEntityTypeApplicabilityList |
| A map to provide lookups from entity type applicability in higher level fields to the uid of the available enumerated values. More... | |
| DescriptionEntityTypeMap | myEntityTypeDescriptions |
| Map of entity type descriptions to their enumerated types. More... | |
| UidEnumMap | myEnums |
| All of the defined general enumerations mapped by uid. More... | |
| NameToUidMap | myNameToUidMap |
| Map of descriptive enumeration names to their uids. More... | |
| UidToNameMap | myUidToNameMap |
| Map of uids to their descriptive enumeration names. More... | |
Static Protected Attributes | |
| static const EnumMap | theEmptyMap |
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.
|
protected |
| typedef std::map<DtEntityType, DtString> DtEnumDictionary::EntityTypeDescriptionMap |
|
protected |
| typedef std::map<int, DtEnumInfo> DtEnumDictionary::EnumMap |
|
protected |
|
protected |
|
protected |
|
protected |
| typedef std::map<DtEnumUid, EnumInformation> DtEnumDictionary::UidToNameMap |
| DtEnumDictionary::DtEnumDictionary | ( | ) |
Constructor - constructs an empty dictionary.
|
virtual |
Destructor.
|
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.
|
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 |
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 name that matches the specified entity type.
|
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.
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.
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.
Maps an enumerated value of a given enumeration to its name.
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.
Returns the enumerated values and descriptions for the enumeration with the given uid.
|
virtual |
Finds entity type descriptions containing the specified text.
|
protectedvirtual |
For enumerations without configured uids, assign one from the pool of values starting with theAssignedUidRangeStart.
|
staticprotected |
Returns the value of the specified field in the entity type.
Returns true if the name and value exist.
|
virtual |
Returns true if the the specified entity type has been deprecated at the given field level.
Returns true if this enumerated value has been deprecated.
|
virtual |
Merges the contents of the supplied dictionary into this dictionary.
|
protectedvirtual |
Merges the src map into the dest map, keeping values in the dest when they conflict.
Given the enum id, with the map, return the next highest key, assuming an ordered EnumMap Returns the name of the enumeration with the given uid.
|
virtual |
Prints the lists of enumerations within this dictionary to the given stream.
|
protectedvirtual |
Prints the enum map to the specified stream with indentation.
|
protectedvirtual |
Prints the enum map to the specified stream with indentation.
Removes the value from the enum. Returns true if remove successful.
|
staticprotected |
Sets the specified field in the entity type with the given value.
|
inline |
|
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 entity type enumerations, mapped by uid, where uids are assigned when not defined by the calling application.
|
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 |
The next uid that can be assigned to an entity type enumeration without a uid defined.
|
protected |
Map of uids to their descriptive enumeration names.
|
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.
|
staticprotected |
|
static |
The end of the general MAK uid range.
|
static |
The start of the general MAK uid range.
|
static |
The end of the VRF uid range.
|
static |
The start of the VRF uid range.