Overview Tutorial API reference Examples Build Download ZmqMessage 0.1 - 21 Oct 2011

ZmqMessage::Sink Class Reference

Base class for Outgoing message, does not depend on Routing policy. More...

#include <ZmqMessage.hpp>

Inheritance diagram for ZmqMessage::Sink:

ZmqMessage::Private::NonCopyable ZmqMessage::Outgoing< RoutingPolicy > List of all members.

Public Member Functions

virtual ~Sink ()
const Multipartincoming () const
Multipartdetach ()
bool is_queued () const
bool is_dropping () const
zmq::socket_t & dst ()
void flush () throw (ZmqErrorType)
void set_binary ()
void set_text ()
void send_incoming_messages (size_t idx_from=0, size_t idx_to=UINT_MAX) throw (ZmqErrorType)
void send_incoming_messages (Multipart &multipart, bool copy, size_t idx_from=0, size_t idx_to=UINT_MAX) throw (ZmqErrorType)
void relay_from (zmq::socket_t &relay_src) throw (ZmqErrorType)
template<class OccupationAccumulator>
void relay_from (zmq::socket_t &relay_src, OccupationAccumulator acc) throw (ZmqErrorType)
template<typename T>
Sinkoperator<< (const T &t) throw (ZmqErrorType)
Sinkoperator<< (zmq::message_t &msg) throw (ZmqErrorType)
Sinkoperator<< (MsgPtr msg) throw (ZmqErrorType)
Sinkoperator<< (const RawMessage &m) throw (ZmqErrorType)
Sinkoperator<< (Sink &(*f)(Sink &))

Protected Member Functions

 Sink (zmq::socket_t &dst, unsigned options, Multipart *incoming=0)
unsigned options () const
void send_one (zmq::message_t *msg, bool use_copy=false) throw (ZmqErrorType)

Classes

class  iterator
 Output iterator to facilitate inserting of message parts into outgoing message. More...

Detailed Description

Base class for Outgoing message, does not depend on Routing policy.

After Outgoing message is created, it's functionality (append and send messages, caching, etc.) does not depend on RoutingPolicy template parameter, so it may be referenced as Sink class.


Constructor & Destructor Documentation

ZmqMessage::Sink::Sink ( zmq::socket_t &  dst,
unsigned  options,
Multipart incoming = 0 
) [inline, protected]

ZmqMessage::Sink::~Sink (  )  [virtual]


Member Function Documentation

Multipart* ZmqMessage::Sink::detach (  )  [inline]

Detach heap-allocated outgoing queue (Multipart message). This object's outgoing_queue_ is set to 0.

zmq::socket_t& ZmqMessage::Sink::dst (  )  [inline]

Returns:
destination socket

void ZmqMessage::Sink::flush (  )  throw (ZmqErrorType)

Finally send or enqueue pending (cached) messages if any

const Multipart* ZmqMessage::Sink::incoming (  )  const [inline]

Get pointer to incoming message this outgoing message is linked to.

Returns:
null if not linked.

bool ZmqMessage::Sink::is_dropping (  )  const [inline]

Immediate send has failed (blocking) and we are dropping inserted messages

bool ZmqMessage::Sink::is_queued (  )  const [inline]

Returns:
if we have enqueued message parts in outgoing queue.

Sink& ZmqMessage::Sink::operator<< ( Sink &(*)(Sink &)  f  )  [inline]

Handle a manipulator

Sink & ZmqMessage::Sink::operator<< ( const RawMessage m  )  throw (ZmqErrorType)

Insert raw message (see RawMessage)

Sink& ZmqMessage::Sink::operator<< ( MsgPtr  msg  )  throw (ZmqErrorType) [inline]

Either, we take ownership on message. Not checking if this message is part of incoming_. If ptr contains 0, null message is sent

Sink & ZmqMessage::Sink::operator<< ( zmq::message_t &  msg  )  throw (ZmqErrorType)

Note, we take ownership on message (unless message is part of incoming_ and COPY_INCOMING option is set). We invalidate incoming_'s ownership on this message (if COPY_INCOMING option is NOT set). Do not pass stack-allocated messages if this object is planned to be detached and used beyond current block.

template<typename T>
Sink & ZmqMessage::Sink::operator<< ( const T &  t  )  throw (ZmqErrorType)

Lowest priority in overload. Uses ZmqMessage::init_msg functions to compose message part and send.

unsigned ZmqMessage::Sink::options (  )  const [inline, protected]

template<class OccupationAccumulator>
void ZmqMessage::Sink::relay_from ( zmq::socket_t &  relay_src,
OccupationAccumulator  acc 
) throw (ZmqErrorType)

Receive and send/enqueue pending messages from relay_src socket, counting sizes of received messages OccupationAccumulator unary functor accepting size_t

void ZmqMessage::Sink::relay_from ( zmq::socket_t &  relay_src  )  throw (ZmqErrorType)

Receive and send/enqueue pending messages from relay_src socket

void ZmqMessage::Sink::send_incoming_messages ( Multipart multipart,
bool  copy,
size_t  idx_from = 0,
size_t  idx_to = UINT_MAX 
) throw (ZmqErrorType)

Send all messages contained in given incoming starting from idx_from ending idx_to - 1

void ZmqMessage::Sink::send_incoming_messages ( size_t  idx_from = 0,
size_t  idx_to = UINT_MAX 
) throw (ZmqErrorType)

Send all messages contained in incoming_ starting from idx_from ending idx_to - 1

void ZmqMessage::Sink::send_one ( zmq::message_t *  msg,
bool  use_copy = false 
) throw (ZmqErrorType) [protected]

void ZmqMessage::Sink::set_binary (  )  [inline]

void ZmqMessage::Sink::set_text (  )  [inline]


The documentation for this class was generated from the following files:
ZmqMessage 0.1 — open source software, support@zmqmessage.org