The class provides two way command message communication.
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
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 | |
| listener | A shared_ptr to a response queue which will receive commands. |
- Returns
- Returns the success of adding the listener.
- Return values
-
| true | Response queue was added successfully and will received commands. |
| false | Response queue was not added |
- Exceptions
-
| DtInvalidInput | The newListener shared pointer was invalid or NULL. |
- Precondition
- None.
- Postcondition
- If the response was successful the listener will receive future responses.
Moves all commands to the collector.
| 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 | |
| listener | A shared_ptr to a response queue which has been added. |
- Exceptions
-
| DtInvalidInput | The 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.
Commands that can be given to the Logger.
Member Data Documentation
| DtMutex MAKLogger::DtCommandDispatcher::myListenerMutex |
|
protected |
The documentation for this class was generated from the following file: