Overview Tutorial API reference Examples Build Download | ZmqMessage 0.1 - 21 Oct 2011 |
#include <ZmqMessage.hpp>
Inheritance diagram for ZmqMessage::Sink:
Public Member Functions | |
virtual | ~Sink () |
const Multipart * | incoming () const |
Multipart * | detach () |
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> | |
Sink & | operator<< (const T &t) throw (ZmqErrorType) |
Sink & | operator<< (zmq::message_t &msg) throw (ZmqErrorType) |
Sink & | operator<< (MsgPtr msg) throw (ZmqErrorType) |
Sink & | operator<< (const RawMessage &m) throw (ZmqErrorType) |
Sink & | operator<< (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... |
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.
ZmqMessage::Sink::Sink | ( | zmq::socket_t & | dst, | |
unsigned | options, | |||
Multipart * | incoming = 0 | |||
) | [inline, protected] |
ZmqMessage::Sink::~Sink | ( | ) | [virtual] |
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] |
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.
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] |
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.
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] |
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] |