Equalizer  1.4.1
Public Member Functions | Friends
co::ICommand Class Reference

A class managing received commands. More...

#include <iCommand.h>

+ Inheritance diagram for co::ICommand:
+ Collaboration diagram for co::ICommand:

List of all members.

Public Member Functions

CO_API ICommand (LocalNodePtr local, NodePtr remote, ConstBufferPtr buffer, const bool swap)
CO_API ICommand (const ICommand &rhs)
CO_API ICommandoperator= (const ICommand &rhs)
CO_API void clear ()
Data Access
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 >
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 &)

Detailed Description

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.


Member Function Documentation

template<typename T >
T co::ICommand::get ( ) [inline]
Returns:
a value from the command.
Version:
1.0

Definition at line 70 of file iCommand.h.

CO_API uint32_t co::ICommand::getCommand ( ) const
Returns:
the command.
Version:
1.0
Returns:
the receiving node.
Version:
1.0
CO_API NodePtr co::ICommand::getNode ( ) const
Returns:
the sending node proxy instance.
Version:
1.0
CO_API uint64_t co::ICommand::getSize_ ( ) const
Returns:
the command payload size.
Version:
1.0
CO_API uint32_t co::ICommand::getType ( ) const
Returns:
the command type.
Version:
1.0
CO_API bool co::ICommand::isValid ( ) const
Returns:
true if the command has valid data.
Version:
1.0

Referenced by co::WorkerThread< Q >::run().

+ Here is the caller graph for this function:

CO_API bool co::ICommand::operator() ( )

Invoke and clear the command function of a dispatched command.

CO_API void co::ICommand::setCommand ( const uint32_t  cmd)

Change the command for subsequent dispatching.

Set the function to which the command is dispatched.

CO_API void co::ICommand::setType ( const CommandType  type)

Change the command type for subsequent dispatching.


The documentation for this class was generated from the following file:
Generated on Mon Nov 26 2012 14:41:50 for Equalizer 1.4.1 by  doxygen 1.7.6.1