Template Function MessageSerialization::serialize

Function Documentation

template<typename MembersType>
void MessageSerialization::serialize(const void *msg, const MembersType *casted_members, cbor::TxStream &stream)

Serialize a ROS message, request or response.

Every time ROS has data to send in the channel a memory location is passed with the corresponding message member type, and this function separates all the fields into elementary C or C++ types. Then the serialize_field function is called to encode the specific data.

Parameters:
  • msg – Pointer to the first byte of the message in memory

  • casted_members – Pointer to the member containing type support informations

  • stream – The stream used to send data