Commit Graph

22 Commits

Author SHA1 Message Date
Alberto Invernizzi
b6420aa22f fix header 2021-06-30 07:14:13 +02:00
Gudmundur Adalsteinsson
1897488a28 Problem: message_t ctor string inconsistency
Solution: Constuctor taking generic ranges including
string literals includes the null terminated char in
the message. Deprecate function and add overloads
for strings.
2020-09-07 21:37:01 +00:00
Gudmundur Adalsteinsson
1fc3a9a873 Document macro usage and simplify code 2020-05-24 21:34:42 +00:00
Simon Giesecke
b6c79eb0c8 Reformat all files with clang-format 2020-01-28 11:11:31 +01:00
Gudmundur Adalsteinsson
4f9c2ea519 Problem: message_t to string is hard
Solution: add to_string() function.
2020-01-07 19:54:47 +00:00
Gudmundur Adalsteinsson
f412ea9e34 Improved range detection supporting ADL 2019-05-31 12:09:20 +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
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
d1e7c538cc
Merge pull request #303 from gummif/gfa/swap
Problem: Missing swap functions
2019-04-04 14:51:10 +02: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
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
Pawel Kurdybacha
ae15964907 Problem: Dependency on googletest framework
Currently cppzmq as relatively simple and header only library depends on rather
complex unit test framework googletest.
Current issues:
- Googletest requires downloading and building it every time on travis
as cache support is limited there
- Googletest build is signifficant with comparison to cppzmq unittests
total runtime

Solution: Port existing tests to Catch - header only C++ framework and
gain ~20% build speed up on travis.

Why Catch?
It is well know C++ header only testing framework. It works well, it is
being kept up to date and maintainers seem to pay attention to
community's comments and issues.
We can not use Catch2 currently as we still support pre-C++11 compilers.
2018-10-17 15:22:07 +01:00
Joseph Artsimovich
751f27d635 Add support for RADIO/DISH sockets if draft API is enabled
This commit introduces new socket_type enumeration values as well
as the following supporting functions:

socket_t::join()
socket_t::leave()
message_t::group()
message_t::set_group()
2018-07-13 16:01:15 +03:00
Joseph Artsimovich
d4374cbebe Add message_t::routing_id() and set_routing_id()
Setting a routing id is necessary when sending a message through a
ZMQ_SERVER socket. See [1] for more details.

[1] http://api.zeromq.org/4-2:zmq-socket#toc5
2018-05-19 08:44:41 +03: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
Pawel Kurdybacha
5031278f18 Problem: project files do not follow clang-format 2018-05-11 20:29:15 +01:00
Simon Giesecke
4d0418750e Problem: no tests for move-assignment
Solution: added test cases
2018-04-13 11:35:00 -04:00
Simon Giesecke
438bad28e6 Problem: insufficient test cases for operator==
Solution: added test cases
2018-04-13 11:24:36 -04:00
Simon Giesecke
799c89cb09 Problem: several test cases mixed in message.constructors
Solution: split up into test cases for various ctors and equality operators
2018-04-13 11:20:07 -04:00
Pawel Kurdybacha
f518a648ef Problem: extended initializer lists only available in C++11 2018-04-14 14:06:32 +01:00
Pawel Kurdybacha
6caa5d19d3 Problem: message_t should be easier to construct
* Added overload constructor (c++11 only) taking iteratable object.
  It would be easier to use std::string, std::array etc to construct
  a message now. Making it a draft for now in case it is too greedy
  and needs to be more specialize.
* Added equal and not euqal operator to message_t as a recommended
  and expected way of comparing objects in C++.
* deprecated C style equal method as operator== should be used instead
  (point above).
* Added message_t test covering all available message_t's constructors
2018-04-14 12:13:44 +01:00