Skip to content

Commit

Permalink
Refs #20676: add message_type_support_key_callbacks_t to message_type…
Browse files Browse the repository at this point in the history
…_support

Signed-off-by: Mario Dominguez <[email protected]>
  • Loading branch information
Mario-DL authored and MiguelCompany committed Mar 29, 2024
1 parent 175cd1f commit 530b8a6
Showing 1 changed file with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,38 @@
#define ROSIDL_TYPESUPPORT_FASTRTPS_BOUNDED_TYPE 0x01
#define ROSIDL_TYPESUPPORT_FASTRTPS_PLAIN_TYPE 0x03

// Holds generated methods related with keys
typedef struct message_type_support_key_callbacks_t
{
/// Callback function to determine the maximum size needed for key serialization,
/// which is used for key type support initialization.
/**
* \param [in,out] is_unbounded Whether the key has any unbounded member.
* \return The maximum key serialized size, in bytes.
*/
size_t (* max_serialized_size_key)(
bool & is_unbounded);

/// Callback function to get size of the key data
/**
* \param [in] untyped_ros_message Type erased pointer to message instance
* \return The size of the serialized key in bytes.
*/
size_t (* get_serialized_size_key)(
const void * untyped_ros_message);

/// Callback function for key serialization
/**
* \param[in] untyped_ros_message Type erased pointer to message instance.
* \param [in,out] Serialized FastCDR data object.
* \return true if serialization succeeded, false otherwise.
*/
bool (* cdr_serialize_key)(
const void * untyped_ros_message,
eprosima::fastcdr::Cdr & cdr);

} message_type_support_key_callbacks_t;

/// Encapsulates the callbacks for getting properties of this rosidl type.
/**
* These callbacks are implemented in the generated sources.
Expand Down Expand Up @@ -76,6 +108,11 @@ typedef struct message_type_support_callbacks_t
* \return The maximum serialized size, in bytes.
*/
size_t (* max_serialized_size)(char & bounds_info);

/// Pointer to the message_type_support_key_callbacks_t.
/// Nullptr if the type is not keyed.
message_type_support_key_callbacks_t * key_callbacks;

} message_type_support_callbacks_t;

#endif // ROSIDL_TYPESUPPORT_FASTRTPS_CPP__MESSAGE_TYPE_SUPPORT_H_

0 comments on commit 530b8a6

Please sign in to comment.