30 OpenSpliceDDSBroker::OpenSpliceDDSBroker()
42 void OpenSpliceDDSBroker::broadcast(
const std::vector<uint8_t>& msg_data)
45 unsigned int bufsize = msg_data.size();
46 if(!msg_data.empty()) {
47 dds_msg.
data.replace(bufsize, bufsize, (
char*)(&msg_data[0]),
false);
48 packet_publisher_->publish(dds_msg);
54 int msgLen = dds_msg.
data.length();
56 std::cout<<
"opensplice dds recv error."<<std::endl;
59 uint8_t* buf = (uint8_t*)malloc(
sizeof(uint8_t)*msgLen);
60 memcpy(buf, dds_msg.
data.get_buffer(), msgLen);
61 parser_.parse(buf, msgLen);
65 void OpenSpliceDDSBroker::receive()
67 boost::function<void(const opensplice_dds_broker::GSDFPacket&)> func = boost::bind(&OpenSpliceDDSBroker::callback,
this, _1);
68 packet_subscriber_->subscribe(func);
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)