VR-Forces 4.2 Class Documentation
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
DtVrfConfigurationFileComposer Class Reference

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

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 composeScenarioScriptsFile (const DtFilename &targetFileName, const DtString &files)
 Concatenates all the scenario script 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 decomposeScenarioScriptsFile (const DtFilename &)
 Decomposes the scenario script 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 * getScenarioScriptsFile (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
DtFilename * myScenarioScriptsFile

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

DtVrfConfigurationFileComposer::DtVrfConfigurationFileComposer ( )

Constructor.

virtual DtVrfConfigurationFileComposer::~DtVrfConfigurationFileComposer ( )
virtual

Destructor.

Member Function Documentation

virtual bool DtVrfConfigurationFileComposer::init ( )
virtual

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.

virtual DtBackendMap* DtVrfConfigurationFileComposer::backendMap ( )
virtual

returns myBackendMap

virtual DtAddressMap* DtVrfConfigurationFileComposer::objectMap ( )
virtual

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::composeScenarioScriptsFile ( const DtFilename &  targetFileName,
const DtString files 
)
virtual

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

Since there is only one scenario script file there will only be one file in the files list

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.

std::vector< DtFilename > & DtVrfConfigurationFileComposer::customComponentAttachmentFilenames ( )
inline
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::decomposeScenarioScriptsFile ( const DtFilename &  )
virtual

Decomposes the scenario script file.

Since there is only a single file this will simply create a file copy for each backend

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::getScenarioScriptsFile ( 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 ( )
protectedvirtual
virtual bool DtVrfConfigurationFileComposer::createBackendFiles ( const DtFilename &  origFileName,
DtHashList &  createdFiles,
const char *  prefix = "(\n" 
)
protectedvirtual
virtual bool DtVrfConfigurationFileComposer::composePlanFileBody ( FILE *  fp,
const DtList &  files 
)
protectedvirtual

Applicable to both global and entity plans.

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

Member Data Documentation

DtBackendMap* DtVrfConfigurationFileComposer::myBackendMap
protected
DtAddressMap* DtVrfConfigurationFileComposer::myObjectMap
protected
DtAddressMap* DtVrfConfigurationFileComposer::myOriginalObjectMap
protected
DtVrfFileParser DtVrfConfigurationFileComposer::myParser
protected
DtHashlist DtVrfConfigurationFileComposer::myAddr2FileMap
protected
DtHashlist DtVrfConfigurationFileComposer::myCreatedPlnFiles
protected
DtHashlist DtVrfConfigurationFileComposer::myCreatedOobFiles
protected
DtHashlist DtVrfConfigurationFileComposer::myCreatedGlobalPlanFiles
protected
DtHashlist DtVrfConfigurationFileComposer::myCreatedHostilityFiles
protected
std::vector<DtFilename> DtVrfConfigurationFileComposer::myCreatedComponentAttachmentFiles
protected
DtFilename DtVrfConfigurationFileComposer::myTempDirectory
protected
DtList DtVrfConfigurationFileComposer::myRequiredBackendAddrs
protected
DtFilename* DtVrfConfigurationFileComposer::myScenarioScriptsFile
protected
const char DtVrfConfigurationFileComposer::theUnknownMappingName[]
staticprotected

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 Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)