Skip to content

Commit

Permalink
Refs #21349. Apply suggestion of new compute_key
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo González Moreno <[email protected]>
  • Loading branch information
richiware committed Jul 15, 2024
1 parent 34eb92e commit 8230b3e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ public:
const void* const data,
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;

eProsima_user_DllExport bool compute_key(
eprosima::fastdds::rtps::SerializedPayload_t* payload,
eprosima::fastdds::rtps::InstanceHandle_t* ihandle,
bool force_md5 = false) override;

eProsima_user_DllExport bool compute_key(
const void* const data,
eprosima::fastdds::rtps::InstanceHandle_t* ihandle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,25 @@ void $struct.name$PubSubType::delete_data(
delete(reinterpret_cast<$struct.name$*>(data));
}

bool $struct.name$PubSubType::compute_key(
SerializedPayload_t* payload,
InstanceHandle_t* handle,
bool force_md5)
{
if (!is_compute_key_provided)
{
return false;
}

$struct.name$ data;
if (deserialize(payload, static_cast<void*>(&data)))
{
return compute_key(static_cast<void*>(&data), handle, force_md5);
}

return false;
}

bool $struct.name$PubSubType::compute_key(
const void* const data,
InstanceHandle_t* handle,
Expand Down

0 comments on commit 8230b3e

Please sign in to comment.