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

This class facilitates FOM file sorting based on FOM dependencies. More...

+ Collaboration diagram for DtFomSorter:

Public Member Functions

 DtFomSorter ()
 Constructor. More...
 
virtual ~DtFomSorter ()
 Destructor. More...
 
virtual void addFom (const DtString &fomFileName, const DtString &fomIdentifcation, const std::vector< DtString > &depedencies)
 Add the given fom file name, its identification and its depedencies A mapping between the file name and ID/dependencies is created and replaces any mapping the already exists. More...
 
virtual void clear ()
 Clear the FOMs and supporting data to start again. More...
 
virtual void getSortedFomFileNames (std::vector< DtString > &fomFileNames)
 Sorts the list of FOM file names once FOM dependency values have been mapped. More...
 

Protected Types

typedef std::pair< int, DtStringDtCompFomPair
 
typedef std::pair< DtString, intDtFomCompPair
 
typedef std::pair< DtString,
std::vector< DtString > > 
DtFomDepsPair
 
typedef std::multimap< int,
DtString
DtDependencyToFomMMap
 
typedef std::map< DtString, intDtFomToDependencyMap
 
typedef std::map< DtString,
DtFomDepsPair
DtFileToDepsPairMap
 
typedef std::map< DtString,
DtString
DtFomToFileMap
 

Protected Member Functions

virtual int mapFomDepedency (const DtString &fomName, std::set< DtString > &visitedFoms)
 Determine the FOM dependency value (depth) for the given FOM based on a recursive traverse of its depedencies. More...
 
virtual void mapFomDepedencies ()
 Map the FOM dependency values for the collected FOM modules. More...
 
virtual const DtStringfileNameFromFomName (const DtString &fomName) const
 Return the FOM file name given the FOM name (identification) More...
 
virtual const DtStringfomNameFromFileName (const DtString &fomFileName) const
 Return the FOM name (identification) given the FOM file name. More...
 
virtual void addFomDependencyMapping (int dependencyValue, const DtString &fomName)
 Add a mapping between a FOM and its dependency value. More...
 
virtual void fixDuplicateFomNames ()
 Fix cases where 2 or more FOMs have same name (identification) More...
 
virtual DtStringmakeUniqueFomName (DtString &fomName)
 Checks if given FOM name is already known and makes it unique if so. More...
 

Protected Attributes

DtDependencyToFomMMap myDependencyToFomMMap
 
DtFomToDependencyMap myFomToDependencyMap
 
DtFileToDepsPairMap myFileToDepsPairMap
 
DtFileToDepsPairMap myFileToDupDepsPairMap
 
DtFomToFileMap myFomToFileMap
 
const DtString myEmptyName
 
bool myMappingUpated
 

Detailed Description

This class facilitates FOM file sorting based on FOM dependencies.

The sorting of file names helps prevent conflicts when FOMs are merged. FOM filenames are added along with their FOM identification and list of dependencies (as FOM identifications). After all the required FOMs have been added, the dependency information is processed to give each FOM a dependency depth value. A base FOM without any dependencies is given a value of 0. FOMs with dependencies are given a value of 1 greater than the value of its largest dependency. FOMs are then sorted by their dependency value with the order of FOMs with equal values being arbitrary.

Member Typedef Documentation

typedef std::pair< int, DtString > DtFomSorter::DtCompFomPair
protected
typedef std::multimap< int, DtString > DtFomSorter::DtDependencyToFomMMap
protected
typedef std::pair< DtString, int > DtFomSorter::DtFomCompPair
protected
typedef std::pair< DtString, std::vector<DtString> > DtFomSorter::DtFomDepsPair
protected
typedef std::map< DtString, int > DtFomSorter::DtFomToDependencyMap
protected
typedef std::map< DtString, DtString > DtFomSorter::DtFomToFileMap
protected

Constructor & Destructor Documentation

DtFomSorter::DtFomSorter ( )

Constructor.

virtual DtFomSorter::~DtFomSorter ( )
virtual

Destructor.

Member Function Documentation

virtual void DtFomSorter::addFom ( const DtString fomFileName,
const DtString fomIdentifcation,
const std::vector< DtString > &  depedencies 
)
virtual

Add the given fom file name, its identification and its depedencies A mapping between the file name and ID/dependencies is created and replaces any mapping the already exists.

virtual void DtFomSorter::addFomDependencyMapping ( int  dependencyValue,
const DtString fomName 
)
protectedvirtual

Add a mapping between a FOM and its dependency value.

virtual void DtFomSorter::clear ( )
virtual

Clear the FOMs and supporting data to start again.

virtual const DtString& DtFomSorter::fileNameFromFomName ( const DtString fomName) const
protectedvirtual

Return the FOM file name given the FOM name (identification)

virtual void DtFomSorter::fixDuplicateFomNames ( )
protectedvirtual

Fix cases where 2 or more FOMs have same name (identification)

virtual const DtString& DtFomSorter::fomNameFromFileName ( const DtString fomFileName) const
protectedvirtual

Return the FOM name (identification) given the FOM file name.

virtual void DtFomSorter::getSortedFomFileNames ( std::vector< DtString > &  fomFileNames)
virtual

Sorts the list of FOM file names once FOM dependency values have been mapped.

virtual DtString& DtFomSorter::makeUniqueFomName ( DtString fomName)
protectedvirtual

Checks if given FOM name is already known and makes it unique if so.

Changes name if necessary and returns it.

virtual void DtFomSorter::mapFomDepedencies ( )
protectedvirtual

Map the FOM dependency values for the collected FOM modules.

virtual int DtFomSorter::mapFomDepedency ( const DtString fomName,
std::set< DtString > &  visitedFoms 
)
protectedvirtual

Determine the FOM dependency value (depth) for the given FOM based on a recursive traverse of its depedencies.

The list of visited FOMS is used to detect circular dependencies (contains the FOMs that have been traversed to get to the given FOM not including the given FOM).

Member Data Documentation

DtDependencyToFomMMap DtFomSorter::myDependencyToFomMMap
protected
const DtString DtFomSorter::myEmptyName
protected
DtFileToDepsPairMap DtFomSorter::myFileToDepsPairMap
protected
DtFileToDepsPairMap DtFomSorter::myFileToDupDepsPairMap
protected
DtFomToDependencyMap DtFomSorter::myFomToDependencyMap
protected
DtFomToFileMap DtFomSorter::myFomToFileMap
protected
bool DtFomSorter::myMappingUpated
protected

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)