|
Collage
1.0.1
Object-Oriented C++ Network Library
|
A class providing command dispatch functionality to networked objects. More...
#include <dispatcher.h>
Inheritance diagram for co::Dispatcher:Public Types | |
| typedef CommandFunc< Dispatcher > | Func |
| The signature of the base Dispatcher callback. More... | |
Public Member Functions | |
| const Dispatcher & | operator= (const Dispatcher &) |
| template<typename T > | |
| void | registerCommand (const uint32_t command, const CommandFunc< T > &func, CommandQueue *queue) |
| Register a command member function for a command. More... | |
| virtual CO_API bool | dispatchCommand (ICommand &command) |
| Dispatch a command from the receiver thread to the registered queue. More... | |
Protected Member Functions | |
| CO_API | Dispatcher (const Dispatcher &from) |
| CO_API bool | _cmdUnknown (ICommand &command) |
| The default handler for handling commands. More... | |
A class providing command dispatch functionality to networked objects.
Command dispatch in performed through a command queue and command handler table.
Definition at line 38 of file dispatcher.h.
| typedef CommandFunc< Dispatcher > co::Dispatcher::Func |
The signature of the base Dispatcher callback.
Definition at line 42 of file dispatcher.h.
|
protected |
The default handler for handling commands.
| command | the command |
|
virtual |
Dispatch a command from the receiver thread to the registered queue.
| command | the command. |
Reimplemented in co::LocalNode.
| void co::Dispatcher::registerCommand | ( | const uint32_t | command, |
| const CommandFunc< T > & | func, | ||
| CommandQueue * | queue | ||
| ) |
Register a command member function for a command.
If the destination queue is 0, the command function is invoked directly upon dispatch, otherwise it is pushed to the given queue and invoked during the processing of the command queue.
| command | the command. |
| func | the functor to handle the command. |
| queue | the queue to which the the command is dispatched |
Definition at line 94 of file dispatcher.h.
1.8.5