VR-Forces 4.6 Class Documentation
 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

The class that will contain information about the currently loaded scenario. More...

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

Classes

struct  AvailableSnapshot
 Organized by simulation time, the back-ends that will support resetting to that simulation time (and those that will not) More...

Public Types

typedef std::map< double,
AvailableSnapshot
AvailableSnapshots

Public Member Functions

 DtVrfCheckpointManager (makVrv::DtDe &)
virtual ~DtVrfCheckpointManager ()
virtual void deleteCheckpoints ()
 Displays a dialog that allows user to delete checkpoints in current scenario directory.
virtual void scenarioSnapshots ()
 Displays a dialog that allows user to see scenario snapshots.
virtual void requestSnapshots (const DtSimulationAddress &addr=DtSimSendToAll)
 Requests snapshots from specified back-end.
virtual void schedulePeriodicSnapshoting (bool enabled, double simTime, int numberOfSnapshotsToKeep)
 Enables/disables periodic snapshoting at the specified time interval and save window (in number of snapshots, 0 means all)
virtual void processSnapshotsResponse (DtSimMessage *)
DtScenarioSnapshotsWidgetscenarioSnapshotsWidget ()
virtual bool rollbackTo (double simTime=-1)
 Rolls back to given snapshot, or, if snapshot is -1, last snapshot. Returns true if snapshot exists.
virtual bool haveSnapshotsThatCanBeRolledBack () const
 Returns true if there are any snapshots that can be rolled back to.
virtual void clearSnapshots ()
 Signals to clear out all snapshots.
virtual bool saveCheckpoints (const std::set< double > &)
 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 saveCheckpoint (double)
virtual bool saveCheckpoints ()
 Saves all snapshots for currently unsaved snapshot states.
virtual bool takeSnapshot (bool force=false)
 Creates a snapshot at the current sim clock time and returns whether or not this scenario is saved on disk.
virtual bool takeBaseSnapshot ()
 Makes this snapshot the new base snapshot.
virtual bool snapshotFor (double simTime, AvailableSnapshot &) const
 Returns the available snapshot (if exists) at sim time.
virtual bool hasBaseSnapshot (double simTime=-1) const
 Returns true if has a base snapshot at sim time. If sim time is -1, looks for any base snapshot.
virtual bool hasSnapshot (double simTime) const
 Returns true if there is a snapshot at the specified sim time.
virtual bool hasFixedSnapshot (double simTime) const
 Returns true if there is a non periodic snapshot at the given sim time.
virtual bool hasPeriodicSnapshot (double simTime) const
 Returns true if there is a periodic snapshot at the given sim time.
virtual bool hasSavedScenarioForSnapshot (double simTime) const
 Returns true if the snapshot at the sim time has been saved.
virtual bool hasUnaskedUnsavedSavedScenarioForSnapshot (double simTime) const
 Has an unasked unsaved snapshot at the given sim time.
virtual bool isSavingCheckpoints () const
 Returns true if there are items scheduled to save.
virtual void setAskedToSaveAtThisSimTime (double simTime, bool)
 Sets whether or not the given sim time has been asked to save.
const std::set< double > & periodicSnapshots () const
const std::set< double > & scheduledToSave () const
const AvailableSnapshotsavailableSnapshots () const
virtual DtFilename scenarioNameForCheckpoint (double) const
 If saved, returns the scenario filename at the given checkpoint time.
virtual double round (double simTime) const
 Convert sim time to a time that can be snapshoted to.
virtual void setScenarioAsSaved (const DtFilename &)
 If there is a snapshot at the sim time of this scenario, set it as saved.
virtual void clearAllSnapshots ()
 Sends message to clear all snapshots from all back-ends.
virtual double firstLoadableSimTime () const
 Returns the first loadable sim time (or -1 if no time available);.
virtual double baseSnapshotTime () const
 The time that will be shown as the "base" snapshot (the snapshot that when rewinding to beginning will set to)
virtual void updateCheckpointsSavedStatus ()
 Goes through all checkpoints and updates their saved status.
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor.
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor.

Static Public Member Functions

static DtVrfCheckpointManagerinstance (makVrv::DtDe &de)
 Returns instance of the messager.

Public Attributes

boost::signal< void(const
AvailableSnapshots &, const
AvailableSnapshots &)> 
signal_snapshotsChanged
 Signal sent when snapshots have changed. First parameter is those added, second is removed.
boost::signal< void()> signal_snapshotsCleared
boost::signal< void(double)> signal_savedScenarioCheckpoint
boost::signal< void(const
std::set< double > &, const
std::set< double > &)> 
signal_saveStateChanged
boost::signal< void(const
std::set< double > &)> 
signal_savedCheckpointsCleared
 Signal sent when snapshots to be saved are cleared for saving.
boost::signal< void(const
std::set< double > &)> 
signal_savingCheckpoints
boost::signal< void(double,
double)> 
signal_baseScenarioSnapshotTimeChanged
boost::signal< void(double)> signal_aboutToRollBack

Protected Types

typedef std::map< double, intBackendSnapshot
typedef std::map< std::string,
BackendSnapshot
SnapshotIdsByBackend

Protected Slots

virtual void scenarioSnapshotsWidgetDestroyed ()

Protected Member Functions

virtual bool scenarioExists (double simTime, DtFilename *foundFile=0) const
 Returns true if there is a scenario (with the current scenario name) in the userData directory with the given scenario name.
virtual DtDeleteCheckpointsDialogcreateDeleteCheckpointsDialog (QWidget *p, const Qt::WindowFlags &f)
virtual DtScenarioSnapshotsWidgetcreateScenarioSnapshotsWidget (QWidget *p, const Qt::WindowFlags &f)
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 void checkNeedsPeriodicSave (const std::set< double > &)
 Checks to see if any if the items in this list can be sent for a periodic save, and, if does, save them.
virtual void updatePeriodicCheckpointFrequency (int periodicCheckpointFrequency)
virtual void simulationSettingsChanged ()

Protected Attributes

makVrv::DtDemyDe
AvailableSnapshots myAvailableSnapshots
makVrv::DtSignalConnectionManager myConnections
DtScenarioSnapshotsWidgetmyScenarioSnapshotsWidget
SnapshotIdsByBackend mySnapshotIdsByBackend
std::set< doublemyPeriodicSnapshots
std::set< doublemyScheduledToSave
std::set< doublemySnapshotsThatCanBeRolledBackTo
double myBaseSnapshotTime
std::map< std::string, boolmyHasBaseSnapshot
int myPeriodicCheckpointFrequency

Detailed Description

The class that will contain information about the currently loaded scenario.

Member Typedef Documentation

Constructor & Destructor Documentation

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

Member Function Documentation

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

Returns instance of the messager.

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

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

virtual void makVrf::DtVrfCheckpointManager::scenarioSnapshots ( )
virtual

Displays a dialog that allows user to see scenario snapshots.

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 
)
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
DtScenarioSnapshotsWidget* makVrf::DtVrfCheckpointManager::scenarioSnapshotsWidget ( )
inline
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::saveCheckpoints ( 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::saveCheckpoint ( double  )
virtual
virtual bool makVrf::DtVrfCheckpointManager::saveCheckpoints ( )
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::isSavingCheckpoints ( ) 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::updateCheckpointsSavedStatus ( )
virtual

Goes through all checkpoints and updates their saved status.

Any that have changed will be signalled out as added/removed from save

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 DtDeleteCheckpointsDialog* makVrf::DtVrfCheckpointManager::createDeleteCheckpointsDialog ( QWidget *  p,
const Qt::WindowFlags &  f 
)
protectedvirtual
virtual DtScenarioSnapshotsWidget* makVrf::DtVrfCheckpointManager::createScenarioSnapshotsWidget ( QWidget *  p,
const Qt::WindowFlags &  f 
)
protectedvirtual
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 void makVrf::DtVrfCheckpointManager::checkNeedsPeriodicSave ( const std::set< double > &  )
protectedvirtual

Checks to see if any if the items in this list can be sent for a periodic save, and, if does, save them.

virtual void makVrf::DtVrfCheckpointManager::updatePeriodicCheckpointFrequency ( int  periodicCheckpointFrequency)
protectedvirtual
virtual void makVrf::DtVrfCheckpointManager::simulationSettingsChanged ( )
protectedvirtual

Member Data Documentation

boost::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::signal<void()> makVrf::DtVrfCheckpointManager::signal_snapshotsCleared
boost::signal<void (double)> makVrf::DtVrfCheckpointManager::signal_savedScenarioCheckpoint
boost::signal<void (const std::set<double>&, const std::set<double>&)> makVrf::DtVrfCheckpointManager::signal_saveStateChanged
boost::signal<void (const std::set<double>&)> makVrf::DtVrfCheckpointManager::signal_savedCheckpointsCleared

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

boost::signal<void (const std::set<double>&)> makVrf::DtVrfCheckpointManager::signal_savingCheckpoints
boost::signal<void (double, double)> makVrf::DtVrfCheckpointManager::signal_baseScenarioSnapshotTimeChanged
boost::signal<void (double)> makVrf::DtVrfCheckpointManager::signal_aboutToRollBack
makVrv::DtDe& makVrf::DtVrfCheckpointManager::myDe
protected
AvailableSnapshots makVrf::DtVrfCheckpointManager::myAvailableSnapshots
protected
makVrv::DtSignalConnectionManager makVrf::DtVrfCheckpointManager::myConnections
protected
DtScenarioSnapshotsWidget* makVrf::DtVrfCheckpointManager::myScenarioSnapshotsWidget
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::myPeriodicCheckpointFrequency
protected

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

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)