Equalizer 1.0

co::Dispatcher Class Reference

A helper class providing command packet dispatch functionality to networked objects. More...

#include <dispatcher.h>

Inheritance diagram for co::Dispatcher:
Collaboration diagram for co::Dispatcher:

List of all members.

Public Member Functions

CO_API Dispatcher (const Dispatcher &from)
const Dispatcheroperator= (const Dispatcher &)
 NOP assignment operator.
virtual CO_API bool dispatchCommand (Command &command)
 Dispatch a command from the receiver thread to the registered queue.

Public Types

typedef CommandFunc< DispatcherFunc

Protected Member Functions

template<typename T >
void registerCommand (const uint32_t command, const CommandFunc< T > &func, CommandQueue *destinationQueue)
 Registers a command member function for a command.
CO_API bool _cmdUnknown (Command &command)
 The default handler for handling commands.

Detailed Description

A helper class providing command packet dispatch functionality to networked objects.

Provides packet dispatch through a command queue and command handler table.

Definition at line 36 of file dispatcher.h.


Member Function Documentation

CO_API bool co::Dispatcher::_cmdUnknown ( Command command) [protected]

The default handler for handling commands.

Parameters:
commandthe command
Returns:
the result of the operation.
virtual CO_API bool co::Dispatcher::dispatchCommand ( Command command) [virtual]

Dispatch a command from the receiver thread to the registered queue.

Parameters:
commandthe command.
Returns:
true if the command was dispatched, false if not.
See also:
registerCommand

Reimplemented in co::LocalNode, and eq::fabric::Client.

const Dispatcher& co::Dispatcher::operator= ( const Dispatcher ) [inline]

NOP assignment operator.

Definition at line 46 of file dispatcher.h.

template<typename T >
void co::Dispatcher::registerCommand ( const uint32_t  command,
const CommandFunc< T > &  func,
CommandQueue destinationQueue 
) [protected]

Registers a command member function for a command.

If the destination queue is 0, the command function is invoked directly upon dispatch, otherwise it is invoked during the processing of the command queue.

Parameters:
commandthe command.
functhe functor to handle the command.
destinationQueuethe queue to which the receiver thread dispatches the command.

Definition at line 97 of file dispatcher.h.


The documentation for this class was generated from the following file:
Generated on Sun May 8 2011 19:11:08 for Equalizer 1.0 by  doxygen 1.7.3