Equalizer  1.4.1
Public Member Functions | Static Public Member Functions | Protected Member Functions
co::OCommand Class Reference

A class for sending commands with data to local and external nodes. More...

#include <oCommand.h>

+ Inheritance diagram for co::OCommand:
+ Collaboration diagram for co::OCommand:

List of all members.

Public Member Functions

CO_API OCommand (const Connections &receivers, const uint32_t cmd, const uint32_t type=COMMANDTYPE_NODE)
 Construct a command which is send & dispatched typically to a co::Node.
CO_API OCommand (Dispatcher *const dispatcher, LocalNodePtr localNode, const uint32_t cmd, const uint32_t type=COMMANDTYPE_NODE)
 Construct a command which is dispatched locally typically to a co::Node.
CO_API OCommand (const OCommand &rhs)
virtual CO_API ~OCommand ()
 Send or dispatch this command during destruction.
CO_API void sendHeader (const uint64_t additionalSize)
 Allow external send of data along with this command.

Static Public Member Functions

static CO_API size_t getSize ()

Protected Member Functions

virtual CO_API void sendData (const void *buffer, const uint64_t size, const bool last)
 Send a data buffer (packet) to the receivers.

Detailed Description

A class for sending commands with data to local and external nodes.

The data to this command is added via the interface provided by DataOStream. The command is send or dispatched after it goes out of scope, i.e. during destruction.

Definition at line 37 of file oCommand.h.


Constructor & Destructor Documentation

CO_API co::OCommand::OCommand ( const Connections receivers,
const uint32_t  cmd,
const uint32_t  type = COMMANDTYPE_NODE 
)

Construct a command which is send & dispatched typically to a co::Node.

Parameters:
receiverslist of connections where to send the command to.
cmdthe command.
typethe command type for dispatching.
CO_API co::OCommand::OCommand ( Dispatcher *const  dispatcher,
LocalNodePtr  localNode,
const uint32_t  cmd,
const uint32_t  type = COMMANDTYPE_NODE 
)

Construct a command which is dispatched locally typically to a co::Node.

Parameters:
dispatcherthe dispatcher to dispatch this command.
localNodethe local node that holds the command cache.
cmdthe command.
typethe command type for dispatching.
virtual CO_API co::OCommand::~OCommand ( ) [virtual]

Send or dispatch this command during destruction.


Member Function Documentation

static CO_API size_t co::OCommand::getSize ( ) [static]
Returns:
the static size of this command.
virtual CO_API void co::OCommand::sendData ( const void *  buffer,
const uint64_t  size,
const bool  last 
) [protected, virtual]

Send a data buffer (packet) to the receivers.

Implements co::DataOStream.

CO_API void co::OCommand::sendHeader ( const uint64_t  additionalSize)

Allow external send of data along with this command.

Locks all connections, which will be unlocked in the dtor after potentially send padding to fill up the send to Buffer::getMinSize().

Parameters:
additionalSizesize in bytes of additional data after header.

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