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

ZmqMessage::Multipart Class Reference

Basic holder of message parts. More...

#include <ZmqMessage.hpp>

Inheritance diagram for ZmqMessage::Multipart:

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

Public Member Functions

virtual ~Multipart ()
Multipartdetach ()
bool has_part (size_t idx)
void reserve (size_t sz)
template<typename T>
iterator< T > begin (bool binary_mode=false) const
iterator< ZMQMESSAGE_STRING_CLASS > beginstr () const
template<typename T>
iterator< T > iter_at (size_t pos, bool binary_mode=false) const
template<typename T>
iterator< T > end () const
iterator< ZMQMESSAGE_STRING_CLASS > endstr () const
size_t size () const
zmq::message_t & operator[] (size_t i) throw (NoSuchPartError)
zmq::message_t * release (size_t i)
std::auto_ptr< zmq::message_t > release_ptr (size_t i)

Protected Member Functions

void check_has_part (size_t n) const throw (NoSuchPartError)

Protected Attributes

MsgPtrVec parts_

Friends

class Sink
void send (zmq::socket_t &sock, Multipart &multipart, bool nonblock) throw (ZmqErrorType)

Classes

class  iterator
 Input iterator to iterate over message parts. More...

Detailed Description

Basic holder of message parts.


Constructor & Destructor Documentation

virtual ZmqMessage::Multipart::~Multipart (  )  [inline, virtual]


Member Function Documentation

template<typename T>
iterator<T> ZmqMessage::Multipart::begin ( bool  binary_mode = false  )  const [inline]

Obtain iterator that yields values of type T.

Parameters:
binary_mode,: how to convert message part to T: interprete as string data (if binary_mode is false) or interpret as binary data (if true). T must be explicitly specified:
 it = multipart.begin<std::string>();

iterator<ZMQMESSAGE_STRING_CLASS> ZmqMessage::Multipart::beginstr (  )  const [inline]

Obtain iterator that yields values of default string type.

void ZmqMessage::Multipart::check_has_part ( size_t  n  )  const throw (NoSuchPartError) [protected]

Multipart * ZmqMessage::Multipart::detach (  ) 

Detach heap-allocated Multipart message owning all the parts of this multipart. After this operation, current object owns no message parts.

template<typename T>
iterator<T> ZmqMessage::Multipart::end (  )  const [inline]

End iterator that yields values of type T.

iterator<ZMQMESSAGE_STRING_CLASS> ZmqMessage::Multipart::endstr (  )  const [inline]

End iterator that yields values of default string type.

bool ZmqMessage::Multipart::has_part ( size_t  idx  )  [inline]

Does this multipart message has a part at given index (and owns it)

template<typename T>
iterator<T> ZmqMessage::Multipart::iter_at ( size_t  pos,
bool  binary_mode = false 
) const [inline]

Obtain iterator positioned to message part at specified index

Parameters:
pos index, counts from 0.
binary_mode,: how to convert message part to non-string type: interprete as string data (if binary_mode is false) or interpret as binary data (if true).

zmq::message_t & ZmqMessage::Multipart::operator[] ( size_t  i  )  throw (NoSuchPartError)

Get reference to zmq::message_t by index

zmq::message_t * ZmqMessage::Multipart::release ( size_t  i  ) 

Release (disown) message at specified index.

Returns:
0 if such message is not owned by Multipart

std::auto_ptr<zmq::message_t> ZmqMessage::Multipart::release_ptr ( size_t  i  )  [inline]

void ZmqMessage::Multipart::reserve ( size_t  sz  )  [inline]

Reserve enough memory for given number of message parts

size_t ZmqMessage::Multipart::size (  )  const [inline]

Returns:
number of parts in this multipart


Friends And Related Function Documentation

void send ( zmq::socket_t &  sock,
Multipart multipart,
bool  nonblock 
) throw (ZmqErrorType) [friend]

Send given message to destination socket

friend class Sink [friend]


Member Data Documentation

MsgPtrVec ZmqMessage::Multipart::parts_ [protected]


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