Go to file
Simon Giesecke bc82352c95
Merge pull request #226 from kurdybacha/clang-format
Problem: inconsistent code style
2018-05-11 23:21:45 +02:00
cmake Problem: version detection broken, confuses libzmq and cppzmq versions 2018-03-28 12:58:12 +02:00
demo Problem: project files do not follow clang-format 2018-05-11 20:29:15 +01:00
external/gtest-demo Problem: no test infrastructure 2018-03-29 18:11:28 +02:00
libzmq-pkg-config Problem: No tests for libzmq 4.2.0 2018-04-03 18:41:44 +02:00
tests Problem: project files do not follow clang-format 2018-05-11 20:29:15 +01:00
.clang-format Problem: trailing whitespaces in clang-format file 2018-05-11 20:08:26 +01:00
.gitignore .gitignore added 2017-01-09 11:50:50 +01:00
.travis.yml Problem: no build/tests with DRAFT 2018-04-03 18:41:44 +02:00
appveyor.yml Problem: Missing -D flag causes build failure. 2018-04-22 18:09:10 +01:00
ci_build.sh Problem: no build/tests with DRAFT 2018-04-03 18:41:44 +02:00
CMakeLists.txt Fix message using empty version variable 2018-05-08 09:34:35 -04:00
cppzmqConfig.cmake.in fix updated FindZeroMQ 2018-01-15 10:43:00 -08:00
LICENSE Added license and link to C4.1 contribution policy 2013-05-10 07:39:40 -04:00
README.md Problem: design goals and supported platforms are not explicitly stated 2018-05-11 14:09:11 +02:00
version.sh Problem: version detection broken, confuses libzmq and cppzmq versions 2018-03-28 12:58:12 +02:00
zmq_addon.hpp Problem: zmq_addon.hpp not follow clang-format 2018-05-11 20:32:23 +01:00
zmq.hpp Problem: project files do not follow clang-format 2018-05-11 20:29:15 +01:00

Travis-CI Status Appveyor Status Coverage Status

Introduction & Design Goals

cppzmq is a C++ binding for libzmq. It has the following design goals:

  • cppzmq maps the libzmq C API to C++ concepts. In particular:
    • it is type-safe (the libzmq C API exposes various class-like concepts as void*)
    • it provides exception-based error handling (the libzmq C API provides errno-based error handling)
    • it provides RAII-style classes that automate resource management (the libzmq C API requires the user to take care to free resources explicitly)
  • cppzmq is a light-weight, header-only binding. You only need to include the header file zmq.hpp (and maybe zmq_addon.hpp) to use it.
  • zmq.hpp is meant to contain direct mappings of the abstractions provided by the libzmq C API, while zmq_addon.hpp provides additional higher-level abstractions.

There are other C++ bindings for ZeroMQ with different design goals. In particular, none of the following bindings are header-only:

  • zmqpp is a high-level binding to libzmq.
  • czmqpp is a binding based on the high-level czmq API.
  • fbzmq is a binding that integrates with Apache Thrift and provides higher-level abstractions in addition. It requires C++14.

Supported platforms

  • Only a subset of the platforms that are supported by libzmq itself are supported. Some features already require a compiler supporting C++11. In the future, probably all features will require C++11. To build and run the tests, cmake and googletest are required.
  • Tested libzmq versions are
    • 4.2.0 (without DRAFT API)
    • 4.2.5 (with and without DRAFT API)
  • Platforms with full support (i.e. CI executing build and tests)
    • Ubuntu 14.04 x64 (with gcc 4.8.4) (without DRAFT API only)
    • Ubuntu 14.04 x64 (with gcc 7.3.0)
    • Visual Studio 2015 x86
    • Visual Studio 2017 x86
  • Additional platforms that are known to work:
    • We have no current reports on additional platforms that are known to work yet. Please add your platform here. If CI can be provided for them with a cloud-based CI service working with GitHub, you are invited to add CI, and make it possible to be included in the list above.
  • Additional platforms that probably work:
    • Any platform supported by libzmq that provides a sufficiently recent gcc (4.8.1 or newer) or clang (3.3 or newer)
    • MacOS X
    • Visual Studio 2012+ x86/x64

Contribution policy

The contribution policy is at: http://rfc.zeromq.org/spec:22

Build instructions

Build steps:

  1. Build libzmq via cmake. This does an out of source build and installs the build files

    • download and unzip the lib, cd to directory
    • mkdir build
    • cd build
    • cmake ..
    • sudo make -j4 install
  2. Build cppzmq via cmake. This does an out of source build and installs the build files

    • download and unzip the lib, cd to directory
    • mkdir build
    • cd build
    • cmake ..
    • sudo make -j4 install

Using this:

A cmake find package scripts is provided for you to easily include this library. Add these lines in your CMakeLists.txt to include the headers and library files of cpp zmq (which will also include libzmq for you).

#find cppzmq wrapper, installed by make of cppzmq
find_package(cppzmq)
if(cppzmq_FOUND)
    include_directories(${ZeroMQ_INCLUDE_DIR} ${cppzmq_INCLUDE_DIR})
    target_link_libraries(*Your Project Name* ${cppzmq_LIBRARY})
endif()