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

Common functionality for a checkpoint manager, Will not present any dialogs to the user via this class. Use the DtVrfCheckpointManager for that.

Inheritance diagram for makVrf::DtVrfCheckpointManager:
Inheritance graph
[legend]

Classes

struct  AvailableSnapshot
 

Public Types

typedef std::map< double,
AvailableSnapshot > 
AvailableSnapshots
 

Public Member Functions

 DtVrfCheckpointManager (makVrv::DtDe &)
 
virtual ~DtVrfCheckpointManager () override
 
virtual void requestSnapshots (const DtSimulationAddress &addr=DtSimSendToAll)
 
virtual void schedulePeriodicSnapshoting (bool enabled, double simTime, int numberOfSnapshotsToKeep, bool enableCheckpoints, double checkpointTime)
 
virtual void processSnapshotsResponse (DtSimMessage *)
 
virtual bool rollbackTo (double simTime=-1)
 
virtual bool haveSnapshotsThatCanBeRolledBack () const
 
virtual void clearSnapshots ()
 
virtual bool saveScenarios (const std::set< double > &)
 
virtual bool saveScenario (double)
 
virtual bool saveScenario (const DtString &scenarioName, const DtString &runId, double simTime, DtFilename &scenarioFile)
 
virtual bool saveScenarios ()
 
virtual bool takeSnapshot (bool force=false)
 
virtual bool takeBaseSnapshot ()
 
virtual bool snapshotFor (double simTime, AvailableSnapshot &) const
 
virtual bool hasBaseSnapshot (double simTime=-1) const
 
virtual bool hasSnapshot (double simTime) const
 
virtual bool hasFixedSnapshot (double simTime) const
 
virtual bool hasPeriodicSnapshot (double simTime) const
 
virtual bool hasSavedScenarioForSnapshot (double simTime) const
 
virtual bool hasUnaskedUnsavedSavedScenarioForSnapshot (double simTime) const
 
virtual bool isSavingScenarios () const
 
virtual void setAskedToSaveAtThisSimTime (double simTime, bool)
 
const std::set< double > & periodicSnapshots () const
 
const std::set< double > & scheduledToSave () const
 
const AvailableSnapshots & availableSnapshots () const
 
virtual DtFilename scenarioNameForCheckpoint (double) const
 
virtual double round (double simTime) const
 
virtual void setScenarioAsSaved (const DtFilename &)
 
virtual void clearAllSnapshots ()
 
virtual double firstLoadableSimTime () const
 
virtual double baseSnapshotTime () const
 
virtual void updateSnapshotsSavedStatus ()
 
DtScenarioSnapshotsWidget * scenarioSnapshotsWidget ()
 
virtual void scenarioSnapshots ()
 
virtual void deleteCheckpoints ()
 
virtual void slot_settingReceived (const std::string &setting, const DtVrfBackendState *state)
 
virtual void requestPeriodicCheckpointSettings ()
 
virtual const
DtPeriodicSnapshotSettings * 
currentSettings () const
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 
virtual ~DtVirtualBaseClass ()
 

Static Public Member Functions

static DtVrfCheckpointManager & instance (makVrv::DtDe &de)
 
static void init (makVrv::DtDe &)
 

Public Attributes

boost::signals2::signal< void(const
AvailableSnapshots &, const
AvailableSnapshots &)> 
signal_snapshotsChanged
 
boost::signals2::signal< void()> signal_snapshotsCleared
 
boost::signals2::signal< void(double)> signal_savedScenario
 
boost::signals2::signal< void(const
std::set< double > &, const
std::set< double > &)> 
signal_saveStateChanged
 
boost::signals2::signal< void(const
DtPeriodicSnapshotSettings *)> 
signal_settingsReceived
 
boost::signals2::signal< void(const
std::set< double > &)> 
signal_savedScenariosCleared
 
boost::signals2::signal< void(const
std::set< double > &)> 
signal_savingCheckpoints
 
boost::signals2::signal< void(double,
double)> 
signal_baseScenarioSnapshotTimeChanged
 
boost::signals2::signal< void(const
DtFilename &)> 
signal_checkpointSaved
 

Protected Types

typedef std::map< double, int > BackendSnapshot
 
typedef std::map< std::string,
BackendSnapshot > 
SnapshotIdsByBackend
 

Protected Slots

virtual void scenarioSnapshotsWidgetDestroyed ()
 

Protected Member Functions

virtual bool scenarioExists (double simTime, DtFilename *foundFile=0) const
 
virtual void slot_backendRemoved (const DtVrfBackendState &)
 
virtual void removeBackend (const std::string &addr, bool sendMessage)
 
virtual void mergeBackendSnapshots (const std::string &addr, const DtIfSnapshotsResponse::SnapshotStatus &)
 
virtual double removeSnapshot (const std::string &addr, double snapshotTime)
 
virtual double addSnapshot (const std::string &addr, const DtIfSnapshotsResponse::Snapshot &, const std::set< std::string > &otherBes, std::set< std::string > &stillUnavailable)
 
virtual void processScenarioSnapshotSaved (DtSimMessage *)
 
virtual DtScenarioSnapshotsWidget * createScenarioSnapshotsWidget (QWidget *p, const Qt::WindowFlags &f)
 
virtual void doPendingWaitWork ()
 

Protected Attributes

makVrv::DtDe & myDe
 
AvailableSnapshots myAvailableSnapshots
 
makVrv::DtSignalConnectionManager myConnections
 
SnapshotIdsByBackend mySnapshotIdsByBackend
 
std::set< double > myPeriodicSnapshots
 
std::set< double > myScheduledToSave
 
std::set< double > mySnapshotsThatCanBeRolledBackTo
 
double myBaseSnapshotTime
 
std::map< std::string, bool > myHasBaseSnapshot
 
int myPeriodicCounter
 
DtScenarioSnapshotsWidget * myScenarioSnapshotsWidget
 
std::set< DtFilename > myWaitingForFiles
 
boost::signals2::connection myWaitingConnection
 

Member Typedef Documentation

Constructor & Destructor Documentation

makVrf::DtVrfCheckpointManager::DtVrfCheckpointManager ( makVrv::DtDe &  )
virtual makVrf::DtVrfCheckpointManager::~DtVrfCheckpointManager ( )
overridevirtual

Member Function Documentation

static DtVrfCheckpointManager& makVrf::DtVrfCheckpointManager::instance ( makVrv::DtDe &  de)
static

Returns instance of the messager.

static void makVrf::DtVrfCheckpointManager::init ( makVrv::DtDe &  )
static
virtual void makVrf::DtVrfCheckpointManager::requestSnapshots ( const DtSimulationAddress &  addr = DtSimSendToAll)
virtual

Requests snapshots from specified back-end. Request will clear out current map (if DtSimSendToAll) and replace with new information.

virtual void makVrf::DtVrfCheckpointManager::schedulePeriodicSnapshoting ( bool  enabled,
double  simTime,
int  numberOfSnapshotsToKeep,
bool  enableCheckpoints,
double  checkpointTime 
)
virtual

Enables/disables periodic snapshoting at the specified time interval and save window (in number of snapshots, 0 means all)

virtual void makVrf::DtVrfCheckpointManager::processSnapshotsResponse ( DtSimMessage *  )
virtual
virtual bool makVrf::DtVrfCheckpointManager::rollbackTo ( double  simTime = -1)
virtual

Rolls back to given snapshot, or, if snapshot is -1, last snapshot. Returns true if snapshot exists.

virtual bool makVrf::DtVrfCheckpointManager::haveSnapshotsThatCanBeRolledBack ( ) const
virtual

Returns true if there are any snapshots that can be rolled back to.

virtual void makVrf::DtVrfCheckpointManager::clearSnapshots ( )
virtual

Signals to clear out all snapshots.

virtual bool makVrf::DtVrfCheckpointManager::saveScenarios ( const std::set< double > &  )
virtual

Given a list of sim times to save as an on disk checkpoint, send a message to queue them up to be saved.

virtual bool makVrf::DtVrfCheckpointManager::saveScenario ( double  )
virtual
virtual bool makVrf::DtVrfCheckpointManager::saveScenario ( const DtString &  scenarioName,
const DtString &  runId,
double  simTime,
DtFilename &  scenarioFile 
)
virtual

This will tell the back-ends (that are available) to save the checkpoint that is on disk in each of the back-ends to this front-end.

virtual bool makVrf::DtVrfCheckpointManager::saveScenarios ( )
virtual

Saves all snapshots for currently unsaved snapshot states.

virtual bool makVrf::DtVrfCheckpointManager::takeSnapshot ( bool  force = false)
virtual

Creates a snapshot at the current sim clock time and returns whether or not this scenario is saved on disk. If there is already a snapshot do not send snapshot again unless force is true.

virtual bool makVrf::DtVrfCheckpointManager::takeBaseSnapshot ( )
virtual

Makes this snapshot the new base snapshot.

virtual bool makVrf::DtVrfCheckpointManager::snapshotFor ( double  simTime,
AvailableSnapshot &   
) const
virtual

Returns the available snapshot (if exists) at sim time.

virtual bool makVrf::DtVrfCheckpointManager::hasBaseSnapshot ( double  simTime = -1) const
virtual

Returns true if has a base snapshot at sim time. If sim time is -1, looks for any base snapshot.

virtual bool makVrf::DtVrfCheckpointManager::hasSnapshot ( double  simTime) const
virtual

Returns true if there is a snapshot at the specified sim time.

virtual bool makVrf::DtVrfCheckpointManager::hasFixedSnapshot ( double  simTime) const
virtual

Returns true if there is a non periodic snapshot at the given sim time.

virtual bool makVrf::DtVrfCheckpointManager::hasPeriodicSnapshot ( double  simTime) const
virtual

Returns true if there is a periodic snapshot at the given sim time.

virtual bool makVrf::DtVrfCheckpointManager::hasSavedScenarioForSnapshot ( double  simTime) const
virtual

Returns true if the snapshot at the sim time has been saved.

virtual bool makVrf::DtVrfCheckpointManager::hasUnaskedUnsavedSavedScenarioForSnapshot ( double  simTime) const
virtual

Has an unasked unsaved snapshot at the given sim time.

virtual bool makVrf::DtVrfCheckpointManager::isSavingScenarios ( ) const
virtual

Returns true if there are items scheduled to save.

virtual void makVrf::DtVrfCheckpointManager::setAskedToSaveAtThisSimTime ( double  simTime,
bool   
)
virtual

Sets whether or not the given sim time has been asked to save.

const std::set<double>& makVrf::DtVrfCheckpointManager::periodicSnapshots ( ) const
inline
const std::set<double>& makVrf::DtVrfCheckpointManager::scheduledToSave ( ) const
inline
const AvailableSnapshots& makVrf::DtVrfCheckpointManager::availableSnapshots ( ) const
inline
virtual DtFilename makVrf::DtVrfCheckpointManager::scenarioNameForCheckpoint ( double  ) const
virtual

If saved, returns the scenario filename at the given checkpoint time.

virtual double makVrf::DtVrfCheckpointManager::round ( double  simTime) const
virtual

Convert sim time to a time that can be snapshoted to.

virtual void makVrf::DtVrfCheckpointManager::setScenarioAsSaved ( const DtFilename &  )
virtual

If there is a snapshot at the sim time of this scenario, set it as saved.

virtual void makVrf::DtVrfCheckpointManager::clearAllSnapshots ( )
virtual

Sends message to clear all snapshots from all back-ends.

virtual double makVrf::DtVrfCheckpointManager::firstLoadableSimTime ( ) const
virtual

Returns the first loadable sim time (or -1 if no time available);.

virtual double makVrf::DtVrfCheckpointManager::baseSnapshotTime ( ) const
inlinevirtual

The time that will be shown as the "base" snapshot (the snapshot that when rewinding to beginning will set to)

virtual void makVrf::DtVrfCheckpointManager::updateSnapshotsSavedStatus ( )
virtual

Goes through all snapshots and updates their saved status. Any that have changed will be signalled out as added/removed from save.

DtScenarioSnapshotsWidget* makVrf::DtVrfCheckpointManager::scenarioSnapshotsWidget ( )
inline
virtual void makVrf::DtVrfCheckpointManager::scenarioSnapshots ( )
virtual

Displays a dialog that allows user to see scenario snapshots.

virtual void makVrf::DtVrfCheckpointManager::deleteCheckpoints ( )
virtual

Displays a dialog that allows user to delete checkpoints in current scenario directory.

virtual void makVrf::DtVrfCheckpointManager::slot_settingReceived ( const std::string &  setting,
const DtVrfBackendState *  state 
)
virtual
virtual void makVrf::DtVrfCheckpointManager::requestPeriodicCheckpointSettings ( )
virtual
virtual const DtPeriodicSnapshotSettings* makVrf::DtVrfCheckpointManager::currentSettings ( ) const
virtual

Looks at the first back-end to see what the periodic checkpoint settings are and hope they are up to date.

virtual void makVrf::DtVrfCheckpointManager::scenarioSnapshotsWidgetDestroyed ( )
protectedvirtualslot
virtual bool makVrf::DtVrfCheckpointManager::scenarioExists ( double  simTime,
DtFilename *  foundFile = 0 
) const
protectedvirtual

Returns true if there is a scenario (with the current scenario name) in the userData directory with the given scenario name.

virtual void makVrf::DtVrfCheckpointManager::slot_backendRemoved ( const DtVrfBackendState &  )
protectedvirtual
virtual void makVrf::DtVrfCheckpointManager::removeBackend ( const std::string &  addr,
bool  sendMessage 
)
protectedvirtual
virtual void makVrf::DtVrfCheckpointManager::mergeBackendSnapshots ( const std::string &  addr,
const DtIfSnapshotsResponse::SnapshotStatus &   
)
protectedvirtual
virtual double makVrf::DtVrfCheckpointManager::removeSnapshot ( const std::string &  addr,
double  snapshotTime 
)
protectedvirtual
virtual double makVrf::DtVrfCheckpointManager::addSnapshot ( const std::string &  addr,
const DtIfSnapshotsResponse::Snapshot &  ,
const std::set< std::string > &  otherBes,
std::set< std::string > &  stillUnavailable 
)
protectedvirtual
virtual void makVrf::DtVrfCheckpointManager::processScenarioSnapshotSaved ( DtSimMessage *  )
protectedvirtual
virtual DtScenarioSnapshotsWidget* makVrf::DtVrfCheckpointManager::createScenarioSnapshotsWidget ( QWidget *  p,
const Qt::WindowFlags &  f 
)
protectedvirtual
virtual void makVrf::DtVrfCheckpointManager::doPendingWaitWork ( )
protectedvirtual

Member Data Documentation

boost::signals2::signal<void(const AvailableSnapshots&, const AvailableSnapshots&)> makVrf::DtVrfCheckpointManager::signal_snapshotsChanged

Signal sent when snapshots have changed. First parameter is those added, second is removed.

boost::signals2::signal<void()> makVrf::DtVrfCheckpointManager::signal_snapshotsCleared
boost::signals2::signal<void (double)> makVrf::DtVrfCheckpointManager::signal_savedScenario
boost::signals2::signal<void (const std::set<double>&, const std::set<double>&)> makVrf::DtVrfCheckpointManager::signal_saveStateChanged
boost::signals2::signal<void (const DtPeriodicSnapshotSettings*)> makVrf::DtVrfCheckpointManager::signal_settingsReceived
boost::signals2::signal<void (const std::set<double>&)> makVrf::DtVrfCheckpointManager::signal_savedScenariosCleared

Signal sent when snapshots to be saved are cleared for saving.

boost::signals2::signal<void (const std::set<double>&)> makVrf::DtVrfCheckpointManager::signal_savingCheckpoints
boost::signals2::signal<void (double, double)> makVrf::DtVrfCheckpointManager::signal_baseScenarioSnapshotTimeChanged
boost::signals2::signal<void (const DtFilename&)> makVrf::DtVrfCheckpointManager::signal_checkpointSaved
makVrv::DtDe& makVrf::DtVrfCheckpointManager::myDe
protected
AvailableSnapshots makVrf::DtVrfCheckpointManager::myAvailableSnapshots
protected
makVrv::DtSignalConnectionManager makVrf::DtVrfCheckpointManager::myConnections
protected
SnapshotIdsByBackend makVrf::DtVrfCheckpointManager::mySnapshotIdsByBackend
protected
std::set<double> makVrf::DtVrfCheckpointManager::myPeriodicSnapshots
protected
std::set<double> makVrf::DtVrfCheckpointManager::myScheduledToSave
protected
std::set<double> makVrf::DtVrfCheckpointManager::mySnapshotsThatCanBeRolledBackTo
protected
double makVrf::DtVrfCheckpointManager::myBaseSnapshotTime
protected
std::map<std::string, bool> makVrf::DtVrfCheckpointManager::myHasBaseSnapshot
protected
int makVrf::DtVrfCheckpointManager::myPeriodicCounter
protected
DtScenarioSnapshotsWidget* makVrf::DtVrfCheckpointManager::myScenarioSnapshotsWidget
protected
std::set<DtFilename> makVrf::DtVrfCheckpointManager::myWaitingForFiles
protected
boost::signals2::connection makVrf::DtVrfCheckpointManager::myWaitingConnection
protected

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

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)