VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Public Attributes
DtMsdlHierarchyPropertyMappings Class Reference

Public Types

typedef std::map< std::string,
std::string > 
StringMap
 
typedef std::multimap
< std::string, std::string > 
StringMultiMap
 
typedef std::map< std::string,
int
StringIntMap
 
typedef std::map< int,
std::string > 
IntStringMap
 

Public Member Functions

 DtMsdlHierarchyPropertyMappings ()
 
 DtMsdlHierarchyPropertyMappings (const DtMsdlHierarchyPropertyMappings &)
 
virtual ~DtMsdlHierarchyPropertyMappings ()
 
DtMsdlHierarchyPropertyMappingsoperator= (const DtMsdlHierarchyPropertyMappings &)
 
virtual std::string mapHierarchyItemToSidc (const std::string &msdlHierarchy) const
 
virtual std::string mapSidcToName (const std::string &sidc) const
 
virtual std::string mapSidcToHierarchyItem (const std::string &sidc) const
 
virtual void mapUnitSubcategoryToSidc (std::string &sidc, const DtEntityType &entType) const
 
virtual void mapUnitCategoryToSidc (std::string &sidc, const DtEntityType &entType) const
 
virtual std::string mapEntityTypeToSidc (const DtEntityType &) const
 
virtual int mapCountryCodeToDisEnumeration (const std::string &) const
 
virtual DtEntityType mapSidcToDisEnumeration (const std::string sidcCode, const std::string &countryCode="US") const
 
virtual DtEntityType mapSidcToEntityType (const std::string &, const std::string &countryCode="US") const
 
virtual DtEntityType mapSidcToTacticalGraphicType (const std::string &sidcCode, const std::string &symbolClass) const
 
virtual std::string mapCountryEnumerationToCountryCode (int) const
 
virtual std::string mapCountryCodeToCountryName (const std::string &) const
 
virtual bool loadMsdlSidcMappingsFile (const DtFilename &)
 
virtual bool loadCountryCodesMappingFile (const DtFilename &)
 
virtual bool save ()
 
virtual bool save (const DtFilename &)
 
virtual void merge (const DtMsdlHierarchyPropertyMappings &)
 
virtual std::string findClosestSidc (const std::string &source) const
 
virtual void addSidcCode (const std::string &)
 
virtual void addToCountryCodeToCountryNameMapping (const std::string &countrycode, const std::string &countryname)
 
virtual void addToHierarchyMapping (const std::string &enumeration, const std::string &sidcCode)
 
virtual void addToDataItemMapping (const std::string &sidcCode, const std::string &name, const std::string &entityType, const std::string &hierarchy)
 
virtual void clearHierarchyMappings ()
 
virtual void addCountryCode (const std::string &, int)
 
virtual void merge (StringMap &, const StringMap &)
 
virtual void merge (StringToDataItemMultiMap &toMergeInto, const StringToDataItemMultiMap &toMergeFrom)
 
const StringMapcountryCodeToNameMap () const
 
const StringToDataItemMultiMapsidcToDataItemMultiMap () const
 

Public Attributes

StringMap myHierarchyItemToSidc
 
StringMap myCountryCodeToCountryName
 
StringIntMap myCountryCodes
 
IntStringMap myCountryEnumerationCodes
 
StringToDataItemMultiMap mySidcToDataItems
 
std::set< std::string > mySidcCodes
 
DtFilename myFile
 

Member Typedef Documentation

typedef std::map<std::string, std::string> DtMsdlHierarchyPropertyMappings::StringMap
typedef std::multimap<std::string, std::string> DtMsdlHierarchyPropertyMappings::StringMultiMap
typedef std::map<std::string, int> DtMsdlHierarchyPropertyMappings::StringIntMap
typedef std::map<int, std::string> DtMsdlHierarchyPropertyMappings::IntStringMap

Constructor & Destructor Documentation

DtMsdlHierarchyPropertyMappings::DtMsdlHierarchyPropertyMappings ( )

CTOR.

DtMsdlHierarchyPropertyMappings::DtMsdlHierarchyPropertyMappings ( const DtMsdlHierarchyPropertyMappings )
virtual DtMsdlHierarchyPropertyMappings::~DtMsdlHierarchyPropertyMappings ( )
virtual

DTOR.

Member Function Documentation

DtMsdlHierarchyPropertyMappings& DtMsdlHierarchyPropertyMappings::operator= ( const DtMsdlHierarchyPropertyMappings )
virtual std::string DtMsdlHierarchyPropertyMappings::mapHierarchyItemToSidc ( const std::string &  msdlHierarchy) const
virtual

Return a mapping of hierarchy code to SIDC code.

virtual std::string DtMsdlHierarchyPropertyMappings::mapSidcToName ( const std::string &  sidc) const
virtual

Return the name for the SIDC code.

virtual std::string DtMsdlHierarchyPropertyMappings::mapSidcToHierarchyItem ( const std::string &  sidc) const
virtual
virtual void DtMsdlHierarchyPropertyMappings::mapUnitSubcategoryToSidc ( std::string &  sidc,
const DtEntityType &  entType 
) const
virtual

Changes characters in positions 4-9 (0-based) of the SIDC string according to the subcategory of the entity type, given that it is a unit.

virtual void DtMsdlHierarchyPropertyMappings::mapUnitCategoryToSidc ( std::string &  sidc,
const DtEntityType &  entType 
) const
virtual

Changes characters in positions 10-11 (0-based) of the SIDC string according to the echelon given in the category of the entity type, given that the entity type is a unit.

virtual std::string DtMsdlHierarchyPropertyMappings::mapEntityTypeToSidc ( const DtEntityType &  ) const
virtual

Maps a DIS enumeration to SIDC code. Looks up the DIS in mySidcToDisEnumeration. If there is no direct mapping will generate what it can from the DIS fields. If nothing can be mapped, and empty string is returned.

virtual int DtMsdlHierarchyPropertyMappings::mapCountryCodeToDisEnumeration ( const std::string &  ) const
virtual
virtual DtEntityType DtMsdlHierarchyPropertyMappings::mapSidcToDisEnumeration ( const std::string  sidcCode,
const std::string &  countryCode = "US" 
) const
virtual

Check DIS Enumeration map for match. Also fills in blanks four country code by looking up the DIS country number in a map of SIDC country codes -> DIS country numbers (which is taken from country-codes.csv). If the lookup fails to produce a valid number, then the country code is taken from the countryCode argument (which defaults to US).

virtual DtEntityType DtMsdlHierarchyPropertyMappings::mapSidcToEntityType ( const std::string &  ,
const std::string &  countryCode = "US" 
) const
virtual

Converts an SIDC to an entity type. Differs from DisEnumeration call in that it will try and parse the SIDC code to fill in some blanks, whereas the DisEnumeration call does not.

virtual DtEntityType DtMsdlHierarchyPropertyMappings::mapSidcToTacticalGraphicType ( const std::string &  sidcCode,
const std::string &  symbolClass 
) const
virtual

Converts the tactical graphic type/symbol class to entity type.

virtual std::string DtMsdlHierarchyPropertyMappings::mapCountryEnumerationToCountryCode ( int  ) const
virtual

Maps a country enumeration to 2 digit country code.

virtual std::string DtMsdlHierarchyPropertyMappings::mapCountryCodeToCountryName ( const std::string &  ) const
virtual

Returns the country name given the country code. If country code is > 2 characters, shortened to 2 characters for search.

virtual bool DtMsdlHierarchyPropertyMappings::loadMsdlSidcMappingsFile ( const DtFilename &  )
virtual

Loads the mapping file.

virtual bool DtMsdlHierarchyPropertyMappings::loadCountryCodesMappingFile ( const DtFilename &  )
virtual

Loads the country codes mapping file.

virtual bool DtMsdlHierarchyPropertyMappings::save ( )
virtual

Saves msdl mappings to file loaded from.

virtual bool DtMsdlHierarchyPropertyMappings::save ( const DtFilename &  )
virtual

Saves msdl mappings to specified file.

virtual void DtMsdlHierarchyPropertyMappings::merge ( const DtMsdlHierarchyPropertyMappings )
virtual

Merges in the contents of the given hierarchy to this (replaces and adds, but does not delete missing items)

virtual std::string DtMsdlHierarchyPropertyMappings::findClosestSidc ( const std::string &  source) const
virtual

Finds the closest SIDC to the supplied on given the hierarchy to SIDC mapping. Iterates over the hierarchy map and compares the SIDC code to the supplied code.

virtual void DtMsdlHierarchyPropertyMappings::addSidcCode ( const std::string &  )
virtual
virtual void DtMsdlHierarchyPropertyMappings::addToCountryCodeToCountryNameMapping ( const std::string &  countrycode,
const std::string &  countryname 
)
virtual

Adds to country code/country name mapping. Format is: <country_code>.ccode=<country name>="">

virtual void DtMsdlHierarchyPropertyMappings::addToHierarchyMapping ( const std::string &  enumeration,
const std::string &  sidcCode 
)
virtual

Adds to hierarchy mapping (myHierarchyItemToSidc). Format is: <hier>=<sidc code>="">

virtual void DtMsdlHierarchyPropertyMappings::addToDataItemMapping ( const std::string &  sidcCode,
const std::string &  name,
const std::string &  entityType,
const std::string &  hierarchy 
)
virtual

Adds to sidc data items mapping.

virtual void DtMsdlHierarchyPropertyMappings::clearHierarchyMappings ( )
virtual

Clears the hierarchy data from the items mapping.

virtual void DtMsdlHierarchyPropertyMappings::addCountryCode ( const std::string &  ,
int   
)
virtual

Adds a country code.

virtual void DtMsdlHierarchyPropertyMappings::merge ( StringMap ,
const StringMap  
)
virtual

Merges in the contents of the given hierarchy to this (replaces and adds, but does not delete missing items)

virtual void DtMsdlHierarchyPropertyMappings::merge ( StringToDataItemMultiMap toMergeInto,
const StringToDataItemMultiMap toMergeFrom 
)
virtual
const StringMap& DtMsdlHierarchyPropertyMappings::countryCodeToNameMap ( ) const

Returns country code to name map.

const StringToDataItemMultiMap& DtMsdlHierarchyPropertyMappings::sidcToDataItemMultiMap ( ) const

Returns the SIDC to data item multimap.

Member Data Documentation

StringMap DtMsdlHierarchyPropertyMappings::myHierarchyItemToSidc
StringMap DtMsdlHierarchyPropertyMappings::myCountryCodeToCountryName
StringIntMap DtMsdlHierarchyPropertyMappings::myCountryCodes
IntStringMap DtMsdlHierarchyPropertyMappings::myCountryEnumerationCodes
StringToDataItemMultiMap DtMsdlHierarchyPropertyMappings::mySidcToDataItems
std::set<std::string> DtMsdlHierarchyPropertyMappings::mySidcCodes
DtFilename DtMsdlHierarchyPropertyMappings::myFile

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

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)