The class provides two way command message communication. More...
Collaboration diagram for MAKLogger::DtCommandDispatcher: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. | |
The class provides two way command message communication.
The DtCommandDispatcher maintains a thread-safe interface for adding commands and sending responses to multiple listeners.
| virtual MAKLogger::DtCommandDispatcher::~DtCommandDispatcher | ( | ) | [virtual] |
Main (default) constructor.
Destructor
| 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.
| Input | |
| listener | A shared_ptr to a response queue which will receive commands. |
| true | Response queue was added successfully and will received commands. |
| false | Response queue was not added |
| DtInvalidInput | The newListener shared pointer was invalid or NULL. |
| 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.
| Input | |
| listener | A shared_ptr to a response queue which has been added. |
| DtInvalidInput | The newListener shared pointer was invalid or NULL |