zmqpp  4.1.2
C++ bindings for 0mq (libzmq)
zmqpp.hpp
Go to the documentation of this file.
1 /*
2  * This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5  *
6  * This file is part of zmqpp.
7  * Copyright (c) 2011-2015 Contributors as noted in the AUTHORS file.
8  */
9 
39 #ifndef ZMQPP_ZMQPP_HPP_
40 #define ZMQPP_ZMQPP_HPP_
41 
46 #define ZMQPP_VERSION_MAJOR 4
47 
52 #define ZMQPP_VERSION_MINOR 1
53 
57 #define ZMQPP_VERSION_REVISION 1
58 
59 #include <zmq.h>
60 
61 #include "compatibility.hpp"
62 #include "context.hpp"
63 #include "exception.hpp"
64 #include "message.hpp"
65 #include "poller.hpp"
66 #include "socket.hpp"
67 #include "actor.hpp"
68 #include "reactor.hpp"
69 #include "loop.hpp"
70 #include "zap_request.hpp"
71 #include "auth.hpp"
72 
78 namespace zmqpp
79 {
80 
86 ZMQPP_EXPORT std::string version();
87 
98 ZMQPP_EXPORT void version(uint8_t& major, uint8_t& minor, uint8_t& revision);
99 
114 ZMQPP_EXPORT void zmq_version(uint8_t& major, uint8_t& minor, uint8_t& patch);
115 
116 #if (ZMQ_VERSION_MAJOR > 4) || ((ZMQ_VERSION_MAJOR == 4) && (ZMQ_VERSION_MINOR >= 1))
117 
123 ZMQPP_EXPORT bool has_capability(std::string const& capability);
124 
130 /* Protcols */
131 inline bool has_protocol_ipc() { return has_capability("ipc"); }
132 inline bool has_protocol_pgm() { return has_capability("pgm"); }
133 inline bool has_protocol_tipc() { return has_capability("tipc"); }
134 inline bool has_protocol_norm() { return has_capability("norm"); }
135 
136 /* Security Mechanisms */
137 inline bool has_security_curve() { return has_capability("curve"); }
138 inline bool has_security_gssapi() { return has_capability("gssapi"); }
139 
145 inline bool is_draft_api() { return has_capability("draft"); }
146 #endif
147 
148 typedef context context_t;
149 typedef std::string endpoint_t;
150 typedef message message_t;
151 typedef poller poller_t;
152 typedef socket socket_t;
154 }
155 
156 #endif /* ZMQPP_ZMQPP_HPP_ */
ZMQPP_EXPORT
#define ZMQPP_EXPORT
Definition: compatibility.hpp:39
message.hpp
zmqpp
C++ wrapper around zmq.
Definition: actor.cpp:30
zmqpp::version
std::string version()
Definition: zmqpp.cpp:23
loop.hpp
context.hpp
auth.hpp
zmqpp::endpoint_t
std::string endpoint_t
endpoint type
Definition: socket.hpp:37
zmqpp::poller_t
poller poller_t
poller type
Definition: zmqpp.hpp:151
zmqpp::message_t
message message_t
message type
Definition: socket.hpp:41
zmqpp::socket
The socket class represents the zmq sockets.
Definition: socket.hpp:76
zmqpp::has_security_curve
bool has_security_curve()
Definition: zmqpp.hpp:137
zap_request.hpp
zmqpp::socket_t
socket socket_t
socket type
Definition: loop.hpp:25
reactor.hpp
poller.hpp
compatibility.hpp
zmqpp::has_protocol_pgm
bool has_protocol_pgm()
Definition: zmqpp.hpp:132
zmqpp::has_capability
bool has_capability(std::string const &capability)
Definition: zmqpp.cpp:43
zmqpp::context_t
context context_t
context type
Definition: socket.hpp:40
zmqpp::is_draft_api
bool is_draft_api()
Definition: zmqpp.hpp:145
socket.hpp
zmqpp::has_protocol_norm
bool has_protocol_norm()
Definition: zmqpp.hpp:134
zmqpp::has_protocol_ipc
bool has_protocol_ipc()
The following methods are helper functions for the known capabilies that the underlaying 0mq service ...
Definition: zmqpp.hpp:131
exception.hpp
actor.hpp
zmqpp::has_security_gssapi
bool has_security_gssapi()
Definition: zmqpp.hpp:138
zmqpp::zmq_version
void zmq_version(uint8_t &major, uint8_t &minor, uint8_t &patch)
Definition: zmqpp.cpp:35
zmqpp::poller
Polling wrapper.
Definition: poller.hpp:37
zmqpp::has_protocol_tipc
bool has_protocol_tipc()
Definition: zmqpp.hpp:133