void serialize_field(
  const rosidl_typesupport_introspection_cpp::MessageMember * member,
  void * field,
  eprosima::fastcdr::Cdr & ser)
{
  if (!member->is_array_) {
    ser << *static_cast<T *>(field);
  } else if (member->array_size_ && !member->is_upper_bound_) {
    ser.serializeArray(static_cast<T *>(field), member->array_size_);
  } else {
    std::vector<T> & data = *reinterpret_cast<std::vector<T> *>(field);
    ser << data;
  }
}
void serialize_field(
  const rosidl_typesupport_introspection_c__MessageMember * member,
  void * field,
  eprosima::fastcdr::Cdr & ser)
{
  if (!member->is_array_) {
    ser << *static_cast<T *>(field);
  } else if (member->array_size_ && !member->is_upper_bound_) {
    ser.serializeArray(static_cast<T *>(field), member->array_size_);
  } else {
    auto & data = *reinterpret_cast<typename GenericCSequence<T>::type *>(field);
    ser.serializeSequence(reinterpret_cast<T *>(data.data), data.size);
  }
}
예제 #3
0
void GUID_t::serialize(eprosima::fastcdr::Cdr &cdr) const
{
    cdr.serializeArray(m_value, 16);
}
예제 #4
0
void EntityId_t::serialize(eprosima::fastcdr::Cdr &cdr) const
{
    cdr.serializeArray(entityKey_, 3);
    cdr << entityKind_;
}
예제 #5
0
void GUID_t::serialize(eprosima::fastcdr::Cdr &cdr) const
{
    cdr.serializeArray(guidPrefix_, 12);
    cdr << entityId_;
}