zmqpp
4.1.2
C++ bindings for 0mq (libzmq)
|
The context class represents internal zmq context and io threads. More...
#include <context.hpp>
Public Member Functions | |
context () | |
Initialise the 0mq context. More... | |
~context () NOEXCEPT | |
Closes the 0mq context. More... | |
context (context &&source) NOEXCEPT | |
Move supporting constructor. More... | |
context & | operator= (context &&source) NOEXCEPT |
Move supporting operator. More... | |
void | terminate () |
Terminate the current context. More... | |
void | set (context_option const option, int const value) |
Set the value of an option in the underlaying zmq context. More... | |
int | get (context_option const option) |
Get a context option from the underlaying zmq context. More... | |
operator bool () const NOEXCEPT | |
Validity checking of the context. More... | |
operator void * () const NOEXCEPT | |
Access to the raw 0mq context. More... | |
Private Member Functions | |
context (context const &) ZMQPP_EXPLICITLY_DELETED | |
context & | operator= (context const &) NOEXCEPT ZMQPP_EXPLICITLY_DELETED |
Private Attributes | |
void * | _context |
The context class represents internal zmq context and io threads.
By default the context class will create one thread, however this can be overridden in the constructor.
The context class is the only object that can be considered thread safe.
All sockets using endpoints other than inproc require the context to have at least one thread.
This class is c++0x move supporting and cannot be copied.
|
inline |
Initialise the 0mq context.
The context is thread safe an may be used anywhere in your application, however there is no requirement (other than inproc restrictions) for you to do this.
|
inline |
Closes the 0mq context.
Any blocking calls other than a socket close will return with an error.
If there are open sockets will block while zmq internal buffers are processed up to a limit specified by that sockets linger option.
|
inline |
Move supporting constructor.
Allows zero-copy move semantics to be used with this class.
source | a rvalue instance of the object who's internals we wish to steal. |
|
private |
int zmqpp::context::get | ( | context_option const | option | ) |
Get a context option from the underlaying zmq context.
option | a valid context_option |
|
inline |
Validity checking of the context.
Checks if the underlying 0mq context for this instance is valid.
Contexts should always be valid unless people are doing 'fun' things with std::move.
|
inline |
Access to the raw 0mq context.
Move supporting operator.
Allows zero-copy move semantics to be used with this class.
source | an rvalue instance of the context who's internals we wish to steal. |
void zmqpp::context::set | ( | context_option const | option, |
int const | value | ||
) |
Set the value of an option in the underlaying zmq context.
option | a valid context_option |
value | to set the option to |
void zmqpp::context::terminate | ( | ) |
Terminate the current context.
Any blocking calls other than a socket close will return with an error.
If there are open sockets will block while zmq internal buffers are processed up to a limit specified by that sockets linger option.
|
private |