mirror of
https://github.com/zeromq/cppzmq.git
synced 2024-12-13 10:52:57 +01:00
Added an operator<<(std::ostream) to easily print out multipart_t contents using already defined str() method.
Added some comments to mark the end of preprocessor instructions / class def / namespace def
This commit is contained in:
parent
a96e0ded64
commit
f945a7d032
@ -25,6 +25,7 @@
|
||||
#define __ZMQ_ADDON_HPP_INCLUDED__
|
||||
|
||||
#include <zmq.hpp>
|
||||
|
||||
#include <deque>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
@ -328,7 +329,7 @@ public:
|
||||
{
|
||||
return &m_parts[index];
|
||||
}
|
||||
|
||||
|
||||
// Get a string copy of a specific message part
|
||||
std::string peekstr(size_t index) const
|
||||
{
|
||||
@ -582,10 +583,15 @@ private:
|
||||
// Disable implicit copying (moving is more efficient)
|
||||
multipart_t(const multipart_t& other) ZMQ_DELETED_FUNCTION;
|
||||
void operator=(const multipart_t& other) ZMQ_DELETED_FUNCTION;
|
||||
};
|
||||
}; // class multipart_t
|
||||
|
||||
#endif
|
||||
#endif // ZMQ_HAS_RVALUE_REFS
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& os, const multipart_t& msg)
|
||||
{
|
||||
return os << msg.str();
|
||||
}
|
||||
|
||||
#endif
|
||||
} // namespace zmq
|
||||
|
||||
#endif // __ZMQ_ADDON_HPP_INCLUDED__
|
||||
|
Loading…
Reference in New Issue
Block a user