eq::net::Dispatcher Class Reference

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

#include <dispatcher.h>

Inheritance diagram for eq::net::Dispatcher:

Inheritance graph
[legend]
Collaboration diagram for eq::net::Dispatcher:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Dispatcher (const Dispatcher &from)
const Dispatcheroperator= (const Dispatcher &)
 NOP assignment operator.
virtual bool dispatchCommand (Command &command)
 Dispatch a command from the receiver thread to the registered queue.
virtual CommandResult invokeCommand (Command &command)
 Handles a received command packet for this object by calling the appropriate command handler function.

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.
CommandResult _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. Returns the result of the invoked command handlers.

Definition at line 43 of file dispatcher.h.


Member Function Documentation

const Dispatcher& eq::net::Dispatcher::operator= ( const Dispatcher  )  [inline]

NOP assignment operator.

Definition at line 51 of file dispatcher.h.

bool eq::net::Dispatcher::dispatchCommand ( Command command  )  [virtual]

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

Parameters:
command the command.
Returns:
true if the command was dispatch, false if not (command will be dispatched again later)
See also:
registerCommand

Reimplemented in eq::net::Node, eq::net::Session, and eq::server::Server.

Definition at line 75 of file dispatcher.cpp.

References eq::net::COMMAND_HANDLED, EQVERB, eq::net::Command::getPacket(), and eq::net::CommandQueue::push().

Here is the call graph for this function:

CommandResult eq::net::Dispatcher::invokeCommand ( Command command  )  [virtual]

Handles a received command packet for this object by calling the appropriate command handler function.

Parameters:
command the command.
Returns:
the result of the operation.
See also:
registerCommand

Reimplemented in eq::net::Node, eq::net::Session, and eq::server::Server.

Definition at line 112 of file dispatcher.cpp.

References eq::net::COMMAND_ERROR, and EQERROR.

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

Registers a command member function for a command.

If the destination queue is 0, the command function is invoked directly.

Parameters:
command the command.
func the functor to handle the command.
destinationQueue the queue to which the receiver thread dispatches the command.

Definition at line 112 of file dispatcher.h.

Referenced by eq::server::Window::attachToSession(), eq::Window::attachToSession(), eq::server::Pipe::attachToSession(), eq::Pipe::attachToSession(), eq::net::Object::attachToSession(), eq::server::Node::attachToSession(), eq::Node::attachToSession(), eq::FrameData::attachToSession(), eq::server::Channel::attachToSession(), eq::Channel::attachToSession(), eq::net::Barrier::attachToSession(), eq::Client::listen(), eq::net::Node::Node(), eq::net::Session::notifyMapped(), eq::server::Config::notifyMapped(), eq::Config::notifyMapped(), and eq::server::Server::Server().

Here is the caller graph for this function:

CommandResult eq::net::Dispatcher::_cmdUnknown ( Command command  )  [protected]

The default handler for handling commands.

Parameters:
command the command
Returns:
the result of the operation.

Definition at line 128 of file dispatcher.cpp.

References eq::net::COMMAND_ERROR, and EQERROR.

Referenced by eq::Config::notifyMapped().

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
Generated on Mon Aug 10 18:58:44 2009 for Equalizer 0.9 by  doxygen 1.5.8