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

The class provides two way command message communication. More...

+ Collaboration diagram for MAKLogger::DtCommandDispatcher:

Public Member Functions

virtual ~DtCommandDispatcher ()
 Main (default) constructor. More...
 
virtual bool addResponseListener (DtResponseQueueSP listener)
 Add a listener who will receive all new listeners. More...
 
virtual void removeResponseListener (DtResponseQueueSP listener)
 Remove a listener from receiving response commands. More...
 
virtual void sendResponse (DtResponse response)
 Sends a response object to the command specified. More...
 
virtual void addCommand (const DtCommand &command)
 Adds a command to the queue. More...
 
void moveQueuedCommands (DtCollector< DtCommand > &collector)
 Moves all commands to the collector. More...
 
virtual DtAbsoluteTime tick ()
 Commands that can be given to the Logger. More...
 

Protected Attributes

DtMutex myListenerMutex
 
DtLgrCommandQueuemyCommandQueue
 
DtResponseList myResponseList
 
DtRuntimeCommandFactorymyRuntimeCommandFactory
 

Private Member Functions

 DtCommandDispatcher (const DtCommandDispatcher &src)
 No Copy constructor. More...
 
DtCommandDispatcheroperator= (const DtCommandDispatcher &src)
 No Assignment operator. More...
 

Detailed Description

The class provides two way command message communication.

The DtCommandDispatcher maintains a thread-safe interface for adding commands and sending responses to multiple listeners.

Constructor & Destructor Documentation

virtual MAKLogger::DtCommandDispatcher::~DtCommandDispatcher ( )
virtual

Main (default) constructor.

Destructor

MAKLogger::DtCommandDispatcher::DtCommandDispatcher ( const DtCommandDispatcher src)
private

No Copy constructor.

Member Function Documentation

virtual void MAKLogger::DtCommandDispatcher::addCommand ( const DtCommand command)
virtual

Adds a command to the queue.

virtual bool MAKLogger::DtCommandDispatcher::addResponseListener ( DtResponseQueueSP  listener)
virtual

Add a listener who will receive all new listeners.

This function will add a weak pointer to the listener in a list. This listener will receive response commands send by the dispatcher.

Parameters
Input
listenerA shared_ptr to a response queue which will receive commands.
Returns
Returns the success of adding the listener.
Return values
trueResponse queue was added successfully and will received commands.
falseResponse queue was not added
Exceptions
DtInvalidInputThe newListener shared pointer was invalid or NULL.
Precondition
None.
Postcondition
If the response was successful the listener will receive future responses.
void MAKLogger::DtCommandDispatcher::moveQueuedCommands ( DtCollector< DtCommand > &  collector)

Moves all commands to the collector.

DtCommandDispatcher& MAKLogger::DtCommandDispatcher::operator= ( const DtCommandDispatcher src)
private

No Assignment operator.

virtual void MAKLogger::DtCommandDispatcher::removeResponseListener ( DtResponseQueueSP  listener)
virtual

Remove a listener from receiving response commands.

This method will stop a listener from receiving response commands. This method does NOT need to be called when destructing the listener.

Parameters
Input
listenerA shared_ptr to a response queue which has been added.
Exceptions
DtInvalidInputThe newListener shared pointer was invalid or NULL
Precondition
None.
Postcondition
The listener will not receive response commands from this dispatcher.
Warning
Calls to removeResponseListener with a listener that was not added will not throw an error or have any effect.
virtual void MAKLogger::DtCommandDispatcher::sendResponse ( DtResponse  response)
virtual

Sends a response object to the command specified.

virtual DtAbsoluteTime MAKLogger::DtCommandDispatcher::tick ( )
virtual

Commands that can be given to the Logger.

Member Data Documentation

DtLgrCommandQueue* MAKLogger::DtCommandDispatcher::myCommandQueue
protected
DtMutex MAKLogger::DtCommandDispatcher::myListenerMutex
protected
DtResponseList MAKLogger::DtCommandDispatcher::myResponseList
protected
DtRuntimeCommandFactory* MAKLogger::DtCommandDispatcher::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)