Skip to content

Commit e7c2093

Browse files
committed
Class for multipart messaging
This class handles multipart messaging. It is the C++ equivalent of zmsg.h, which is part of CZMQ (the high-level C binding). Furthermore, it is a major improvement compared to zmsg.hpp, which is part of the examples in the ØMQ Guide. Unnecessary copying is avoided by using move semantics to efficiently add/remove parts.
1 parent 68a7b09 commit e7c2093

File tree

2 files changed

+473
-0
lines changed

2 files changed

+473
-0
lines changed

zmq.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,14 @@ namespace zmq
351351
return static_cast<T const*>( data() );
352352
}
353353

354+
inline bool equal(const message_t* other) const ZMQ_NOTHROW
355+
{
356+
if (size() != other->size())
357+
return false;
358+
std::string a(data<char>(), size());
359+
std::string b(other->data<char>(), other->size());
360+
return a == b;
361+
}
354362

355363
private:
356364
// The underlying message

0 commit comments

Comments
 (0)