22 #include <fastcdr/FastBuffer.h> 23 #include <fastcdr/Cdr.h> 34 setName(
"std_msgs::msg::dds_::Header_");
36 type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4);
37 m_typeSize =
static_cast<uint32_t
>(type_size) + 4;
41 m_keyBuffer =
reinterpret_cast<unsigned char*
>(malloc(keyLength));
60 eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(payload->data), payload->max_size);
62 eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR);
63 payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;
65 ser.serialize_encapsulation();
68 payload->length =
static_cast<uint32_t
>(ser.getSerializedDataLength());
80 eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(payload->data), payload->length);
83 eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR);
86 deser.read_encapsulation();
87 payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;
97 return [data]() -> uint32_t
106 return reinterpret_cast<void*
>(
new Header());
112 delete(
reinterpret_cast<Header*
>(data));
120 if (!m_isGetKeyDefined)
128 eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(
m_keyBuffer),
132 eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS);
137 m_md5.update(
m_keyBuffer, static_cast<unsigned int>(ser.getSerializedDataLength()));
139 for (uint8_t i = 0; i < 16; ++i)
141 handle->value[i] =
m_md5.digest[i];
146 for (uint8_t i = 0; i < 16; ++i)
eprosima::fastrtps::rtps::InstanceHandle_t InstanceHandle_t
eprosima::fastrtps::rtps::SerializedPayload_t SerializedPayload_t