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:

List of all members.

Public Member Functions

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

Protected Attributes

DtMutex myListenerMutex
DtLgrCommandQueue * myCommandQueue
DtResponseList myResponseList
DtRuntimeCommandFactory * myRuntimeCommandFactory

Private Member Functions

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

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


Member Function Documentation

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.
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.

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

Document ID: Generated on Tue Oct 11 19:41:03 EDT 2011 from SVN revision 107422
Copyright © 2005-2011 VT MÄK Inc. All Rights Reserved (www.mak.com)