Public Member Functions |
CO_API | ICommand (LocalNodePtr local, NodePtr remote, ConstBufferPtr buffer, const bool swap) |
CO_API | ICommand (const ICommand &rhs) |
CO_API ICommand & | operator= (const ICommand &rhs) |
CO_API void | clear () |
|
CO_API uint32_t | getType () const |
CO_API uint32_t | getCommand () const |
CO_API uint64_t | getSize_ () const |
CO_API ConstBufferPtr | getBuffer () const |
template<typename T > |
T | get () |
CO_API NodePtr | getNode () const |
CO_API LocalNodePtr | getLocalNode () const |
CO_API bool | isValid () const |
|
CO_API void | setType (const CommandType type) |
| Change the command type for subsequent dispatching.
|
CO_API void | setCommand (const uint32_t cmd) |
| Change the command for subsequent dispatching.
|
void | setDispatchFunction (const Dispatcher::Func &func) |
| Set the function to which the command is dispatched.
|
CO_API bool | operator() () |
| Invoke and clear the command function of a dispatched command.
|
Friends |
CO_API std::ostream & | operator<< (std::ostream &, const ICommand &) |
A class managing received commands.
This class is used by the LocalNode to pass received buffers to the Dispatcher and ultimately command handler functions. It is not intended to be instantiated by applications. The derivates of this ICommand have to be instaniated by the application if the command type requires it. The data retrieval is possible with the provided DataIStream methods or with the templated get() function.
Definition at line 41 of file iCommand.h.