26 virtual void initialize(zmq::context_t& context,
const char* target)
30 m_socket =
new zmq::socket_t(context, ZMQ_PUSH);
33 typedef int ZmqSndBufSizeType;
34 ZmqSndBufSizeType msgsize =
sizeof(T);
37 std::cout<<
"connected to "<<target<<
", with msg size="<<msgsize<<
"\n";
38 }
catch(zmq::error_t err)
40 std::cout<<
"error in ZMQObjectProvider::init: "<<err.what()<<
"\n";
65 zmq::message_t message(
sizeof(T));
66 memcpy(message.data(), value,
sizeof(T));
69 }
catch(zmq::error_t err)
71 std::cout<<
"error in ZMQObjectProvider::send: "<<err.what()<<
"\n";
Definition: zmqobjectprovider.h:21
bool m_initialized
Definition: zmqobjectprovider.h:25
void send(T *value)
Definition: zmqobjectprovider.h:60
ZMQObjectProvider(const char *target)
Definition: zmqobjectprovider.h:50
zmq::socket_t * m_socket
Definition: zmqobjectprovider.h:23
virtual void initialize(zmq::context_t &context, const char *target)
Definition: zmqobjectprovider.h:26
virtual ~ZMQObjectProvider()
Definition: zmqobjectprovider.h:56
ZMQObjectProvider(zmq::context_t &context, const char *target)
Definition: zmqobjectprovider.h:45
zmq::context_t * m_context
Definition: zmqobjectprovider.h:24