MAK Data Logger API Documentation for HLA
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
MAKLogger::DtLgrPlaybackDriver Class Reference

The class responsible for controlling the logger playback functionality. More...

+ Inheritance diagram for MAKLogger::DtLgrPlaybackDriver:
+ Collaboration diagram for MAKLogger::DtLgrPlaybackDriver:

Public Types

typedef DtLgrPlaybackCommandFactory Factory
typedef DtLgrPlaybackInterface Interface

Public Member Functions

virtual ~DtLgrPlaybackDriver ()
virtual void tick ()
 Tick the driver, cause it to do anything on a regular basis.
virtual bool getPipeline ()
 Attempt to acquire the pipeline.
virtual bool hasPipeline () const
 Does this object own the pipeline.
virtual bool releasePipeline ()
 Attempt to release the pipeline.
virtual void setUnsavedFile (const DtString &filename, bool selectAll)
 Set the lgrPlayback driver to use an unsaved file (while still using the filename of the original.
virtual void openVirtualFile (const DtString &actualFileName, const DtString &desiredName)
 Open an actual file name, under a desired name.
virtual void configurePipeline ()
 Configure pipeline for playback from file to simulation.
virtual bool isFileSaved () const
 Get whether the file is currently saved.
virtual bool isFileOpen () const
 Get whether a file is opened.
virtual bool isPlaying () const
 Get whether playback is started.
virtual bool isStopped () const
 Get whether playback is stopped.
virtual bool isPaused () const
 Get whether playback is paused.
virtual bool isFileIncomplete () const
 Get whether a file is opened but incomplete.
virtual double playbackSpeed () const
 Get the playback speed.
virtual bool skippingPlayback () const
 Get the skipping playback flag.
virtual double skippingPlaybackThreshold () const
 Get the skipping playback threshold.
virtual DtAbsoluteTime currentTime () const
 Get the current time of playback.
virtual DtAbsoluteTime startTime () const
 Get the current start time of playback.
virtual DtAbsoluteTime stopTime () const
 Get the stop time of the loaded file.
virtual DtAbsoluteTime firstMessageTime () const
 Get the first time of the loaded file.
virtual DtAbsoluteTime lastTime () const
 Get the last time of the loaded file.
virtual const DtStringcurrentFilename () const
 Get the current name of the actual file being used.
virtual const DtStringsavedFilename () const
 Get the name of the file which has been saved.
virtual bool loopAtEnd () const
 Get whether the logger will loop at the end of the tape.
virtual bool playOnLoad () const
 Get whether the file will play after it is loaded.
virtual bool fileFormatCurrent () const
 Get whether the current file format is the latest format.
virtual bool backupOnSave () const
 Get whether to backup on save.
virtual DtLgrEntityTrackerentityTracker () const
 Get the current file's entity tracker, or null if there is none.
virtual void addTemporaryTrackedEntity (const DtString &name)
 Adds a temporary entity to the entity tracker.
- Public Member Functions inherited from MAKLogger::DtLgrCommandHandler
 DtLgrCommandHandler (const DtString &name, DtRuntimeCommandFactory *, DtCommandDispatcherSP)
 Constructor which provides the name, the runtime factory, and the dispatcher which receives and transmits commands.
virtual ~DtLgrCommandHandler ()
 DTOR.
void lock ()
 Locks the Command Handler.
void unlock ()
 Unlocks the Command Handler.
DtCommandDispatcherSP dispatcher ()
 Get the dispatcher the command handler is connected to.
virtual const DtStringdriverName () const
 Get the name of the driver.
virtual const DtStringdriverInfo ()
 Get the name of the driver.
virtual void processCommand (const DtCommand &command)
 Process a specific command.

Protected Member Functions

bool prepareDriverForOpen ()
 Prepare driver for open file.
virtual void tickStopPlayback ()
virtual void tickNormalPlayback ()
virtual void tickPausePlayback ()
virtual void tickSkippingPlayback ()
virtual bool doSwapInFile (const DtString &filename, bool selectAll)
 Implement swap in temp file to use as unsaved file.
virtual bool doPlay ()
virtual bool doStop ()
virtual bool doPause ()
virtual bool doUnpause ()
virtual bool doPlaybackSpeedChange (double speed)
virtual void doTimeJump (const DtAbsoluteTime &time)
virtual void doSkippingPlay (const DtAbsoluteTime &time)
DtResponse openFile (const DtCommand &command)
 openFile command
virtual bool doOpenFile (DtString filename)
 Implementation of opening a file.
void sendFileInputChangedResponses (const DtString &filename)
 Send the necessary open file responses.
DtResponse closeFile (const DtCommand &command)
 closeFile command
DtResponse saveFile (const DtCommand &command)
 Handle the safeFile command.
DtResponse saveFileAs (const DtCommand &command)
 Handle the safe file as command.
DtResponse revertFile (const DtCommand &command)
 Handle the revert command.
DtResponse play (const DtCommand &command)
 play command
DtResponse playPause (const DtCommand &command)
 playPause command
DtResponse stop (const DtCommand &command)
 stop command
DtResponse restart (const DtCommand &command)
 restart command
DtResponse setStartStopTimes (const DtCommand &command)
 setStartStopTimes command
DtResponse setPlaybackSpeed (const DtCommand &command)
 setPlaybackSpeed command
DtResponse setCurrentTime (const DtCommand &command)
 setCurrentTime command
DtResponse skipTime (const DtCommand &command)
 SkipTime command.
DtResponse pause (const DtCommand &command)
 pause command
DtResponse unpause (const DtCommand &command)
 unpause command
DtResponse setLoopAtEnd (const DtCommand &command)
 setLoopAtEnd command.
DtResponse setPlayOnLoad (const DtCommand &command)
 setPlayOnLoad command.
DtResponse setBackupOnSave (const DtCommand &command)
 setBackupOnSave command.
DtResponse setSkippingPlaybackThreshold (const DtCommand &command)
 setSkippingPlayback command
DtResponse requestFileList (const DtCommand &command)
 requestFileList command
virtual bool openFileInput (const DtString &filename, DtString &failureReason)
 Open the file input.
virtual void closeFileInput (bool clearHistory)
 Close the actual file history.
virtual void setFileHistoryCount (int count)
 Set the file history count.
virtual void addFileToHistory (const DtString &filename)
 Adds a file to the history, if necessary files are removed and deleted.
virtual void clearFileHistory ()
 Clears the file history and deletes each file.
- Protected Member Functions inherited from MAKLogger::DtLgrCommandHandler
void addCommandHandler (const DtCommandDefinition &commandDef, DtCommandFunctorSP commandFunctor)
 Add a commandHandler, this should not be virtual as it is called in constructors.
void removeCommandHandler (const DtCommandDefinition &commandDef)
 Remove a commandHandler, this is typically not called but necessary for replacing a command handler.
virtual void sendResponse (DtResponse response)
 Send a response, for functions that have multiple responses make this call.
virtual void queueResponse (DtResponse response)
 Queue a response for future sending.
virtual void sendQueuedResponses ()
 Sends all queued responses and clears the queue.
virtual void emptyResponseQueue ()
 Empty the response queue (deleting any unsent responses).

Protected Attributes

std::deque< DtStringmyFileStack
DtString mySavedFileName
DtLgrFileInputmyFileInput
DtLgrSystemDrivermyDriver
DtMessagePipelinemyPipeline
bool myPausedFlag
bool myLoopAtEnd
bool myPlayOnLoadFlag
double myTimeScale
DtLgrClockmyPlaybackClock
DtAbsoluteTime myStartTime
DtAbsoluteTime myStopTime
DtAbsoluteTime myCurrentTime
bool myPlayingFlag
bool myBackupFlag
bool mySkippingPlayback
double mySkippingPlaybackThreshold
DtAbsoluteTime myNextSkipTime
unsigned int myFileHistoryCount
- Protected Attributes inherited from MAKLogger::DtLgrCommandHandler
DtRuntimeCommandFactorymyRuntimeCommandFactory
DtLgrCommandHandlerMap myCommandMap
DtCommandDispatcherSP myDispatcher
DtResponseQueue myResponseQueue
DtString myName
DtString myInfo
DtMutex myMutex

Static Protected Attributes

static const unsigned short theDomain = DtLgrCommandType::Domain_Player
static const unsigned short theProtocol = DtLgrCommandType::Protocol_None
static const int theDefaultFileHistoryCount = 1

Additional Inherited Members

- Protected Types inherited from MAKLogger::DtLgrCommandHandler
typedef DtLgrCommandHandler *(* DriverCreator )(DtCommandDispatcherSP)
typedef std::map
< DtLgrCommandId,
DtCommandFunctorSP
DtLgrCommandHandlerMap
typedef std::map< DtString,
DtLgrCommandId
DtLgrCommandNameMap
typedef std::list< DtResponseDtResponseQueue

Detailed Description

The class responsible for controlling the logger playback functionality.

The DtLgrPlaybackDriver is not thread safe. For thread- safe access use the DtLgrPlaybackInterface class.

Member Typedef Documentation

Constructor & Destructor Documentation

virtual MAKLogger::DtLgrPlaybackDriver::~DtLgrPlaybackDriver ( )
virtual

Member Function Documentation

virtual void MAKLogger::DtLgrPlaybackDriver::addFileToHistory ( const DtString filename)
protectedvirtual

Adds a file to the history, if necessary files are removed and deleted.

virtual void MAKLogger::DtLgrPlaybackDriver::addTemporaryTrackedEntity ( const DtString name)
virtual

Adds a temporary entity to the entity tracker.

virtual bool MAKLogger::DtLgrPlaybackDriver::backupOnSave ( ) const
virtual

Get whether to backup on save.

virtual void MAKLogger::DtLgrPlaybackDriver::clearFileHistory ( )
protectedvirtual

Clears the file history and deletes each file.

DtResponse MAKLogger::DtLgrPlaybackDriver::closeFile ( const DtCommand command)
protected

closeFile command

virtual void MAKLogger::DtLgrPlaybackDriver::closeFileInput ( bool  clearHistory)
protectedvirtual

Close the actual file history.

virtual void MAKLogger::DtLgrPlaybackDriver::configurePipeline ( )
virtual

Configure pipeline for playback from file to simulation.

virtual const DtString& MAKLogger::DtLgrPlaybackDriver::currentFilename ( ) const
virtual

Get the current name of the actual file being used.

virtual DtAbsoluteTime MAKLogger::DtLgrPlaybackDriver::currentTime ( ) const
virtual

Get the current time of playback.

virtual bool MAKLogger::DtLgrPlaybackDriver::doOpenFile ( DtString  filename)
protectedvirtual

Implementation of opening a file.

virtual bool MAKLogger::DtLgrPlaybackDriver::doPause ( )
protectedvirtual
virtual bool MAKLogger::DtLgrPlaybackDriver::doPlay ( )
protectedvirtual
virtual bool MAKLogger::DtLgrPlaybackDriver::doPlaybackSpeedChange ( double  speed)
protectedvirtual
virtual void MAKLogger::DtLgrPlaybackDriver::doSkippingPlay ( const DtAbsoluteTime time)
protectedvirtual
virtual bool MAKLogger::DtLgrPlaybackDriver::doStop ( )
protectedvirtual
virtual bool MAKLogger::DtLgrPlaybackDriver::doSwapInFile ( const DtString filename,
bool  selectAll 
)
protectedvirtual

Implement swap in temp file to use as unsaved file.

virtual void MAKLogger::DtLgrPlaybackDriver::doTimeJump ( const DtAbsoluteTime time)
protectedvirtual
virtual bool MAKLogger::DtLgrPlaybackDriver::doUnpause ( )
protectedvirtual
virtual DtLgrEntityTracker* MAKLogger::DtLgrPlaybackDriver::entityTracker ( ) const
virtual

Get the current file's entity tracker, or null if there is none.

virtual bool MAKLogger::DtLgrPlaybackDriver::fileFormatCurrent ( ) const
virtual

Get whether the current file format is the latest format.

virtual DtAbsoluteTime MAKLogger::DtLgrPlaybackDriver::firstMessageTime ( ) const
virtual

Get the first time of the loaded file.

virtual bool MAKLogger::DtLgrPlaybackDriver::getPipeline ( )
virtual

Attempt to acquire the pipeline.

Return values
trueThe pipeline has been acquired.
falseThe pipeline has not been acquired.

Implements MAKLogger::DtLgrCommandHandler.

virtual bool MAKLogger::DtLgrPlaybackDriver::hasPipeline ( ) const
virtual

Does this object own the pipeline.

Return values
trueThe pipeline is owned.
falseThe pipeline is not owned.

Implements MAKLogger::DtLgrCommandHandler.

virtual bool MAKLogger::DtLgrPlaybackDriver::isFileIncomplete ( ) const
virtual

Get whether a file is opened but incomplete.

virtual bool MAKLogger::DtLgrPlaybackDriver::isFileOpen ( ) const
virtual

Get whether a file is opened.

virtual bool MAKLogger::DtLgrPlaybackDriver::isFileSaved ( ) const
virtual

Get whether the file is currently saved.

virtual bool MAKLogger::DtLgrPlaybackDriver::isPaused ( ) const
virtual

Get whether playback is paused.

virtual bool MAKLogger::DtLgrPlaybackDriver::isPlaying ( ) const
virtual

Get whether playback is started.

virtual bool MAKLogger::DtLgrPlaybackDriver::isStopped ( ) const
virtual

Get whether playback is stopped.

virtual DtAbsoluteTime MAKLogger::DtLgrPlaybackDriver::lastTime ( ) const
virtual

Get the last time of the loaded file.

virtual bool MAKLogger::DtLgrPlaybackDriver::loopAtEnd ( ) const
virtual

Get whether the logger will loop at the end of the tape.

DtResponse MAKLogger::DtLgrPlaybackDriver::openFile ( const DtCommand command)
protected

openFile command

virtual bool MAKLogger::DtLgrPlaybackDriver::openFileInput ( const DtString filename,
DtString failureReason 
)
protectedvirtual

Open the file input.

virtual void MAKLogger::DtLgrPlaybackDriver::openVirtualFile ( const DtString actualFileName,
const DtString desiredName 
)
virtual

Open an actual file name, under a desired name.

DtResponse MAKLogger::DtLgrPlaybackDriver::pause ( const DtCommand command)
protected

pause command

DtResponse MAKLogger::DtLgrPlaybackDriver::play ( const DtCommand command)
protected

play command

virtual double MAKLogger::DtLgrPlaybackDriver::playbackSpeed ( ) const
virtual

Get the playback speed.

virtual bool MAKLogger::DtLgrPlaybackDriver::playOnLoad ( ) const
virtual

Get whether the file will play after it is loaded.

DtResponse MAKLogger::DtLgrPlaybackDriver::playPause ( const DtCommand command)
protected

playPause command

bool MAKLogger::DtLgrPlaybackDriver::prepareDriverForOpen ( )
protected

Prepare driver for open file.

virtual bool MAKLogger::DtLgrPlaybackDriver::releasePipeline ( )
virtual

Attempt to release the pipeline.

This function is called when the pipeline has been requested by a different driver. If the driver can't release the pipeline it will return false. By default this method simply succeeds. If the driver should override this function if it wishes to deny the request.

Return values
trueThe pipeline has been released.
falseThe pipeline has not been released.

Implements MAKLogger::DtLgrCommandHandler.

DtResponse MAKLogger::DtLgrPlaybackDriver::requestFileList ( const DtCommand command)
protected

requestFileList command

DtResponse MAKLogger::DtLgrPlaybackDriver::restart ( const DtCommand command)
protected

restart command

DtResponse MAKLogger::DtLgrPlaybackDriver::revertFile ( const DtCommand command)
protected

Handle the revert command.

virtual const DtString& MAKLogger::DtLgrPlaybackDriver::savedFilename ( ) const
virtual

Get the name of the file which has been saved.

This is typically what is used.

DtResponse MAKLogger::DtLgrPlaybackDriver::saveFile ( const DtCommand command)
protected

Handle the safeFile command.

DtResponse MAKLogger::DtLgrPlaybackDriver::saveFileAs ( const DtCommand command)
protected

Handle the safe file as command.

void MAKLogger::DtLgrPlaybackDriver::sendFileInputChangedResponses ( const DtString filename)
protected

Send the necessary open file responses.

DtResponse MAKLogger::DtLgrPlaybackDriver::setBackupOnSave ( const DtCommand command)
protected

setBackupOnSave command.

DtResponse MAKLogger::DtLgrPlaybackDriver::setCurrentTime ( const DtCommand command)
protected

setCurrentTime command

virtual void MAKLogger::DtLgrPlaybackDriver::setFileHistoryCount ( int  count)
protectedvirtual

Set the file history count.

DtResponse MAKLogger::DtLgrPlaybackDriver::setLoopAtEnd ( const DtCommand command)
protected

setLoopAtEnd command.

DtResponse MAKLogger::DtLgrPlaybackDriver::setPlaybackSpeed ( const DtCommand command)
protected

setPlaybackSpeed command

DtResponse MAKLogger::DtLgrPlaybackDriver::setPlayOnLoad ( const DtCommand command)
protected

setPlayOnLoad command.

DtResponse MAKLogger::DtLgrPlaybackDriver::setSkippingPlaybackThreshold ( const DtCommand command)
protected

setSkippingPlayback command

DtResponse MAKLogger::DtLgrPlaybackDriver::setStartStopTimes ( const DtCommand command)
protected

setStartStopTimes command

virtual void MAKLogger::DtLgrPlaybackDriver::setUnsavedFile ( const DtString filename,
bool  selectAll 
)
virtual

Set the lgrPlayback driver to use an unsaved file (while still using the filename of the original.

virtual bool MAKLogger::DtLgrPlaybackDriver::skippingPlayback ( ) const
virtual

Get the skipping playback flag.

virtual double MAKLogger::DtLgrPlaybackDriver::skippingPlaybackThreshold ( ) const
virtual

Get the skipping playback threshold.

DtResponse MAKLogger::DtLgrPlaybackDriver::skipTime ( const DtCommand command)
protected

SkipTime command.

virtual DtAbsoluteTime MAKLogger::DtLgrPlaybackDriver::startTime ( ) const
virtual

Get the current start time of playback.

DtResponse MAKLogger::DtLgrPlaybackDriver::stop ( const DtCommand command)
protected

stop command

virtual DtAbsoluteTime MAKLogger::DtLgrPlaybackDriver::stopTime ( ) const
virtual

Get the stop time of the loaded file.

virtual void MAKLogger::DtLgrPlaybackDriver::tick ( )
virtual

Tick the driver, cause it to do anything on a regular basis.

Implements MAKLogger::DtLgrCommandHandler.

virtual void MAKLogger::DtLgrPlaybackDriver::tickNormalPlayback ( )
protectedvirtual
virtual void MAKLogger::DtLgrPlaybackDriver::tickPausePlayback ( )
protectedvirtual
virtual void MAKLogger::DtLgrPlaybackDriver::tickSkippingPlayback ( )
protectedvirtual
virtual void MAKLogger::DtLgrPlaybackDriver::tickStopPlayback ( )
protectedvirtual
DtResponse MAKLogger::DtLgrPlaybackDriver::unpause ( const DtCommand command)
protected

unpause command

Member Data Documentation

bool MAKLogger::DtLgrPlaybackDriver::myBackupFlag
protected
DtAbsoluteTime MAKLogger::DtLgrPlaybackDriver::myCurrentTime
protected
DtLgrSystemDriver* MAKLogger::DtLgrPlaybackDriver::myDriver
protected
unsigned int MAKLogger::DtLgrPlaybackDriver::myFileHistoryCount
protected
DtLgrFileInput* MAKLogger::DtLgrPlaybackDriver::myFileInput
protected
std::deque<DtString> MAKLogger::DtLgrPlaybackDriver::myFileStack
protected
bool MAKLogger::DtLgrPlaybackDriver::myLoopAtEnd
protected
DtAbsoluteTime MAKLogger::DtLgrPlaybackDriver::myNextSkipTime
protected
bool MAKLogger::DtLgrPlaybackDriver::myPausedFlag
protected
DtMessagePipeline* MAKLogger::DtLgrPlaybackDriver::myPipeline
protected
DtLgrClock* MAKLogger::DtLgrPlaybackDriver::myPlaybackClock
protected
bool MAKLogger::DtLgrPlaybackDriver::myPlayingFlag
protected
bool MAKLogger::DtLgrPlaybackDriver::myPlayOnLoadFlag
protected
DtString MAKLogger::DtLgrPlaybackDriver::mySavedFileName
protected
bool MAKLogger::DtLgrPlaybackDriver::mySkippingPlayback
protected
double MAKLogger::DtLgrPlaybackDriver::mySkippingPlaybackThreshold
protected
DtAbsoluteTime MAKLogger::DtLgrPlaybackDriver::myStartTime
protected
DtAbsoluteTime MAKLogger::DtLgrPlaybackDriver::myStopTime
protected
double MAKLogger::DtLgrPlaybackDriver::myTimeScale
protected
const int MAKLogger::DtLgrPlaybackDriver::theDefaultFileHistoryCount = 1
staticprotected
const unsigned short MAKLogger::DtLgrPlaybackDriver::theDomain = DtLgrCommandType::Domain_Player
staticprotected
const unsigned short MAKLogger::DtLgrPlaybackDriver::theProtocol = DtLgrCommandType::Protocol_None
staticprotected

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

Document ID: Generated on Thu Apr 11 12:13:00 EDT 2013 from SVN revision 126011
Copyright © 2005-2012 VT MÄK. All Rights Reserved (www.mak.com)