VR-Link API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes
DtEnumDictionary Class Reference

Maintains a list of enumerations read in from files. More...

+ Collaboration diagram for DtEnumDictionary:

Classes

struct  EnumInformation
 

Public Types

typedef std::map< int, DtEnumInfoEnumMap
 
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 UidToNameMapuidToNameMap () 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 EnumMapenumValues (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< DtEnumUidenumUid (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< EnumMapUidEnumList
 
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
 

Detailed Description

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.

Member Typedef Documentation

typedef std::multimap<DtString, std::pair<DtEntityType, DtString> > DtEnumDictionary::DescriptionEntityTypeMap
protected
typedef std::vector<TypeRangeUidMap> DtEnumDictionary::EntityTypeUidList
protected
typedef std::multimap<DtString, DtEnumUid> DtEnumDictionary::NameToUidMap
protected
typedef std::vector<EnumMap> DtEnumDictionary::UidEnumList
protected
typedef std::map<DtEnumUid, EnumMap> DtEnumDictionary::UidEnumMap
protected

Constructor & Destructor Documentation

DtEnumDictionary::DtEnumDictionary ( )

Constructor - constructs an empty dictionary.

virtual DtEnumDictionary::~DtEnumDictionary ( )
virtual

Destructor.

Member Function Documentation

virtual void DtEnumDictionary::addEntityTypeEnum ( DtEntityTypeField  fieldLevel,
const EnumMap enums,
const DtEntityTypeRange applic = DtEntityTypeRange::AllEntityTypes() 
)
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 void DtEnumDictionary::addEntityTypeEnumWithUid ( DtEnumUid  uid,
DtEntityTypeField  fieldLevel,
const EnumMap enums,
const DtEntityTypeRange applic = DtEntityTypeRange::AllEntityTypes() 
)
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 void DtEnumDictionary::addEnum ( DtEnumUid  uid,
const EnumMap list,
const DtString name,
const DtString description = "" 
)
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 DtString DtEnumDictionary::displayName ( const DtEntityType ,
bool  includeKind = true,
int  stopAt = DtSubcategoryField,
bool isDeprecated = 0 
) const
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 EnumMap DtEnumDictionary::entityTypeEnumValues ( DtEntityTypeField  fieldLevel,
const DtEntityType higherLevelFields = DtEntityType::defaultType() 
) const
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:

* EnumMap enumeration = dict.entityTypeEnumValues(DtCategoryField, DtEntityType(1, 2, 255, -1, -1, -1, -1));
*
virtual DtString DtEnumDictionary::entityTypeNameFromValue ( DtEntityTypeField  fieldLevel,
const DtEntityType entityType 
) const
virtual

Returns the specific entity type field enumerated value name that matches the specified entity type.

virtual int DtEnumDictionary::entityTypeValueFromName ( DtEntityTypeField  fieldLevel,
const DtString name,
const DtEntityType higherLevelFields = DtEntityType::defaultType() 
) const
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 DtString DtEnumDictionary::enumDescription ( DtEnumUid  uid) const
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 DtString DtEnumDictionary::enumName ( DtEnumUid  uid) const
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 DtString DtEnumDictionary::enumNameFromValue ( DtEnumUid  uid,
int  v 
) const
virtual

Maps an enumerated value of a given enumeration to its name.

virtual std::vector<DtEnumUid> DtEnumDictionary::enumUid ( const DtString name) const
virtual

Returns the uids of any enumerations with the given name.

Usually there is only one, but there is no guarantee of unique names.

virtual int DtEnumDictionary::enumValueFromName ( DtEnumUid  uid,
const DtString n 
) const
virtual

Maps the name of enumerated value of a given enumeration to its value.

virtual const EnumMap& DtEnumDictionary::enumValues ( DtEnumUid  uid) const
virtual

Returns the enumerated values and descriptions for the enumeration with the given uid.

virtual void DtEnumDictionary::findEntriesContaining ( const DtString text,
EntityTypeDescriptionMap results,
int  maxResults 
)
virtual

Finds entity type descriptions containing the specified text.

virtual DtEnumUid DtEnumDictionary::getAssignedUid ( )
protectedvirtual

For enumerations without configured uids, assign one from the pool of values starting with theAssignedUidRangeStart.

static int DtEnumDictionary::getEntityTypeField ( const DtEntityType entityType,
DtEntityTypeField  field 
)
staticprotected

Returns the value of the specified field in the entity type.

virtual bool DtEnumDictionary::hasNameFromValue ( DtEnumUid  uid,
int  val 
) const
virtual

Returns true if the name and value exist.

virtual bool DtEnumDictionary::isDeprecatedEntityTypeValue ( DtEntityTypeField  fieldLevel,
const DtEntityType entityType 
) const
virtual

Returns true if the the specified entity type has been deprecated at the given field level.

virtual bool DtEnumDictionary::isDeprecatedValue ( DtEnumUid  uid,
int  val 
) const
virtual

Returns true if this enumerated value has been deprecated.

virtual void DtEnumDictionary::merge ( const DtEnumDictionary )
virtual

Merges the contents of the supplied dictionary into this dictionary.

virtual void DtEnumDictionary::mergeEnumMap ( EnumMap dest,
const EnumMap src 
) const
protectedvirtual

Merges the src map into the dest map, keeping values in the dest when they conflict.

virtual int DtEnumDictionary::nextId ( DtEnumUid  uid,
bool  startFromUser = true 
) const
virtual

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 void DtEnumDictionary::print ( std::ostream &  strm) const
virtual

Prints the lists of enumerations within this dictionary to the given stream.

virtual void DtEnumDictionary::printMap ( const EnumMap enumMap,
std::ostream &  strm,
unsigned  indentLvl 
) const
protectedvirtual

Prints the enum map to the specified stream with indentation.

virtual void DtEnumDictionary::printMap ( const TypeRangeUidMap enumMap,
std::ostream &  strm,
unsigned  indentLvl 
) const
protectedvirtual

Prints the enum map to the specified stream with indentation.

virtual bool DtEnumDictionary::removeValue ( DtEnumUid  uid,
int  val 
)
virtual

Removes the value from the enum. Returns true if remove successful.

static void DtEnumDictionary::setEntityTypeField ( DtEntityType entityType,
DtEntityTypeField  field,
int  val 
)
staticprotected

Sets the specified field in the entity type with the given value.

const UidToNameMap& DtEnumDictionary::uidToNameMap ( ) const
inline

Member Data Documentation

EntityTypeUidList DtEnumDictionary::myEntityTypeApplicabilityList
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.

DescriptionEntityTypeMap DtEnumDictionary::myEntityTypeDescriptions
protected

Map of entity type descriptions to their enumerated types.

UidEnumMap DtEnumDictionary::myEntityTypeEnums
protected

All of the defined entity type enumerations, mapped by uid, where uids are assigned when not defined by the calling application.

UidEnumMap DtEnumDictionary::myEnums
protected

All of the defined general enumerations mapped by uid.

uid must be defined when added to this dictionary.

NameToUidMap DtEnumDictionary::myNameToUidMap
protected

Map of descriptive enumeration names to their uids.

DtEnumUid DtEnumDictionary::myNextAssignedUid
protected

The next uid that can be assigned to an entity type enumeration without a uid defined.

UidToNameMap DtEnumDictionary::myUidToNameMap
protected

Map of uids to their descriptive enumeration names.

const unsigned DtEnumDictionary::theAssignedUidRangeStart = 10000000
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.

const EnumMap DtEnumDictionary::theEmptyMap
staticprotected
const unsigned DtEnumDictionary::theMakUidRangeEnd = 2000000
static

The end of the general MAK uid range.

const unsigned DtEnumDictionary::theMakUidRangeStart = 1000000
static

The start of the general MAK uid range.

const unsigned DtEnumDictionary::theVrfUidRangeEnd = 3000000
static

The end of the VRF uid range.

const unsigned DtEnumDictionary::theVrfUidRangeStart = 2000000
static

The start of the VRF uid range.


The documentation for this class was generated from the following file:

Document ID: Generated on Thu Oct 16 00:12:25 EDT 2025 from SVN revision 280738
Copyright © 1992-2025 MAK Technologies. All Rights Reserved (www.mak.com)