VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions
DtSnapshotManager Class Reference

Classes

class  DtWriteSnapshotJob

Public Member Functions

 DtSnapshotManager (DtCgf *cgf)
virtual ~DtSnapshotManager ()
virtual bool init ()
virtual void tick ()
virtual void setSimTime (double)
 Sets current simulation time so internal variable for heartbeat and snapshot can be initialized appropriately.
virtual void enablePeriodicSnapshots (bool flag)
 Default is disabled.
virtual bool periodicSnapshotsEnabled () const
virtual void setSnapshotPeriod (double period)
 Default is 1 second.
virtual double snapshotPeriod () const
virtual void setNumberOfSnapshotsToKeep (int)
 Number of periodic snapshots to keep around. 0 means keep all.
virtual int numberOfSnapshotsToKeep () const
virtual void setPauseCleanup (bool)
 Pauses cleanup of snapshotss.
bool pauseCleanup () const
virtual void clear (bool allButBase=false)
virtual DtInMemorySnapshottakeSnapshot (bool isPeriodic=false, bool makeBase=false)
 Snapshots at the current point.
virtual void clearOutStaleSnapshots ()
 Clears out snapshots that are not within the window of snapshot keeping.
virtual DtInMemorySnapshotsnapshotFor (int id) const
 Returns the in memory snapshot for this id.
virtual void setSnapshotHeartbeatTime (double d)
 Sets the tim to send out all the snapshots. Default is 2 seconds or the periodic snapshot time, whichever is greater.
virtual double snapshotHeartbeatTime () const
virtual void sendCurrentSnapshots ()
 Sends the current snapshots out.
virtual bool saveSnapshot (const DtFilename &saveFolder, DtCompressedFileTransporter &tr, DtIfSaveScenario *msg, const DtScenario &currentScenario, const DtSimulationAddress &requestor)
 Saves the closest snapshot of the given sim time to save.
virtual DtInMemorySnapshotsnapshotClosestToSimTime (double simTime) const
 Returns the snapshot closest to the given sim time.
virtual void removeSnapshotsAfter (double simTime)
 Removes all snapshots after the given simulation time.
virtual bool hasSnapshots () const
 Returns true if there are snapshots in the manager.
virtual void clearAllSnapshots ()
 Clears out all snapshots. If there is no scenario loaded also closes terrain.

Protected Types

typedef std::map< int,
DtInMemorySnapshot * > 
Snapshots
typedef std::map< int,
DtVrfCallbackQueue::CallbackInterface::Ptr
SavingSnapshots

Protected Member Functions

virtual void processSettings (const DtPeriodicSnapshotSettings *)
virtual void processSnapshotsRequest (DtSimMessage *)
virtual void processRollbackToSnapshot (DtSimMessage *)
virtual bool rollbackTo (DtInMemorySnapshot *, int scenarioRunId=0)
 Rolls back to the given in memory snapshot. If supplied, the new scenario run id.
virtual void finishSavingSnapshots ()
 Any snapshot runs that are done save here.

Static Protected Member Functions

static void clearAllSnapshotsCallback (DtSimMessage *, void *)
static void settingConsumerCallback (const DtSettingsObject *settingsObject, void *usr)
static void requestSnapshots (DtSimMessage *, void *)
static void rollbackToSnapshot (DtSimMessage *, void *)

Protected Attributes

DtCgfmyCgf
bool myPeriodicSnapshotsEnabled
double mySnapshotPeriod
double myLastSnapshotHeartbeat
double mySnapshotHeartbeatTime
double myLastTimePeriodicSnapshoted
int myNumberOfSnapshotsToKeep
int myNextSnapshotId
Snapshots mySnapshots
Snapshots myPeriodicSnapshots
bool mySnapshotsModified
DtIfSnapshotsResponse myCurrentSnapshots
bool myPauseCleanup
SavingSnapshots myCheckpointing
DtVrfCallbackQueuemyFileWriterJobQueue

Private Member Functions

 DtSnapshotManager (const DtSnapshotManager &)
 Not implemented.
DtSnapshotManageroperator= (const DtSnapshotManager &)
 Not implemented.

Member Typedef Documentation

typedef std::map<int, DtInMemorySnapshot*> DtSnapshotManager::Snapshots
protected

Constructor & Destructor Documentation

DtSnapshotManager::DtSnapshotManager ( const DtSnapshotManager )
private

Not implemented.

DtSnapshotManager::DtSnapshotManager ( DtCgf cgf)
virtual DtSnapshotManager::~DtSnapshotManager ( )
virtual

Member Function Documentation

DtSnapshotManager& DtSnapshotManager::operator= ( const DtSnapshotManager )
private

Not implemented.

virtual bool DtSnapshotManager::init ( )
virtual
virtual void DtSnapshotManager::tick ( )
virtual
virtual void DtSnapshotManager::setSimTime ( double  )
virtual

Sets current simulation time so internal variable for heartbeat and snapshot can be initialized appropriately.

virtual void DtSnapshotManager::enablePeriodicSnapshots ( bool  flag)
virtual

Default is disabled.

virtual bool DtSnapshotManager::periodicSnapshotsEnabled ( ) const
virtual
virtual void DtSnapshotManager::setSnapshotPeriod ( double  period)
virtual

Default is 1 second.

virtual double DtSnapshotManager::snapshotPeriod ( ) const
virtual
virtual void DtSnapshotManager::setNumberOfSnapshotsToKeep ( int  )
virtual

Number of periodic snapshots to keep around. 0 means keep all.

virtual int DtSnapshotManager::numberOfSnapshotsToKeep ( ) const
virtual
virtual void DtSnapshotManager::setPauseCleanup ( bool  )
virtual

Pauses cleanup of snapshotss.

Use when rolling back just to be sure the rollback snapshot is not mistakenly cleaned up

bool DtSnapshotManager::pauseCleanup ( ) const
inline
virtual void DtSnapshotManager::clear ( bool  allButBase = false)
virtual
virtual DtInMemorySnapshot* DtSnapshotManager::takeSnapshot ( bool  isPeriodic = false,
bool  makeBase = false 
)
virtual

Snapshots at the current point.

Will not effect the periodic snapshot timing. If makeBase is true makes this snapshot the new "base" snapshot (which is one the front-end can rewind to by a single click). If makeBase is true and periodic is also true, periodic will be turned to non-periodic

virtual void DtSnapshotManager::clearOutStaleSnapshots ( )
virtual

Clears out snapshots that are not within the window of snapshot keeping.

virtual DtInMemorySnapshot* DtSnapshotManager::snapshotFor ( int  id) const
virtual

Returns the in memory snapshot for this id.

virtual void DtSnapshotManager::setSnapshotHeartbeatTime ( double  d)
virtual

Sets the tim to send out all the snapshots. Default is 2 seconds or the periodic snapshot time, whichever is greater.

virtual double DtSnapshotManager::snapshotHeartbeatTime ( ) const
virtual
virtual void DtSnapshotManager::sendCurrentSnapshots ( )
virtual

Sends the current snapshots out.

virtual bool DtSnapshotManager::saveSnapshot ( const DtFilename &  saveFolder,
DtCompressedFileTransporter tr,
DtIfSaveScenario msg,
const DtScenario currentScenario,
const DtSimulationAddress &  requestor 
)
virtual

Saves the closest snapshot of the given sim time to save.

If none exists returns false.

virtual DtInMemorySnapshot* DtSnapshotManager::snapshotClosestToSimTime ( double  simTime) const
virtual

Returns the snapshot closest to the given sim time.

virtual void DtSnapshotManager::removeSnapshotsAfter ( double  simTime)
virtual

Removes all snapshots after the given simulation time.

virtual bool DtSnapshotManager::hasSnapshots ( ) const
virtual

Returns true if there are snapshots in the manager.

virtual void DtSnapshotManager::clearAllSnapshots ( )
virtual

Clears out all snapshots. If there is no scenario loaded also closes terrain.

static void DtSnapshotManager::clearAllSnapshotsCallback ( DtSimMessage ,
void *   
)
staticprotected
static void DtSnapshotManager::settingConsumerCallback ( const DtSettingsObject settingsObject,
void *  usr 
)
staticprotected
virtual void DtSnapshotManager::processSettings ( const DtPeriodicSnapshotSettings )
protectedvirtual
static void DtSnapshotManager::requestSnapshots ( DtSimMessage ,
void *   
)
staticprotected
virtual void DtSnapshotManager::processSnapshotsRequest ( DtSimMessage )
protectedvirtual
static void DtSnapshotManager::rollbackToSnapshot ( DtSimMessage ,
void *   
)
staticprotected
virtual void DtSnapshotManager::processRollbackToSnapshot ( DtSimMessage )
protectedvirtual
virtual bool DtSnapshotManager::rollbackTo ( DtInMemorySnapshot ,
int  scenarioRunId = 0 
)
protectedvirtual

Rolls back to the given in memory snapshot. If supplied, the new scenario run id.

virtual void DtSnapshotManager::finishSavingSnapshots ( )
protectedvirtual

Any snapshot runs that are done save here.

Member Data Documentation

DtCgf* DtSnapshotManager::myCgf
protected
bool DtSnapshotManager::myPeriodicSnapshotsEnabled
protected
double DtSnapshotManager::mySnapshotPeriod
protected
double DtSnapshotManager::myLastSnapshotHeartbeat
protected
double DtSnapshotManager::mySnapshotHeartbeatTime
protected
double DtSnapshotManager::myLastTimePeriodicSnapshoted
protected
int DtSnapshotManager::myNumberOfSnapshotsToKeep
protected
int DtSnapshotManager::myNextSnapshotId
protected
Snapshots DtSnapshotManager::mySnapshots
protected
Snapshots DtSnapshotManager::myPeriodicSnapshots
protected
bool DtSnapshotManager::mySnapshotsModified
protected
DtIfSnapshotsResponse DtSnapshotManager::myCurrentSnapshots
protected
bool DtSnapshotManager::myPauseCleanup
protected
SavingSnapshots DtSnapshotManager::myCheckpointing
protected
DtVrfCallbackQueue* DtSnapshotManager::myFileWriterJobQueue
protected

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

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)