Skip to content

Commit 55c2eea

Browse files
authored
Merge pull request #97 from laplaceyang/pr_direct_access
addd operator[] and at function for direct access msgs
2 parents 28c7c8c + 3483416 commit 55c2eea

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

zmq_addon.hpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,26 @@ class multipart_t
9393
clear();
9494
}
9595

96+
message_t& operator[] (size_t n)
97+
{
98+
return m_parts[n];
99+
}
100+
101+
const message_t& operator[] (size_t n) const
102+
{
103+
return m_parts[n];
104+
}
105+
106+
message_t& at (size_t n)
107+
{
108+
return m_parts.at(n);
109+
}
110+
111+
const message_t& at (size_t n) const
112+
{
113+
return m_parts.at(n);
114+
}
115+
96116
// Delete all parts
97117
void clear()
98118
{

0 commit comments

Comments
 (0)