19 #include <vlpi/simulationAddress.h>
23 #include <boost/unordered_map.hpp>
35 #ifdef DtObjectDebugger_Enable
47 typedef std::vector<std::string*>
OOB;
78 virtual void setSimTime(
double);
81 virtual void setSnapshotsEnabled(
bool flag);
82 virtual bool snapshotsEnabled()
const;
85 virtual void setSnapshotPeriod(
double period);
86 virtual double snapshotPeriod()
const;
89 virtual void setCheckpointPeriod(
double period);
90 virtual double checkpointPeriod()
const;
93 virtual void setNumberOfSnapshotsToKeep(
int);
94 virtual int numberOfSnapshotsToKeep()
const;
98 virtual void setPauseCleanup(
bool);
101 virtual void clear(
bool allButBase =
false);
108 virtual bool findScenarioFragment(
const DtString& scenarioName,
const DtString& runId,
double simTime,
DtScenario& scenario)
const;
118 virtual void rollbackToSimTime(
double simTime);
124 virtual void clearOutStaleSnapshots();
130 virtual void setSnapshotHeartbeatTime(
double d);
131 virtual double snapshotHeartbeatTime()
const;
133 virtual void setCheckpointsEnabled(
bool);
134 virtual bool checkpointsEnabled()
const;
137 virtual void sendCurrentSnapshots();
142 const DtScenario* currentScenario,
const DtSimulationAddress& requestor);
149 virtual void removeSnapshotsAfter(
double simTime);
152 virtual bool hasSnapshots()
const;
155 virtual void clearAllSnapshots();
162 virtual unsigned int numberOfSaveJobsQueued()
const;
163 virtual unsigned int maxQueuedSaveJobsBeforeSkip()
const;
166 virtual void setMaxQueuedSaveJobsBeforeSkip(
unsigned int);
170 static void clearAllSnapshotsCallback(
DtSimMessage*,
void*);
172 static void settingConsumerCallback(
176 static void checkpointOperationCallback(
DtSimMessage*,
void*);
182 static void requestCheckpointFiles(
DtSimMessage*,
void*);
183 virtual void processCheckpointFilesRequest(
DtSimMessage*);
189 virtual void finishSavingSnapshots();
194 virtual void deleteCheckpoint(
const DtString& scenarioName,
const DtString& runId,
double simTime);
198 virtual void setMetaDataToCheckpoint(
const DtString& scenarioName,
const DtString& runId,
const std::map<DtString, DtString>& displayName);
202 virtual void checkpointCount(
const DtString& scenarioName,
const DtString& runId,
unsigned long requestId);
205 virtual void sendCheckpointRun(
unsigned long);
207 virtual DtFilename scenarioFilenameFromScenario(
const DtScenario& scenario)
const;
208 virtual DtFilename strippedPath(
const DtFilename& fullName)
const;
217 virtual void run()
override;
227 virtual bool writeAndSendOrderOfBattleFile();
228 virtual bool writeAndSendPlanFile();
229 virtual bool writeAndSendScenarioExtrasFile();
230 virtual bool writeAndSendScenarioScriptsFile();
231 virtual bool writeAndSendOrbatFile();
239 virtual void run()
override;
243 virtual void writeReadmeTo(
const DtFilename&)
const;
244 virtual void createFragmentDirectory(DtFilename& root, DtFilename& scenario);
282 int myMaxQueuedSaveJobsBeforeSkip = 10;
UUID is a unique ID wrapper class.
Definition: uuid.h:59
std::map< int, DtInMemorySnapshotPtr > Snapshots
Definition: snapshotManager.h:262
DtInMemorySnapshotPtr mySnapshot
Definition: snapshotManager.h:248
DtCgf * cgf() const
Definition: snapshotManager.h:157
DtSimulationServices * myServices
Definition: snapshotManager.h:247
DtScenario myScenarioInformation
Definition: snapshotManager.h:53
int myLastCheckpointStep
Definition: snapshotManager.h:281
std::string myOrbat
Definition: snapshotManager.h:52
Definition: snapshotManager.h:234
DtVrfCallbackQueue * myFileWriterJobQueue
Definition: snapshotManager.h:275
double mySnapshotHeartbeatTime
Definition: snapshotManager.h:257
std::string myPlans
Definition: snapshotManager.h:49
Structure holds a complete single-backend snapshot state in memory.
Definition: snapshotManager.h:34
Definition: scenario.h:52
int myLastSnapshotStep
Definition: snapshotManager.h:260
int myNextSnapshotId
Definition: snapshotManager.h:259
double mySnapshotPeriod
Definition: snapshotManager.h:255
class DtIfSaveScenario:
Definition: ifSaveScenario.h:23
double myLastSnapshotHeartbeat
Definition: snapshotManager.h:256
Snapshots mySnapshots
Definition: snapshotManager.h:263
#define DT_DEFINE_OBJECT_DEBUGGER_NAME(type)
Definition: objectCounter.h:31
Default on in debug, off in release.
Definition: objectCounter.h:27
bool mySuccess
Definition: snapshotManager.h:223
Simple asynchronous callback queue.
Definition: vrfCallbackQueue.h:31
Contains the DtUUID class declaration.
OOB myOob
Definition: snapshotManager.h:48
Definition: settingsObject.h:27
DtSnapshotManager * myManager
Definition: snapshotManager.h:249
int myNumberOfSnapshotsToKeep
Definition: snapshotManager.h:258
int myId
Definition: snapshotManager.h:43
bool mySnapshotsModified
Definition: snapshotManager.h:266
std::vector< std::string * > OOB
Definition: snapshotManager.h:47
DtIfSnapshotsResponse myCurrentSnapshots
Definition: snapshotManager.h:268
static const DtUUID & nullUUID()
bool myCheckpointsEnabled
Definition: snapshotManager.h:279
API for writing callbacks.
Definition: vrfCallbackQueue.h:57
bool myPauseCleanup
Definition: snapshotManager.h:270
std::string myScenarioExtras
Definition: snapshotManager.h:50
std::shared_ptr< DtInMemorySnapshot > DtInMemorySnapshotPtr
Definition: snapshotManager.h:56
DtCompressedFileTransporter & myTransporter
Definition: snapshotManager.h:222
class DtIfSnapshotsResponse:
Definition: ifSnapshotsResponse.h:25
std::string myScenarioScripts
Definition: snapshotManager.h:51
File: simMsg.h.
Definition: simMessage.h:35
double myCheckpointPeriod
Definition: snapshotManager.h:280
bool myStarted
Definition: snapshotManager.h:224
Definition: snapshotManager.h:211
SavingSnapshots myCheckpointing
Definition: snapshotManager.h:273
Definition: compressedFileTransporter.h:24
system includes
Definition: consoleCommandManager.h:28
DtCgf * myCgf
Definition: snapshotManager.h:253
std::map< int, DtVrfCallbackQueue::CallbackInterface::Ptr > SavingSnapshots
Definition: snapshotManager.h:272
double mySimTime
Definition: snapshotManager.h:44
DtInMemorySnapshot()
Definition: snapshotManager.h:39
bool pauseCleanup() const
Definition: snapshotManager.h:99
DtConsoleCommand * myCheckpointCommand
Definition: snapshotManager.h:277
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:97
DtIfSaveScenario mySaveMessage
Definition: snapshotManager.h:220
DtVrfCallbackQueue * myScenarioSaveJobQueue
Definition: snapshotManager.h:278
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
DtSimulationAddress myRequestor
Definition: snapshotManager.h:219
bool myIsPeriodic
Definition: snapshotManager.h:45
DtInMemorySnapshotPtr mySnapshot
Definition: snapshotManager.h:221
Definition: snapshotManager.h:60
bool myPeriodicSnapshotsEnabled
Definition: snapshotManager.h:254
DtConsoleCommand * mySnapshotCommand
Definition: snapshotManager.h:276
The top level class of a VR-Forces Simulation Engine, representing a Computer Generated Forces instan...
Definition: cgf.h:157
#define DT_DLL_vrfcgf
This file is used to determine how to build.
Definition: vrfcgfDefines.h:25
Snapshots myPeriodicSnapshots
Definition: snapshotManager.h:264
Periodic snapshot settings are used to keep track of whether or not periodic snapshots are enabled an...
Definition: periodicSnapshotSettings.h:28