mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-04-02 17:50:52 +02: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__
|
#define __ZMQ_ADDON_HPP_INCLUDED__
|
||||||
|
|
||||||
#include <zmq.hpp>
|
#include <zmq.hpp>
|
||||||
|
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@ -328,7 +329,7 @@ public:
|
|||||||
{
|
{
|
||||||
return &m_parts[index];
|
return &m_parts[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get a string copy of a specific message part
|
// Get a string copy of a specific message part
|
||||||
std::string peekstr(size_t index) const
|
std::string peekstr(size_t index) const
|
||||||
{
|
{
|
||||||
@ -582,10 +583,15 @@ private:
|
|||||||
// Disable implicit copying (moving is more efficient)
|
// Disable implicit copying (moving is more efficient)
|
||||||
multipart_t(const multipart_t& other) ZMQ_DELETED_FUNCTION;
|
multipart_t(const multipart_t& other) ZMQ_DELETED_FUNCTION;
|
||||||
void operator=(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…
x
Reference in New Issue
Block a user