Commit Graph

22 Commits

Author SHA1 Message Date
Gudmundur Adalsteinsson
83b91c8b7e Problem: Missing swap functions
Solution: Implement for socket_t, context_t, message_t and poller_t
Additionally remove dependency on <functional> by refactoring poller_t
and remove unused <unordered_map> include.
2019-04-03 13:23:17 +00:00
tangfu
5af24314c3 add front and back (#269)
* add front and back

i'll get the last message in some situations,but have to do like this :
```
multimsg msgs;
auto msg = msgs[msgs.size() - 1];
func(msg.size());
auto *msg = msgs.end() - 1;
```
but, std::queue have some method 'front' and 'back'. so maybe i can simply do this ? :
```
multimsg msgs;
auto msg = msgs.back();
```

* add test for front and back
2018-10-17 08:41:21 +01:00
Pawel Kurdybacha
ff3c221516 Problem: whitespace style too restrictive.
For header only library like cppzmq, whitespace style inherited from
libzmq is too restrictive.

Solution: relaxing whitespace before parens from always to in control
statements only, increased max column width from 80 to 85 and removing
requirement of whitespace after template keyword.
2018-05-12 17:28:28 +01:00
Giesecke
65ae6b33fd Problem: poller_t::wait_all and active_poller_t::wait declare int return type but actually return an element count
Solution: change return type to size_t, remove a redundant if in consequence
2018-05-12 09:18:46 +02:00
Pawel Kurdybacha
cd72eef3fd Problem: zmq_addon.hpp not follow clang-format 2018-05-11 20:32:23 +01:00
Simon Giesecke
3251d05636 Problem: creation of poller_events is unnecessarily complex
Solution: simplify code
2018-05-11 11:35:11 +02:00
Simon Giesecke
f700e5d6b0 Problem: deprecation warning in multipart_t
Solution: use non-deprecated operator!= instead
2018-05-11 11:33:54 +02:00
Simon Giesecke
882f5e844c Problem: extra abstraction layer type poller_t is in zmq.hpp
Solution: move to zmq_addon.hpp, rename to active_poller_t, and rename base_poller_t to poller_t
2018-05-11 11:33:53 +02:00
Simon Giesecke
dc996cd2ec Problem: zmq_addon header contains tests (with a syntax error)
Solution: convert to googletest based test, and fix syntax error
2018-05-11 11:33:53 +02:00
Giuseppe Corbelli
f945a7d032 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
2018-03-07 14:11:41 +01:00
Martl
a475c54529 changed peektyp() to const 2017-08-17 21:56:16 +02:00
Martl
e6dd71e544 fixed peektyp check and return value 2017-08-17 21:03:36 +02:00
Luca Boccassi
d9f0f016c0 Problem: copyright years out of date
Solution: update them
List the ZeroMQ community as a shorthand for the full list of authors
as it can be found via git log
2017-07-31 14:30:55 +01:00
Vincent Tellier
0ffe2f4974 Added peekstr and peektyp methods
These methods peeks a part and return a copy of its value as a string or the specified type.
2017-06-07 09:54:37 +02:00
laplaceyang
aac1c8ac50 fix warning unused but set variable 2016-12-29 22:57:17 +08:00
laplaceyang
5cd848273a add iterator 2016-12-08 22:03:13 +08:00
laplaceyang
3483416e5a addd operator[] and at function 2016-12-08 20:46:52 +08:00
laplaceyang
72f53c8fdd lack of head file 2016-12-08 11:03:25 +08:00
Rolf Timmermans
e138b74cde Constructor for std::exception does not take string argument. 2016-10-28 14:53:22 +02:00
Harald Nøkland
da1b5e3e23 Add comments, optimize some functions, add static asserts
Add comments to all functions. Optimize move constructor and move assigment operator, remove size check inside pop/remove/peek. Static assert in pushtyp/addtyp/poptyp in order to avoid pitfall with std::string (pushstr/addstr/popstr should be used for that). Add sanity check for poptyp, size of message must match desired type.
2016-10-23 00:27:12 +02:00
Elliot Saba
93af23a58e Enable passing flags in to send() and recv() 2016-08-14 16:46:43 -07:00
Harald Nøkland
e7c2093581 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.
2016-04-06 14:20:10 +02:00