VR-Forces 4.0.4 Class Documentation
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
DtVrfConfigurationFileComposer Class Reference

Instances of this class split up config files. More...

List of all members.

Public Member Functions

 DtVrfConfigurationFileComposer ()
 Constructor.
virtual ~DtVrfConfigurationFileComposer ()
 Destructor.
virtual bool init ()
 initializes myObjectMap and myBackendMap
virtual bool readObjectMap (DtFilename objectMap)
 Reads the given object map into myObjectMap.
virtual const DtList & scenarioBackends () const
 Get a list of backends referenced in myObjectMap.
virtual DtBackendMapbackendMap ()
 returns myBackendMap
virtual DtAddressMapobjectMap ()
 returns myObjectMap
virtual bool composeOrderOfBattleFile (const DtFilename &targetFileName, const DtList &files)
 Concatenates all the order of battles files pointed to in the files DtList into one single file named targetFileName.
virtual bool composePlanFile (const DtFilename &targetFileName, const DtList &files)
 Concatenates all the plan files pointed to in the files DtList into one single file named targetFileName.
virtual bool composeGlobalPlanFile (const DtFilename &targetFileName, const DtList &files)
 Concatenates all the global plan files pointed to in the files DtList into one single file named targetFileName.
virtual bool composeHostilityFile (const DtFilename &targetFileName, const DtList &files)
 Concatenates all the force hostility files pointed to in the files DtList into one single file named targetFileName.
virtual bool composeScenarioExtrasFile (const DtFilename &targetFileName, const DtList &files)
 Concatenates all the force scenario-extras files pointed to in the files DtList into one single file named targetFileName.
virtual bool createMapFile (const DtFilename &targetFileName, const DtList &simAddresses, const DtList &oobFiles, const DtList &planFiles, const DtList &globalPlanFiles, bool preserveMappings=true)
 Creates a map file named targetFileName.
std::vector< DtFilename > & customComponentAttachmentFilenames ()
const std::vector< DtFilename > & customComponentAttachmentFilenames () const
virtual bool decompose (const DtFilename &orderOfBattle, const DtFilename &plan, const DtFilename &globalPlan)
 Decompose the given .oob and .pln files into separate files for each back-end based on the omp file.
virtual bool decomposeComponentAttachmentFile (const DtFilename &originalFile, unsigned numBackends)
 Split the indicated component attachment file into separate temporary files, for distribution during scenario load.
virtual const DtFilename & getComponentAttachmentFile (unsigned idx) const
 Get the componentAttachmentFile for a given back end, by index.
virtual const DtFilename & tempDirectory ()
 Set/Get the temp directory where generated file names will get stored.
virtual void setTempDirectory (const DtFilename &f)
virtual DtFilename * getOrderOfBattleFile (const DtSimulationAddress &addr) const
 Get a configuration file for the given simulation address.
virtual DtFilename * getPlanFile (const DtSimulationAddress &addr) const
 Get a configuration file for the given simulation address.
virtual DtFilename * getGlobalPlanFile (const DtSimulationAddress &addr) const
 Get a configuration file for the given simulation address.

Protected Member Functions

virtual void clear ()
virtual bool createBackendFiles (const DtFilename &origFileName, DtHashList &createdFiles, const char *prefix="(\n")
virtual bool composePlanFileBody (FILE *fp, const DtList &files)
 Applicable to both global and entity plans.

Protected Attributes

DtBackendMapmyBackendMap
DtAddressMapmyObjectMap
DtAddressMapmyOriginalObjectMap
DtVrfFileParser myParser
DtHashlist myAddr2FileMap
DtHashlist myCreatedPlnFiles
DtHashlist myCreatedOobFiles
DtHashlist myCreatedGlobalPlanFiles
DtHashlist myCreatedHostilityFiles
std::vector< DtFilename > myCreatedComponentAttachmentFiles
DtFilename myTempDirectory
DtList myRequiredBackendAddrs

Static Protected Attributes

static const char theUnknownMappingName []
 The name used to create a mapping which indicates there is map data missing.

Detailed Description

Instances of this class split up config files.


Constructor & Destructor Documentation

Constructor.

Destructor.


Member Function Documentation

initializes myObjectMap and myBackendMap

virtual bool DtVrfConfigurationFileComposer::readObjectMap ( DtFilename  objectMap) [virtual]

Reads the given object map into myObjectMap.

virtual const DtList& DtVrfConfigurationFileComposer::scenarioBackends ( ) const [virtual]

Get a list of backends referenced in myObjectMap.

Be sure to call readObjectMap() to initialize the map before calling this function.

returns myBackendMap

returns myObjectMap

virtual bool DtVrfConfigurationFileComposer::composeOrderOfBattleFile ( const DtFilename &  targetFileName,
const DtList &  files 
) [virtual]

Concatenates all the order of battles files pointed to in the files DtList into one single file named targetFileName.

virtual bool DtVrfConfigurationFileComposer::composePlanFile ( const DtFilename &  targetFileName,
const DtList &  files 
) [virtual]

Concatenates all the plan files pointed to in the files DtList into one single file named targetFileName.

virtual bool DtVrfConfigurationFileComposer::composeGlobalPlanFile ( const DtFilename &  targetFileName,
const DtList &  files 
) [virtual]

Concatenates all the global plan files pointed to in the files DtList into one single file named targetFileName.

virtual bool DtVrfConfigurationFileComposer::composeHostilityFile ( const DtFilename &  targetFileName,
const DtList &  files 
) [virtual]

Concatenates all the force hostility files pointed to in the files DtList into one single file named targetFileName.

virtual bool DtVrfConfigurationFileComposer::composeScenarioExtrasFile ( const DtFilename &  targetFileName,
const DtList &  files 
) [virtual]

Concatenates all the force scenario-extras files pointed to in the files DtList into one single file named targetFileName.

virtual bool DtVrfConfigurationFileComposer::createMapFile ( const DtFilename &  targetFileName,
const DtList &  simAddresses,
const DtList &  oobFiles,
const DtList &  planFiles,
const DtList &  globalPlanFiles,
bool  preserveMappings = true 
) [virtual]

Creates a map file named targetFileName.

const std::vector< DtFilename > & DtVrfConfigurationFileComposer::customComponentAttachmentFilenames ( ) const [inline]
virtual bool DtVrfConfigurationFileComposer::decompose ( const DtFilename &  orderOfBattle,
const DtFilename &  plan,
const DtFilename &  globalPlan 
) [virtual]

Decompose the given .oob and .pln files into separate files for each back-end based on the omp file.

New files will be placed in the temporary directory specified by DtScenarioFileComposer::tempDirectory(). The names of the newly created files will be stored in hashlists which can be accessed later by getFiles() methods below. These lists will be cleared the next time decomposeScenario is called. Returns true upon success; false otherwise.

virtual bool DtVrfConfigurationFileComposer::decomposeComponentAttachmentFile ( const DtFilename &  originalFile,
unsigned  numBackends 
) [virtual]

Split the indicated component attachment file into separate temporary files, for distribution during scenario load.

virtual DtFilename* DtVrfConfigurationFileComposer::getOrderOfBattleFile ( const DtSimulationAddress &  addr) const [virtual]

Get a configuration file for the given simulation address.

virtual DtFilename* DtVrfConfigurationFileComposer::getPlanFile ( const DtSimulationAddress &  addr) const [virtual]

Get a configuration file for the given simulation address.

virtual DtFilename* DtVrfConfigurationFileComposer::getGlobalPlanFile ( const DtSimulationAddress &  addr) const [virtual]

Get a configuration file for the given simulation address.

virtual const DtFilename& DtVrfConfigurationFileComposer::getComponentAttachmentFile ( unsigned  idx) const [virtual]

Get the componentAttachmentFile for a given back end, by index.

virtual const DtFilename& DtVrfConfigurationFileComposer::tempDirectory ( ) [virtual]

Set/Get the temp directory where generated file names will get stored.

virtual void DtVrfConfigurationFileComposer::setTempDirectory ( const DtFilename &  f) [virtual]
virtual void DtVrfConfigurationFileComposer::clear ( ) [protected, virtual]
virtual bool DtVrfConfigurationFileComposer::createBackendFiles ( const DtFilename &  origFileName,
DtHashList &  createdFiles,
const char *  prefix = "(\n" 
) [protected, virtual]
virtual bool DtVrfConfigurationFileComposer::composePlanFileBody ( FILE *  fp,
const DtList &  files 
) [protected, virtual]

Applicable to both global and entity plans.

Concatenates the plan files together and writes them to the specified file.


Member Data Documentation

The name used to create a mapping which indicates there is map data missing.


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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)