zeromq/cppzmq — a backend project — sits at 2.3k GitHub stars in the Backend space. Header-only C++ binding for libzmq
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
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 Catch are required.
Any libzmq 4.x version is expected to work. DRAFT features may only work for the most recent tested version. Currently explicitly tested libzmq versions are
4.2.0 (without DRAFT API)
4.3.4 (with and without DRAFT API)
Platforms with full support (i.e. CI executing build and tests)
Ubuntu 18.04 x64 (with gcc 4.8.5, 5.5.0, 7.5.0)
Ubuntu 20.04 x64 (with gcc 9.3.0, 10.3.0 and clang 12)
Visual Studio 2017 x64
Visual Studio 2019 x64
macOS 10.15 (with clang 12, without DRAFT API)
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.4.1 or newer)
See the examples directory for more examples. When the project is compiled with tests enabled, each example gets compiled to an executable.
API Overview
For an extensive overview of the zmq.hpp API in use, see this Tour of CPPZMQ by @brettviren.
Bindings for libzmq in zmq.hpp:
Types:
class zmq::context_t
enum zmq::ctxopt
class zmq::socket_t
class zmq::socket_ref
enum zmq::socket_type
enum zmq::sockopt
enum zmq::send_flags
enum zmq::recv_flags
class zmq::message_t
class zmq::const_buffer
class zmq::mutable_buffer
struct zmq::recv_buffer_size
alias zmq::send_result_t
alias zmq::recv_result_t
alias zmq::recv_buffer_result_t
class zmq::error_t
class zmq::monitor_t
struct zmq_event_t,
alias zmq::free_fn,
alias zmq::pollitem_t,
alias zmq::fd_t
class zmq::poller_t DRAFT
enum zmq::event_flags DRAFT
enum zmq::poller_event DRAFT
Functions:
zmq::version
zmq::poll
zmq::proxy
zmq::proxy_steerable
zmq::buffer
zmq::str_buffer
Extra high-level types and functions zmq_addon.hpp:
Types:
class zmq::multipart_t
class zmq::active_poller_t DRAFT
Functions:
zmq::recv_multipart
zmq::send_multipart
zmq::send_multipart_n
zmq::encode
zmq::decode
Compatibility Guidelines
The users of cppzmq are expected to follow the guidelines below to ensure not to break when upgrading cppzmq to newer versions (non-exhaustive list):
Do not depend on any macros defined in cppzmq unless explicitly declared public here.
The following macros may be used by consumers of cppzmq: CPPZMQ_VERSION, CPPZMQ_VERSION_MAJOR, CPPZMQ_VERSION_MINOR, CPPZMQ_VERSION_PATCH.
Contribution policy
The contribution policy is at: http://rfc.zeromq.org/spec:22
Build instructions
Build steps:
Build libzmq via cmake. This does an out of source build and installs the build files
git clone https://github.com/zeromq/libzmq.git
cd libzmq
mkdir build
cd build
cmake ..
sudo make -j4 install
Build cppzmq via cmake. This does an out of source build and installs the build files
git clone https://github.com/zeromq/cppzmq.git
cd cppzmq
mkdir build
cd build
cmake .. or cmake -DCPPZMQ_BUILD_TESTS=OFF .. to skip building tests
sudo make -j4 install
Alternatively, build cppzmq via vcpkg. This does an out of source build and installs the build files
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh (bootstrap-vcpkg.bat for Powershell)
./vcpkg integrate install
./vcpkg install cppzmq
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)
target_link_libraries(*Your Project Name* cppzmq)
# Or use static library to link
target_link_libraries(*Your Project Name* cppzmq-static)
How does zeromq/cppzmq compare to other Backend projects?
zeromq/cppzmq is tracked by TopGit in the Backend category, with 2.3k GitHub stars and written in C++. Browse the Backend topic page on TopGit to compare it against similar projects by stars and activity.
How many stars does zeromq/cppzmq have?
zeromq/cppzmq has 2.3k GitHub stars — refresh the page for the live number, or check github.com/zeromq/cppzmq. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is zeromq/cppzmq open source?
Yes — zeromq/cppzmq ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/zeromq/cppzmq.
What else is in the Backend space?
zeromq/cppzmq is tracked by TopGit under the Backend category, alongside 6 GitHub-tagged topics. Trending and Topics pages list peer repositories of comparable stars and language.
What is zeromq/cppzmq?
zeromq/cppzmq (zeromq/cppzmq) is a C++ project on GitHub. From the project's own README: Header-only C++ binding for libzmq
Where can I see zeromq/cppzmq in action?
The project maintains a homepage at http://www.zeromq.org. The README tab on this page also usually contains screenshots and a quickstart.
Where do I read more about zeromq/cppzmq?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/zeromq/cppzmq is the definitive source.
Read full README in the tab above.
Want a second opinion on cppzmq?
Ask an AI that can read this page — one click and you get its take on cppzmq.