Skip to content

Commit

Permalink
Refs #21349. Apply suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>
  • Loading branch information
richiware committed Jul 15, 2024
1 parent 3984949 commit 3759961
Show file tree
Hide file tree
Showing 138 changed files with 25,725 additions and 2,737 deletions.
19 changes: 19 additions & 0 deletions examples/cpp/configuration/ConfigurationPubSubTypes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,25 @@ void ConfigurationPubSubType::delete_data(
delete(reinterpret_cast<Configuration*>(data));
}

bool ConfigurationPubSubType::compute_key(
SerializedPayload_t* payload,
InstanceHandle_t* handle,
bool force_md5)
{
if (!is_compute_key_provided)
{
return false;
}

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

return false;
}

bool ConfigurationPubSubType::compute_key(
const void* const data,
InstanceHandle_t* handle,
Expand Down
5 changes: 5 additions & 0 deletions examples/cpp/configuration/ConfigurationPubSubTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ class ConfigurationPubSubType : public eprosima::fastdds::dds::TopicDataType
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
19 changes: 19 additions & 0 deletions examples/cpp/content_filter/HelloWorldPubSubTypes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,25 @@ void HelloWorldPubSubType::delete_data(
delete(reinterpret_cast<HelloWorld*>(data));
}

bool HelloWorldPubSubType::compute_key(
SerializedPayload_t* payload,
InstanceHandle_t* handle,
bool force_md5)
{
if (!is_compute_key_provided)
{
return false;
}

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

return false;
}

bool HelloWorldPubSubType::compute_key(
const void* const data,
InstanceHandle_t* handle,
Expand Down
5 changes: 5 additions & 0 deletions examples/cpp/content_filter/HelloWorldPubSubTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType
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
19 changes: 19 additions & 0 deletions examples/cpp/custom_payload_pool/HelloWorldPubSubTypes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,25 @@ void HelloWorldPubSubType::delete_data(
delete(reinterpret_cast<HelloWorld*>(data));
}

bool HelloWorldPubSubType::compute_key(
SerializedPayload_t* payload,
InstanceHandle_t* handle,
bool force_md5)
{
if (!is_compute_key_provided)
{
return false;
}

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

return false;
}

bool HelloWorldPubSubType::compute_key(
const void* const data,
InstanceHandle_t* handle,
Expand Down
5 changes: 5 additions & 0 deletions examples/cpp/custom_payload_pool/HelloWorldPubSubTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType
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 @@ -148,6 +148,25 @@ void FlowControlExamplePubSubType::delete_data(
delete(reinterpret_cast<FlowControlExample*>(data));
}

bool FlowControlExamplePubSubType::compute_key(
SerializedPayload_t* payload,
InstanceHandle_t* handle,
bool force_md5)
{
if (!is_compute_key_provided)
{
return false;
}

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

return false;
}

bool FlowControlExamplePubSubType::compute_key(
const void* const data,
InstanceHandle_t* handle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ class FlowControlExamplePubSubType : public eprosima::fastdds::dds::TopicDataTyp
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 @@ -148,6 +148,25 @@ void HelloWorldPubSubType::delete_data(
delete(reinterpret_cast<HelloWorld*>(data));
}

bool HelloWorldPubSubType::compute_key(
SerializedPayload_t* payload,
InstanceHandle_t* handle,
bool force_md5)
{
if (!is_compute_key_provided)
{
return false;
}

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

return false;
}

bool HelloWorldPubSubType::compute_key(
const void* const data,
InstanceHandle_t* handle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType
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 @@ -148,6 +148,25 @@ void HelloWorldPubSubType::delete_data(
delete(reinterpret_cast<HelloWorld*>(data));
}

bool HelloWorldPubSubType::compute_key(
SerializedPayload_t* payload,
InstanceHandle_t* handle,
bool force_md5)
{
if (!is_compute_key_provided)
{
return false;
}

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

return false;
}

bool HelloWorldPubSubType::compute_key(
const void* const data,
InstanceHandle_t* handle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType
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
19 changes: 19 additions & 0 deletions examples/cpp/dds/HelloWorldExampleTCP/HelloWorldPubSubTypes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,25 @@ void HelloWorldPubSubType::delete_data(
delete(reinterpret_cast<HelloWorld*>(data));
}

bool HelloWorldPubSubType::compute_key(
SerializedPayload_t* payload,
InstanceHandle_t* handle,
bool force_md5)
{
if (!is_compute_key_provided)
{
return false;
}

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

return false;
}

bool HelloWorldPubSubType::compute_key(
const void* const data,
InstanceHandle_t* handle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType
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
19 changes: 19 additions & 0 deletions examples/cpp/dds/Keys/samplePubSubTypes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,25 @@ void samplePubSubType::delete_data(
delete(reinterpret_cast<sample*>(data));
}

bool samplePubSubType::compute_key(
SerializedPayload_t* payload,
InstanceHandle_t* handle,
bool force_md5)
{
if (!is_compute_key_provided)
{
return false;
}

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

return false;
}

bool samplePubSubType::compute_key(
const void* const data,
InstanceHandle_t* handle,
Expand Down
5 changes: 5 additions & 0 deletions examples/cpp/dds/Keys/samplePubSubTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ class samplePubSubType : public eprosima::fastdds::dds::TopicDataType
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
38 changes: 38 additions & 0 deletions examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,25 @@ void RequestTypePubSubType::delete_data(
delete(reinterpret_cast<RequestType*>(data));
}

bool RequestTypePubSubType::compute_key(
SerializedPayload_t* payload,
InstanceHandle_t* handle,
bool force_md5)
{
if (!is_compute_key_provided)
{
return false;
}

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

return false;
}

bool RequestTypePubSubType::compute_key(
const void* const data,
InstanceHandle_t* handle,
Expand Down Expand Up @@ -309,6 +328,25 @@ void ReplyTypePubSubType::delete_data(
delete(reinterpret_cast<ReplyType*>(data));
}

bool ReplyTypePubSubType::compute_key(
SerializedPayload_t* payload,
InstanceHandle_t* handle,
bool force_md5)
{
if (!is_compute_key_provided)
{
return false;
}

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

return false;
}

bool ReplyTypePubSubType::compute_key(
const void* const data,
InstanceHandle_t* handle,
Expand Down
10 changes: 10 additions & 0 deletions examples/cpp/dds/RequestReplyExample/CalculatorPubSubTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ class RequestTypePubSubType : public eprosima::fastdds::dds::TopicDataType
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 Expand Up @@ -139,6 +144,11 @@ class ReplyTypePubSubType : public eprosima::fastdds::dds::TopicDataType
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
Loading

0 comments on commit 3759961

Please sign in to comment.