zmqpp  4.1.2
C++ bindings for 0mq (libzmq)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
zmqpp Namespace Reference

C++ wrapper around zmq. More...

Namespaces

 curve
 ZMQ curve facilities.
 
 event
 
 z85
 Provide z85 encoding and decoding facilities.
 

Classes

class  actor
 An actor is a thread with a pair socket connected to its parent. More...
 
class  actor_initialization_exception
 Represents a failed zmqpp::actor initialization. More...
 
class  auth
 auth - authentication for ZeroMQ security mechanisms More...
 
struct  callback_releaser
 internal construct
 
class  context
 The context class represents internal zmq context and io threads. More...
 
class  exception
 Represents the base zmqpp exception. More...
 
class  frame
 an internal frame wrapper for a single zmq message More...
 
class  invalid_instance
 Represents an attempt to use an invalid object. More...
 
class  message
 a zmq message with optional multipart support More...
 
class  poller
 Polling wrapper. More...
 
class  reactor
 Reactor object that helps to manage multiple socket by calling a user-defined handler for each socket when a watched event occurs. More...
 
class  socket
 The socket class represents the zmq sockets. More...
 
class  z85_exception
 Thrown when an error occurs while encoding or decoding to/from z85. More...
 
class  zap_handler
 A base ZAP handler object. More...
 
class  zap_request
 A class for working with ZAP requests and replies. More...
 
class  zmq_internal_exception
 Represents internal zmq errors. More...
 

Typedefs

typedef int raw_socket_t
 
typedef socket socket_t
 socket type More...
 
typedef std::string endpoint_t
 endpoint type More...
 
typedef context context_t
 context type More...
 
typedef message message_t
 message type More...
 
typedef poller poller_t
 poller type More...
 

Enumerations

enum  order { order::big_endian, order::little_endian }
 Possible byte order types. More...
 
enum  signal : int64_t {
  signal::header = 0x0077665544332211L, signal::ok = (header << 8) | 0x00, signal::ko = (header << 8) | 0x01, signal::stop = (header << 8) | 0x02,
  signal::test = (header << 8) | 0xFF
}
 Signal is a 8 bytes integer. More...
 

Functions

uint64_t swap_if_needed (uint64_t const value_to_check)
 
uint64_t htonll (uint64_t const hostlonglong)
 
uint64_t ntohll (uint64_t const networklonglong)
 
float htonf (float value)
 
float ntohf (float value)
 
double htond (double value)
 
double ntohd (double value)
 
std::string version ()
 
void version (uint8_t &major, uint8_t &minor, uint8_t &revision)
 
void zmq_version (uint8_t &major, uint8_t &minor, uint8_t &patch)
 

Variables

ZMQPP_COMPARABLE_ENUM context_option
 possible Context options in zmq More...
 
ZMQPP_COMPARABLE_ENUM socket_security
 Socket security mechanisms allowed by zmq. More...
 
ZMQPP_COMPARABLE_ENUM socket_option
 possible Socket options in zmq More...
 
ZMQPP_COMPARABLE_ENUM socket_type
 Socket types allowed by zmq. More...
 

Detailed Description

C++ wrapper around zmq.

Todo:
cross-platform version of including headers.

All zmq++ / zmqpp functions, constants and classes live within this namespace,

Typedef Documentation

context type

typedef std::string zmqpp::endpoint_t

endpoint type

message type

poller type

typedef int zmqpp::raw_socket_t

socket type

Enumeration Type Documentation

enum zmqpp::order
strong

Possible byte order types.

An enumeration of all the known order types, all two of them. There is also an entry for unknown which is just used as a default.

Enumerator
big_endian 

byte order is big endian

little_endian 

byte order is little endian

enum zmqpp::signal : int64_t
strong

Signal is a 8 bytes integer.

7 first bytes acts as a magic number so we can distinguish signal from other message. The last byte is the signal's value.

Enumerator
header 

Only 7 bytes matter here.

ok 

Indicates a success.

ko 

Indicates an error.

stop 

Indicates a request to stop.

This is used from parent thread to child within the actor class

test 

Function Documentation

double zmqpp::htond ( double  value)
inline

double precision floating point version of the htons/htonl

Parameters
valuehost order double precision floating point
Returns
network order double precision floating point
float zmqpp::htonf ( float  value)
inline

floating point version of the htons/htonl

Parameters
valuehost order floating point
Returns
network order floating point
uint64_t zmqpp::htonll ( uint64_t const  hostlonglong)
inline

64 bit version of the htons/htonl

I've used the name htonll to try and keep with the htonl naming scheme. We do not define this function if the macro htonll exists.

Parameters
hostlonglongunsigned 64 bit host order integer
Returns
unsigned 64 bit network order integer
double zmqpp::ntohd ( double  value)
inline

double precision floating point version of the ntohs/ntohl

Parameters
valuenetwork order double precision floating point
Returns
host order double precision floating point
float zmqpp::ntohf ( float  value)
inline

floating point version of the ntohs/ntohl

Parameters
valuenetwork order float
Returns
host order float
uint64_t zmqpp::ntohll ( uint64_t const  networklonglong)
inline

64 bit version of the ntohs/ntohl

I've used the name htonll to try and keep with the htonl naming scheme. We do not define this function if the macro ntohll exists.

Parameters
networklonglongunsigned 64 bit network order integer
Returns
unsigned 64 bit host order integer
uint64_t zmqpp::swap_if_needed ( uint64_t const  value_to_check)
inline

Common code for the 64bit versions of htons/htons and ntohs/ntohl

As htons and ntohs (or htonl and ntohs) always just do the same thing, ie swap bytes if the host order differs from network order or otherwise don't do anything, it seemed silly to type the code twice.

Note
This code assumes network order is always big endian. Which it is.
The host endian is only checked once and afterwards assumed to remain the same.
Parameters
value_to_checkunsigned 64 bit integer to swap
Returns
swapped (or not) unsigned 64 bit integer
std::string zmqpp::version ( )

Returns the current major.minor.revision version number as a string.

Returns
string version number.
void zmqpp::version ( uint8_t &  major,
uint8_t &  minor,
uint8_t &  revision 
)

Retrieve the parts of the zmqpp version number.

Set the three parameters to values representing the zmqpp version number. These values are generated at library compile time.

Parameters
majoran unsigned 8 bit reference to set to the major version.
minoran unsigned 8 bit reference to set to the minor version.
revisionan unsigned 8 bit reference to set the current revision.
void zmqpp::zmq_version ( uint8_t &  major,
uint8_t &  minor,
uint8_t &  patch 
)

Retrieve the parts of the 0mq version this library was built against.

Because sections of the library are optionally compiled in or ignored depending on the version of 0mq it was compiled against this method is provided to allow sanity checking for usage.

Set the three parameters to values representing the 0mq version number. These values are generated at library compile time.

Parameters
majoran unsigned 8 bit reference to set to the major version.
minoran unsigned 8 bit reference to set to the minor version.
revisionan unsigned 8 bit reference to set the current revision.

Variable Documentation

ZMQPP_COMPARABLE_ENUM zmqpp::context_option
Initial value:
{
io_threads = ZMQ_IO_THREADS,
max_sockets = ZMQ_MAX_SOCKETS,
ipv6 = ZMQ_IPV6
}

possible Context options in zmq

Todo:
Expand the information on the options to make it actually useful.

I/O thread count Maximum supported sockets Enable ipv6 for all new sockets

ZMQPP_COMPARABLE_ENUM zmqpp::socket_option

possible Socket options in zmq

Todo:
Expand the information on the options to make it actually useful.

I/O thread affinity Socket identity Add topic subscription - set only Remove topic subscription - set only Multicast data rate Kernel transmission buffer size Kernel receive buffer size Can receive more parts - get only Socket file descriptor - get only Socket event flags - get only Socket type - get only Socket linger timeout Maximum length of outstanding connections - get only Reconnection interval Maximum reconnection interval Maximum inbound block timeout Maximum outbound block timeout Multicast recovery interval in milliseconds Maximum inbound message size High-water mark for outbound messages High-water mark for inbound messages Maximum number of multicast hops Block message sending until connect complete Last bound endpoint - get only Require routable messages - set only Pass on existing subscriptions - set only Enable TCP keepalives TCP keepalive idle count (generally retry count) TCP keepalive retry count TCP keepalive interval Filter inbound connections - set only IPv6 socket support status Socket security mechanism - get only PLAIN password PLAIN server role PLAIN username RFC 27 authentication domain Keep only last message - set only CURVE public key CURVE secret key CURVE server key CURVE server role - set only Bootstrap connections to ROUTER sockets - set only Match replies with requests - set only Relax strict alternation between request and reply - set only Switch ROUTER socket to raw mode - set only Maximum handshake interval Type-of-Service socket override status Assign the next outbound connection id - set only Group ID filters to allow new IPC connections - set only Process ID filters to allow new IPC connections - set only User ID filters to allow new IPC connections - set only Handle duplicate client identities on ROUTER sockets - set only

ZMQPP_COMPARABLE_ENUM zmqpp::socket_security
Initial value:
{
none = ZMQ_NULL,
plain = ZMQ_PLAIN,
curve = ZMQ_CURVE,
}

Socket security mechanisms allowed by zmq.

Each is designed for a different use and has different limitations.

ZMQPP_COMPARABLE_ENUM zmqpp::socket_type

Socket types allowed by zmq.

The socket type choose at creation must be one of these types.

Each is designed for a different use and has different limitations.version of ::publish to match zmq name convention version of ::subscribe to match zmq name convention version of ::request to match zmq name convention version of ::reply to match zmq name convention version of ::xpublish to match zmq name convention version of ::xsubscribe to match zmq name convention version of ::xrequest to match zmq name convention version of ::xreply to match zmq name convention

Deprecated:
Matches zmq 2.x xrep functionality.
Deprecated:
Matches zmq 2.x xreq functionality.