Commit Graph

209 Commits

Author SHA1 Message Date
Gudmundur Adalsteinsson
0ef29c1b30 Problem: Detail namespace used in API
Solution: Move types into zmq namespace
2019-11-12 19:54:28 +00:00
Simon Giesecke
a34d2a3da9
Merge pull request #358 from gummif/gfa/send-recv-multipart
Problem: Handling multipart messages is complex
2019-11-08 09:41:25 +01:00
Simon Giesecke
829997d4e8
Update version number to 4.6.0 to prepare for next development iteration 2019-11-04 16:44:44 +01:00
Gudmundur Adalsteinsson
505edeb336 Problem: Handling multipart messages is complex
Solution: Add generic algorithms for sending and receiving multipart
messages.
2019-10-26 19:59:46 +00:00
Gudmundur Adalsteinsson
4bc232c175 Problem: recv return value should not be ignored
Solution: add nodiscard attribute to recv functions
2019-10-26 12:31:51 +00:00
Philip Top
d5cbaf4682 Explicitly check for optional and string_view in cases where the C++17 language is operational but the standard library in use does not have those headers.
add check for using stdlibc++ with clang or icc to make sure is_trivially_copyable is available.
2019-10-14 07:58:25 -07:00
Gudmundur Adalsteinsson
34ea5b7805 Problem: Build error with clang
Solution: Some compilers incorrectly define __GNUC__, added workaround for clang and icc.
2019-09-17 20:24:44 +00:00
Gudmundur Adalsteinsson
7d9e5cb421 Add user-defined string literals to create buffers 2019-09-11 20:38:47 +00:00
Gudmundur Adalsteinsson
ab588fb7c9 Assertion and constexpr improvements for str_buffer 2019-09-11 20:21:02 +00:00
Gudmundur Adalsteinsson
13cc1e0fe9 Problem: Sending string literals is awkward
Solution: A function str_buffer specifically for
creating buffers for null terminated string literals.
2019-09-03 14:06:19 +00:00
Simon Giesecke
3b1038d035
Merge pull request #337 from gummif/gfa/clang-warnings
Problem: Warnings about send being deprecated
2019-09-02 12:26:20 +02:00
Gudmundur Adalsteinsson
e5f1a2d045 Problem: C++14 features not detected using MSVC
Solution: Detect C++14 via C++17
2019-08-31 12:07:18 +00:00
Simon Giesecke
1f66e996d5
Merge pull request #341 from gummif/gfa/cpp11-gcc
Problem: C++11 partially supported on gcc 4.8
2019-08-31 12:41:13 +02:00
Gudmundur Adalsteinsson
4f1ff4952d Fix for lacking SFINAE support on older GCC 2019-08-30 23:14:16 +00:00
Gudmundur Adalsteinsson
6137b485a0 Problem: C++11 partially supported on gcc 4.8
Solution: Use intrinsic instead of std::is_trivially_copyable for gcc
versions older than 5.
2019-08-30 20:46:32 +00:00
Jack Olivieri
f910c90149 Fix ASCII character detection in conversion to std::string
the 'Space' ASCII character should also be recognized as such.
2019-08-30 12:39:35 +02:00
Gudmundur Adalsteinsson
85b3a945d4 Problem: Warnings about send being deprecated
Solution: Refactoring and addition deprecation of a send function taking
int flags
2019-08-14 20:42:36 +00:00
Simon Giesecke
81c2938faa
Update version to v4.5.0 to prepare for next development iteration 2019-07-24 15:16:41 +02:00
Simon Giesecke
f5b36e5635
Update version to 4.4.1 2019-07-24 15:15:09 +02:00
Simon Giesecke
86876d7307
Merge pull request #328 from xiphon/fix-recv-flags-default
Fix 'recv' function 'flags_' argument default value
2019-07-24 14:42:31 +02:00
xiphon
19b5222e4e Fix 'recv' function 'flags_' argument default value 2019-06-02 02:01:42 +00:00
Simon Giesecke
4e37816dfa
Merge pull request #325 from gummif/gfa/msg-range-ctor
Problem: message_t ctor for ranges too greedy
2019-06-01 16:23:46 +02:00
Gudmundur Adalsteinsson
f412ea9e34 Improved range detection supporting ADL 2019-05-31 12:09:20 +00:00
Simon Giesecke
0672e31780
Merge pull request #324 from gummif/gfa/event-flags
Clean up and test event flags implementation
2019-05-29 08:48:47 +02:00
Simon Giesecke
7f9da8d49b
Merge pull request #323 from gummif/gfa/msg-iter-ctor
Problem: message_t ctor for iterators double initializes the message
2019-05-29 08:44:29 +02:00
Girts Folkmanis
63250e15e8 make poller_t work with ancient gcc 4.8.1
For some reason that I didn't get to the root cause, gcc 4.8.1 (that I'm
stuck with) does not like the initializer for `unique_ptr` implemented
as a lambda:

```
third_party/zmqcpp/repo/zmq.hpp: In constructor 'zmq::poller_t<T>::poller_t() [with T = std::function<void(zmq::event_flags)>]':
third_party/zmqcpp/repo/zmq.hpp:1871:5: error: converting to 'std::unique_ptr<void, zmq::poller_t<std::function<void(zmq::event_flags)> >::destroy_poller_t>' from initializer list would use explicit constructor 'std::unique_ptr<_Ty, _Dx>::unique_ptr(std::unique_ptr<_Ty, _Dx>::pointer) [with _Ty = void; _Dx = zmq::poller_t<std::function<void(zmq::event_flags)> >::destroy_poller_t; std::unique_ptr<_Ty, _Dx>::pointer = void*]'
     poller_t() = default;
     ^
In file included from networking/ipc/ipc.cc:6:0:
third_party/zmqcpp/repo/zmq_addon.hpp: At global scope:
third_party/zmqcpp/repo/zmq_addon.hpp:447:40: note: synthesized method 'zmq::poller_t<T>::poller_t() [with T = std::function<void(zmq::event_flags)>]' first required here
     poller_t<handler_type> base_poller{};
                                        ^
In file included from ./networking/ipc/ipc.h:13:0,
                 from networking/ipc/ipc.cc:1:
third_party/zmqcpp/repo/zmq.hpp: In constructor 'zmq::poller_t<T>::poller_t() [with T = zmq::socket_t]':
third_party/zmqcpp/repo/zmq.hpp:1871:5: error: converting to 'std::unique_ptr<void, zmq::poller_t<zmq::socket_t>::destroy_poller_t>' from initializer list would use explicit constructor 'std::unique_ptr<_Ty, _Dx>::unique_ptr(std::unique_ptr<_Ty, _Dx>::pointer) [with _Ty = void; _Dx = zmq::poller_t<zmq::socket_t>::destroy_poller_t; std::unique_ptr<_Ty, _Dx>::pointer = void*]'
     poller_t() = default;
     ^
networking/ipc/ipc.cc: In member function 'void networking::ipc::Ipc::ThreadMain()':
networking/ipc/ipc.cc:313:36: note: synthesized method 'zmq::poller_t<T>::poller_t() [with T = zmq::socket_t]' first required here
   ::zmq::poller_t<::zmq::socket_t> poller;
                                    ^
```

This moves the initialization to constructor, and makes gcc happy.
2019-05-28 14:14:04 -07:00
Gudmundur Adalsteinsson
2d496cb296 Remove ctor draft check 2019-05-15 17:05:34 +00:00
Gudmundur Adalsteinsson
09ab20801a Problem: message_t ctor for ranges too greedy
Solution: Detect ranges with enable_if idiom
2019-05-15 16:49:22 +00:00
Gudmundur Adalsteinsson
0ce8ef06d5 Clean up and test event flags implementation 2019-05-15 11:32:23 +00:00
Gudmundur Adalsteinsson
95d519fade Rename template parameter to reflect requirements 2019-05-15 11:20:31 +00:00
Gudmundur Adalsteinsson
1f4dd23a94 Problem: message_t ctor for iterators double initializes the message
Solution: Remove constructor call
2019-05-15 11:19:42 +00:00
Gudmundur Adalsteinsson
0458f7d16c Problem: Type-safety of poller_t and active_poller_t can be improved (#318)
Problem: Type-safety of poller_t and active_poller_t can be improved
2019-05-15 08:35:12 +02:00
Simon Giesecke
6f0fb2a3ea
Merge pull request #317 from gummif/gfa/typesafe-send-recv
Problem: send/recv functions lack type-safety
2019-05-14 18:30:34 +02:00
Gudmundur Adalsteinsson
88cee88d08 Change recv and send to return optional types 2019-05-10 14:22:04 +00:00
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
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
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
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
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
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