MAK Data Logger API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
MAKLogger::DtLgrCommandHandler Class Referenceabstract

This class provides the base interface for DtLgrCommandHandler. More...

+ Inheritance diagram for MAKLogger::DtLgrCommandHandler:
+ Collaboration diagram for MAKLogger::DtLgrCommandHandler:

Public Member Functions

 DtLgrCommandHandler (const DtString &name, DtRuntimeCommandFactory *, DtCommandDispatcherSP)
 Constructor which provides the name, the runtime factory, and the dispatcher which receives and transmits commands. More...
 
virtual ~DtLgrCommandHandler ()
 DTOR. More...
 
void lock ()
 Locks the Command Handler. More...
 
void unlock ()
 Unlocks the Command Handler. More...
 
virtual void tick ()=0
 Tick the driver, cause it to do anything on a regular basis. More...
 
DtCommandDispatcherSP dispatcher ()
 Get the dispatcher the command handler is connected to. More...
 
virtual const DtString & driverName () const
 Get the name of the driver. More...
 
virtual const DtString & driverInfo ()
 Get the name of the driver. More...
 
virtual void processCommand (const DtCommand &command)
 Process a specific command. More...
 
virtual bool releasePipeline ()=0
 Attempt to release the pipeline. More...
 
virtual bool getPipeline ()=0
 Attempt to acquire the pipeline. More...
 
virtual bool hasPipeline () const =0
 Does this object own the pipeline. More...
 
virtual bool spawnThread (DtLgrCommandThread *commandThread)
 Spawn a new thread. More...
 
virtual void stopAllThreads ()
 Stop all running threads. More...
 
virtual void stopThread (DtLgrCommandThread *commandThread)
 Stop a thread and deallocate it's resources. More...
 

Protected Types

typedef DtLgrCommandHandler *(* DriverCreator )(DtCommandDispatcherSP)
 
typedef std::map
< DtLgrCommandId,
DtCommandFunctorSP
DtLgrCommandHandlerMap
 
typedef std::map< DtString,
DtLgrCommandId
DtLgrCommandNameMap
 
typedef std::list< DtResponseDtResponseQueue
 
typedef std::map
< DtLgrCommandThread
*, DtThread * > 
CommandThreadMap
 A set of running command threads. More...
 

Protected Member Functions

void addCommandHandler (const DtCommandDefinition &commandDef, DtCommandFunctorSP commandFunctor)
 Add a commandHandler, this should not be virtual as it is called in constructors. More...
 
void removeCommandHandler (const DtCommandDefinition &commandDef)
 Remove a commandHandler, this is typically not called but necessary for replacing a command handler. More...
 
virtual void sendResponse (DtResponse response)
 Send a response, for functions that have multiple responses make this call. More...
 
virtual void queueResponse (DtResponse response)
 Queue a response for future sending. More...
 
virtual void sendQueuedResponses ()
 Sends all queued responses and clears the queue. More...
 
virtual void emptyResponseQueue ()
 Empty the response queue (deleting any unsent responses). More...
 
DtResponse finishThread (const DtCommand &command)
 Finish the thread. More...
 

Protected Attributes

DtRuntimeCommandFactorymyRuntimeCommandFactory
 
DtLgrCommandHandlerMap myCommandMap
 
DtCommandDispatcherSP myDispatcher
 
DtResponseQueue myResponseQueue
 
DtString myName
 
DtString myInfo
 
DtMutex myMutex
 
CommandThreadMap myRunningCommandThreads
 Running command threads. More...
 

Detailed Description

This class provides the base interface for DtLgrCommandHandler.

Member Typedef Documentation

A set of running command threads.

typedef DtLgrCommandHandler*(* MAKLogger::DtLgrCommandHandler::DriverCreator)(DtCommandDispatcherSP)
protected

Constructor & Destructor Documentation

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 MAKLogger::DtLgrCommandHandler::~DtLgrCommandHandler ( )
virtual

DTOR.

Member Function Documentation

void MAKLogger::DtLgrCommandHandler::addCommandHandler ( const DtCommandDefinition commandDef,
DtCommandFunctorSP  commandFunctor 
)
protected

Add a commandHandler, this should not be virtual as it is called in constructors.

DtCommandDispatcherSP MAKLogger::DtLgrCommandHandler::dispatcher ( )

Get the dispatcher the command handler is connected to.

virtual const DtString& MAKLogger::DtLgrCommandHandler::driverInfo ( )
virtual

Get the name of the driver.

virtual const DtString& MAKLogger::DtLgrCommandHandler::driverName ( ) const
virtual

Get the name of the driver.

virtual void MAKLogger::DtLgrCommandHandler::emptyResponseQueue ( )
protectedvirtual

Empty the response queue (deleting any unsent responses).

DtResponse MAKLogger::DtLgrCommandHandler::finishThread ( const DtCommand command)
protected

Finish the thread.

virtual bool MAKLogger::DtLgrCommandHandler::getPipeline ( )
pure virtual

Attempt to acquire the pipeline.

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

Implemented in MAKLogger::DtLgrSimDriver, MAKLogger::DtStateObserverModel, MAKLogger::DtLgrEditorDriver, MAKLogger::DtLgrRecordDriver, and MAKLogger::DtLgrPlaybackDriver.

virtual bool MAKLogger::DtLgrCommandHandler::hasPipeline ( ) const
pure virtual

Does this object own the pipeline.

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

Implemented in MAKLogger::DtLgrSimDriver, MAKLogger::DtStateObserverModel, MAKLogger::DtLgrEditorDriver, MAKLogger::DtLgrRecordDriver, and MAKLogger::DtLgrPlaybackDriver.

void MAKLogger::DtLgrCommandHandler::lock ( )

Locks the Command Handler.

virtual void MAKLogger::DtLgrCommandHandler::processCommand ( const DtCommand command)
virtual

Process a specific command.

virtual void MAKLogger::DtLgrCommandHandler::queueResponse ( DtResponse  response)
protectedvirtual

Queue a response for future sending.

virtual bool MAKLogger::DtLgrCommandHandler::releasePipeline ( )
pure 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.

Implemented in MAKLogger::DtStateObserverModel, MAKLogger::DtLgrSimDriver, MAKLogger::DtLgrEditorDriver, MAKLogger::DtLgrPlaybackDriver, and MAKLogger::DtLgrRecordDriver.

void MAKLogger::DtLgrCommandHandler::removeCommandHandler ( const DtCommandDefinition commandDef)
protected

Remove a commandHandler, this is typically not called but necessary for replacing a command handler.

virtual void MAKLogger::DtLgrCommandHandler::sendQueuedResponses ( )
protectedvirtual

Sends all queued responses and clears the queue.

virtual void MAKLogger::DtLgrCommandHandler::sendResponse ( DtResponse  response)
protectedvirtual

Send a response, for functions that have multiple responses make this call.

virtual bool MAKLogger::DtLgrCommandHandler::spawnThread ( DtLgrCommandThread commandThread)
virtual

Spawn a new thread.

virtual void MAKLogger::DtLgrCommandHandler::stopAllThreads ( )
virtual

Stop all running threads.

Reimplemented in MAKLogger::DtLgrPlaybackDriver, and MAKLogger::DtLgrRecordDriver.

virtual void MAKLogger::DtLgrCommandHandler::stopThread ( DtLgrCommandThread commandThread)
virtual

Stop a thread and deallocate it's resources.

Reimplemented in MAKLogger::DtLgrPlaybackDriver, and MAKLogger::DtLgrRecordDriver.

virtual void MAKLogger::DtLgrCommandHandler::tick ( )
pure virtual
void MAKLogger::DtLgrCommandHandler::unlock ( )

Unlocks the Command Handler.

Member Data Documentation

DtLgrCommandHandlerMap MAKLogger::DtLgrCommandHandler::myCommandMap
protected
DtCommandDispatcherSP MAKLogger::DtLgrCommandHandler::myDispatcher
protected
DtString MAKLogger::DtLgrCommandHandler::myInfo
protected
DtMutex MAKLogger::DtLgrCommandHandler::myMutex
protected
DtString MAKLogger::DtLgrCommandHandler::myName
protected
DtResponseQueue MAKLogger::DtLgrCommandHandler::myResponseQueue
protected
CommandThreadMap MAKLogger::DtLgrCommandHandler::myRunningCommandThreads
protected

Running command threads.

DtRuntimeCommandFactory* MAKLogger::DtLgrCommandHandler::myRuntimeCommandFactory
protected

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

Document ID: Generated on Thu Dec 18 15:35:09 EST 2025 from SVN revision 282494
Copyright © 2024 MAK Technologies. All Rights Reserved (www.mak.com)