VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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. More...
 
virtual void enablePeriodicSnapshots (bool flag)
 Default is disabled. More...
 
virtual bool periodicSnapshotsEnabled () const
 
virtual void setSnapshotPeriod (double period)
 Default is 1 second. More...
 
virtual double snapshotPeriod () const
 
virtual void setNumberOfSnapshotsToKeep (int)
 Number of periodic snapshots to keep around. 0 means keep all. More...
 
virtual int numberOfSnapshotsToKeep () const
 
virtual void setPauseCleanup (bool)
 Pauses cleanup of snapshotss. More...
 
bool pauseCleanup () const
 
virtual void clear (bool allButBase=false)
 
virtual bool isBaseSnapshot (DtInMemorySnapshot *) const
 Returns true if this is the base snapshot. More...
 
virtual DtInMemorySnapshottakeSnapshot (bool isPeriodic=false, bool makeBase=false)
 Snapshots at the current point. More...
 
virtual void rollbackToSimTime (double simTime)
 Rolls back the snapshot to the current simulation time. More...
 
virtual void rollbackTo (DtInMemorySnapshot *, int scenarioRunId=0)
 Rolls back to the given in memory snapshot. If supplied, the new scenario run id. More...
 
virtual void clearOutStaleSnapshots ()
 Clears out snapshots that are not within the window of snapshot keeping. More...
 
virtual DtInMemorySnapshotsnapshotFor (int id) const
 Returns the in memory snapshot for this id. More...
 
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. More...
 
virtual double snapshotHeartbeatTime () const
 
virtual void sendCurrentSnapshots ()
 Sends the current snapshots out. More...
 
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. More...
 
virtual DtInMemorySnapshotsnapshotClosestToSimTime (double simTime) const
 Returns the snapshot closest to the given sim time. More...
 
virtual void removeSnapshotsAfter (double simTime)
 Removes all snapshots after the given simulation time. More...
 
virtual bool hasSnapshots () const
 Returns true if there are snapshots in the manager. More...
 
virtual void clearAllSnapshots ()
 Clears out all snapshots. If there is no scenario loaded also closes terrain. More...
 

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 void finishSavingSnapshots ()
 Any snapshot runs that are done save here. More...
 

Static Protected Member Functions

static void clearAllSnapshotsCallback (DtSimMessage *, void *)
 Will tell all locally vrf simulated object so be ready for reinitialize, delete all the objects. More...
 
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. More...
 
DtSnapshotManageroperator= (const DtSnapshotManager &)
 Not implemented. More...
 

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 bool DtSnapshotManager::isBaseSnapshot ( DtInMemorySnapshot ) const
virtual

Returns true if this is the base snapshot.

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::rollbackToSimTime ( double  simTime)
virtual

Rolls back the snapshot to the current simulation time.

Note that this is only good for this cgf. In a multiple cgf environment calling this method will have unpredictable, and possibly buggy, results

virtual void DtSnapshotManager::rollbackTo ( DtInMemorySnapshot ,
int  scenarioRunId = 0 
)
virtual

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

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

Will tell all locally vrf simulated object so be ready for reinitialize, delete all the objects.

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 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 Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)