Commit Graph

675 Commits

Author SHA1 Message Date
Gudmundur Adalsteinsson
bbba565797 Simplify implementation of buffer creation functions 2019-05-10 13:16:10 +00:00
Gudmundur Adalsteinsson
809acb2dc8 Make buffer constructors and functions constexpr 2019-05-09 22:47:57 +00:00
Gudmundur Adalsteinsson
99d98dd217 Improved enum flags operators and tests 2019-05-09 22:33:49 +00:00
Simon Giesecke
9a60ad3fc8
Apply suggestions from code review
Co-Authored-By: gummif <ofpgummi@yahoo.com>
2019-05-08 21:37:14 +00:00
Simon Giesecke
ec8a30a050
Merge pull request #319 from gummif/gfa/msg-init
Problem: zmq_msg_init never fails
2019-05-08 23:25:48 +02:00
Simon Giesecke
5d8308d4d5
Merge pull request #321 from gummif/gfa/excl-catch-hpp
Problem: External header catch.hpp included in coverage
2019-05-08 23:23:40 +02:00
Gudmundur Adalsteinsson
3c29dc99fe Problem: External header catch.hpp included in coverage
Solution: Exclude from analysis
2019-05-08 19:53:59 +00:00
Gudmundur Adalsteinsson
e86bd7fc57 Problem: zmq_msg_init never fails
Solution: Mark functions noexcept and assert instead of throwing
2019-05-08 19:52:39 +00:00
Gudmundur Adalsteinsson
3d4be814e8 Problem: send/recv functions lack type-safety
Solution: Add functions taking buffers and enum class flags
2019-05-05 22:05:47 +00:00
Simon Giesecke
35ba5bea3b
Merge pull request #312 from gummif/gfa/socket-ref
Problem: No type-safe alternatives when polling or needing a reference to a socket
2019-05-02 14:19:40 +02:00
Simon Giesecke
9eef00e479
Merge pull request #316 from texierp/fix/cast
Use C++ cast instead of old style cast
2019-04-24 07:39:46 +02:00
Pierre-Jean Texier
82f6e93dd1 Use C++ cast instead of old style cast
This to avoid the following warning with the '-Wold-style-cast' flag enabled :

./zmq.hpp:763:29: warning: use of old-style cast [-Wold-style-cast]
             return (size_t) nbytes;
                             ^
./zmq.hpp: In member function ‘size_t zmq::socket_t::recv(void*, size_t, int)’:
./zmq.hpp:793:29: warning: use of old-style cast [-Wold-style-cast]
             return (size_t) nbytes;
2019-04-23 23:08:24 +02:00
Gudmundur Adalsteinsson
c6a3529cd1 Problem: No type-safe alternatives when polling or needing a reference to a socket
Solution: Introduce a socket_ref that is a non-owning nullable reference to a socket
2019-04-19 22:10:26 +00:00
Simon Giesecke
b0ac8acd60
Merge pull request #315 from gummif/gfa/test-warnings
Problem: Compiler warnings in tests
2019-04-15 11:54:05 +02:00
Simon Giesecke
f65ddd7597
Merge pull request #314 from gummif/gfa/msg-iter
Problem: Performance of message_t construction can be improved
2019-04-15 11:02:27 +02:00
Simon Giesecke
961bb4fb46
Merge pull request #313 from gummif/gfa/socket-ctor
Problem: socket_t can not be default constructed
2019-04-15 10:58:45 +02:00
Gudmundur Adalsteinsson
c2e595bc69 Problem: Compiler warning in tests
Solution: Fix some compiler warnings
2019-04-14 21:34:15 +00:00
Gudmundur Adalsteinsson
cff3a46b73 Problem: Performance of message_t construction can be improved
Solution: Use std::copy instead of a raw loop and fix a conversion
warning
2019-04-14 12:40:01 +00:00
Gudmundur Adalsteinsson
4ceabb37b6 Problem: socket_t can not be default constructed
Solution: Provide a default constructor
2019-04-14 12:21:30 +00:00
Simon Giesecke
132f7b00df
Merge pull request #309 from gummif/gfa/poller-millis
Problem: zmq_poller_wait_all is called with microseconds count
2019-04-07 21:15:59 +02:00
Gudmundur Adalsteinsson
ed63f9adae Problem: zmq_poller_wait_all is called with microseconds count
Solution: Change wait_all parameter type to std::chrono::milliseconds
2019-04-07 10:56:27 +00:00
Constantin Rack
454f0bfede
Merge pull request #308 from gummif/gfa/msg-empty
Problem: message_t lacks empty() function
2019-04-04 21:46:29 +02:00
Gudmundur Adalsteinsson
16f16eeaad Problem: message_t lacks empty() function
Solution: Add function and qualify with nodiscard like std types
2019-04-04 17:55:27 +00:00
Simon Giesecke
5c95a07d72
Merge pull request #306 from gummif/gfa/detect-std
Problem: Missing detection of standards greater than C++11
2019-04-04 16:56:16 +02:00
Simon Giesecke
d1e7c538cc
Merge pull request #303 from gummif/gfa/swap
Problem: Missing swap functions
2019-04-04 14:51:10 +02:00
Simon Giesecke
5c69a36b95
Merge pull request #304 from gummif/gfa/monitor-move
Problem: monitor_t incorrectly deletes socket_t move assignment operator
2019-04-04 09:15:55 +02:00
Simon Giesecke
d34f192b37
Merge pull request #305 from gummif/gfa/message-move-copy
Problem: message_t move and copy are mutating but take const
2019-04-04 09:12:11 +02:00
Gudmundur Adalsteinsson
77575ce705 Problem: Missing detection of standards greater than C++11
Solution: Add macros detecting C++14 and C++17
2019-04-03 17:03:39 +00:00
Gudmundur Adalsteinsson
b6a07be512 Problem: monitor_t incorrectly deletes socket_t move assignment operator
Solution: Implement a move assignment operator for monitor_t
2019-04-03 14:04:58 +00:00
Gudmundur Adalsteinsson
72f0e1bcba Problem: message_t move and copy are mutating but take const
Solution: Deprecate old functions and add overloads taking non-const
references
2019-04-03 13:56:11 +00:00
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
Simon Giesecke
e1fe5e5209
Merge pull request #301 from gummif/gfa/proxy
Problem: proxy is not typesafe
2019-04-01 08:28:54 +02:00
Simon Giesecke
a89e0d7b81
Merge pull request #302 from gummif/gfa/inline-mem-fn
Problem: Redundant inline specifiers for member functions
2019-04-01 08:27:22 +02:00
Gudmundur Adalsteinsson
3fecadfb86 Problem: Redundant inline specifiers for member functions
Solution: Remove specifiers, since they are implicitly inline
2019-03-31 22:39:58 +00:00
Gudmundur Adalsteinsson
1eedfaf9a5 Problem: proxy is not typesafe
Solution: Add overloads to proxy and proxy_steerable taking socket_t
objects
2019-03-31 22:30:10 +00:00
Simon Giesecke
9e03629dae
Merge pull request #298 from gummif/gfa/poll-const
Problem: poll is mutating by definition
2019-03-28 09:25:19 +01:00
Gudmundur Adalsteinsson
0e55254bd6 Problem: poll is mutating by definition
Solution: Remove const qualifiers and const_cast
2019-03-27 20:47:36 +00:00
Simon Giesecke
47df7b0cb9
Merge pull request #299 from gummif/gfa/remove-friend
Problem: Friendship between socket_t and context_t
2019-03-27 11:58:31 +01:00
Gudmundur Adalsteinsson
ff23b4ce95 Problem: Friendship between socket_t and context_t
Solution: Not needed since the void* can be obtained from the API of
context_t
2019-03-26 21:58:38 +00:00
Simon Giesecke
91fd0b5e0e
Merge pull request #297 from trya/master
Unit tests for message_t::get()
2019-03-14 20:50:39 +01:00
trya
a91522f65e Unit tests for message_t::get()
Testing ZMQ_SHARED property only, since other properties (ZMQ_MORE and
ZMQ_SRCFD) depend on socket operations.
2019-03-14 14:25:50 +01:00
Ivan Čukić
7d59f129c8 Removed warnings when compiling with C++11 enabled (#296)
* Removed warnings when compiling with C++11 enabled

* ZMQ_NOTHROW now means throw() for pre-C++11
2019-03-13 19:18:27 +01:00
Simon Giesecke
0fd9bea760
Merge pull request #295 from trya/master
Add message_t::get()
2019-03-13 11:38:49 +01:00
trya
16fa983281 Add message_t::get()
Uses zmq_msg_get() to get some integer properties on the message.
2019-03-08 16:40:21 +01:00
Luca Boccassi
bfdc7885b8
Merge pull request #292 from sigiesec/build-zeromq-4-3-1
Update default libzmq version to 4.3.1
2019-02-04 17:08:20 +00:00
Simon Giesecke
4043617afe Problem: test cases for error behaviour of (active_)poller_t failing with libzmq 4.3.x
Solution: adapt test cases to changed behaviour
2019-02-04 15:25:35 +01:00
Simon Giesecke
c5fe9d1c27 Problem: current libzmq is not tested
Solution: update default libzmq version to 4.3.1, and add explicit test for 4.2.5, update README accordingly
2019-02-04 10:32:46 +01:00
Simon Giesecke
663944180f
Merge pull request #286 from kurdybacha/ctest_integration
Problem #268: CTest output without tests details
2019-01-28 09:53:14 +01:00
Pawel Kurdybacha
6982fb7017 Problem #268: CTest output without tests details
Solution: Added integration with CTest to existing unit test framework
based on Catch. ctest -v returns list of run tests now.

Changes:

* downloading and using Catch cmake modules that `unit_tests
--list-test-names-only` for add_test internally
2019-01-23 08:48:11 +00:00
Simon Giesecke
6a4fe1fdb2
Merge pull request #285 from kurdybacha/pthread_link_issue
Problem #284: tests and pthread link error with with gcc
2019-01-23 08:32:06 +01:00