36 static std::unique_ptr<ZeroMQSvc> svc;
38 svc = std::make_unique<ZeroMQSvc>();
68 }
catch (zmq::error_t &
e) {
69 std::cerr <<
"ERROR: Creating ZeroMQ context failed. This only happens when PGM initialization failed or when "
70 "a nullptr was returned from zmq_ctx_new because the created context was invalid. Contact ZMQ "
71 "experts when this happens, because it shouldn't.\n";
89 }
catch (zmq::error_t &
e) {
91 std::cerr <<
"ERROR in ZeroMQSvc::socket: " <<
e.what() <<
" (errno: " <<
e.num() <<
")\n";
107 }
catch (zmq::error_t &
e) {
109 std::cerr <<
"ERROR in ZeroMQSvc::socket_ptr: " <<
e.what() <<
" (errno: " <<
e.num() <<
")\n";
131 return encode(*item, fun);
139 return encode(item.c_str());
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
ZeroMQSvc & zmqSvc()
Get singleton object of this class.
auto retry_send(zmq::socket_t &socket, int max_tries, args_t... args) -> decltype(socket.send(args...))
Wrapper class for basic ZeroMQ context and socket management.
zmq::context_t * m_context
zmq::message_t encode(const T &item, std::function< size_t(const T &t)> sizeFun=ZMQ::defaultSizeOf< T >) const
encode message to ZMQ
zmq::send_result_t send(zmq::socket_t &socket, const T &item, zmq::send_flags flags=zmq::send_flags::none) const
Send message with ZMQ.
zmq::socket_t * socket_ptr(zmq::socket_type type) const
Create and return a new socket by pointer.
Encoding encoding() const
zmq::context_t & context() const
Get context.
zmq::socket_t socket(zmq::socket_type type) const
Create and return a new socket.
void close_context() const
void setEncoding(const Encoding &e)
Set encoding mode.
std::size_t stringLength(const char &cs)