Template Function mrpt::serialization::mrpt_send_to_zmq

Function Documentation

template<typename ZMQ_SOCKET_TYPE>
void mrpt::serialization::mrpt_send_to_zmq(ZMQ_SOCKET_TYPE zmq_socket, const mrpt::serialization::CSerializable &obj, const size_t max_packet_len = 0)

Send an MRPT object to a ZMQ socket.

Note

Including <mrpt/serialization/serialization_zmq.h> requires libzmq to be available in your system and linked to your user code. This function can be used even if MRPT was built without ZMQ support, thanks to the use of templates.

Parameters:
  • obj[in] The object to be serialized and sent to the socket.

  • zmq_socket[in] The zmq socket object.

  • max_packet_len[in] The object will be split into a series of ZMQ “message parts” of this maximum length (in bytes). Default=0, which means do not split in parts.

Throws:

std::exception – If the object finds any critical error during serialization or on ZMQ errors.