Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[22317] Test service node listener #62

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
410 changes: 240 additions & 170 deletions sustainml_cpp/examples/CliModules/typesImpl.hpp

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions sustainml_cpp/examples/CliModules/typesImplCdrAux.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ eProsima_user_DllExport void serialize_key(
eprosima::fastcdr::Cdr& scdr,
const NodeStatusImpl& data);



eProsima_user_DllExport void serialize_key(
eprosima::fastcdr::Cdr& scdr,
const NodeControlImpl& data);
Expand Down
1,003 changes: 492 additions & 511 deletions sustainml_cpp/examples/CliModules/typesImplCdrAux.ipp

Large diffs are not rendered by default.

81 changes: 41 additions & 40 deletions sustainml_cpp/examples/CliModules/typesImplPubSubTypes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ bool TaskIdImplPubSubType::serialize(
ser.serialize_encapsulation();
// Serialize the object.
ser << *p_type;
ser.set_dds_cdr_options({0,0});
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand Down Expand Up @@ -128,8 +129,8 @@ uint32_t TaskIdImplPubSubType::calculate_serialized_size(
eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2);
size_t current_alignment {0};
return static_cast<uint32_t>(calculator.calculate_serialized_size(
*static_cast<const TaskIdImpl*>(data), current_alignment)) +
4u /*encapsulation*/;
*static_cast<const TaskIdImpl*>(data), current_alignment)) +
4u /*encapsulation*/;
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand Down Expand Up @@ -184,8 +185,7 @@ bool TaskIdImplPubSubType::compute_key(
TaskIdImpl_max_key_cdr_typesize);

// Object that serializes the data.
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS,
eprosima::fastcdr::CdrVersion::XCDRv2);
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
eprosima::fastcdr::serialize_key(ser, *p_type);
if (force_md5 || TaskIdImpl_max_key_cdr_typesize > 16)
Expand Down Expand Up @@ -258,6 +258,7 @@ bool NodeStatusImplPubSubType::serialize(
ser.serialize_encapsulation();
// Serialize the object.
ser << *p_type;
ser.set_dds_cdr_options({0,0});
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand Down Expand Up @@ -310,8 +311,8 @@ uint32_t NodeStatusImplPubSubType::calculate_serialized_size(
eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2);
size_t current_alignment {0};
return static_cast<uint32_t>(calculator.calculate_serialized_size(
*static_cast<const NodeStatusImpl*>(data), current_alignment)) +
4u /*encapsulation*/;
*static_cast<const NodeStatusImpl*>(data), current_alignment)) +
4u /*encapsulation*/;
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand Down Expand Up @@ -366,8 +367,7 @@ bool NodeStatusImplPubSubType::compute_key(
NodeStatusImpl_max_key_cdr_typesize);

// Object that serializes the data.
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS,
eprosima::fastcdr::CdrVersion::XCDRv2);
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
eprosima::fastcdr::serialize_key(ser, *p_type);
if (force_md5 || NodeStatusImpl_max_key_cdr_typesize > 16)
Expand Down Expand Up @@ -440,6 +440,7 @@ bool NodeControlImplPubSubType::serialize(
ser.serialize_encapsulation();
// Serialize the object.
ser << *p_type;
ser.set_dds_cdr_options({0,0});
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand Down Expand Up @@ -492,8 +493,8 @@ uint32_t NodeControlImplPubSubType::calculate_serialized_size(
eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2);
size_t current_alignment {0};
return static_cast<uint32_t>(calculator.calculate_serialized_size(
*static_cast<const NodeControlImpl*>(data), current_alignment)) +
4u /*encapsulation*/;
*static_cast<const NodeControlImpl*>(data), current_alignment)) +
4u /*encapsulation*/;
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand Down Expand Up @@ -548,8 +549,7 @@ bool NodeControlImplPubSubType::compute_key(
NodeControlImpl_max_key_cdr_typesize);

// Object that serializes the data.
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS,
eprosima::fastcdr::CdrVersion::XCDRv2);
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
eprosima::fastcdr::serialize_key(ser, *p_type);
if (force_md5 || NodeControlImpl_max_key_cdr_typesize > 16)
Expand Down Expand Up @@ -622,6 +622,7 @@ bool UserInputImplPubSubType::serialize(
ser.serialize_encapsulation();
// Serialize the object.
ser << *p_type;
ser.set_dds_cdr_options({0,0});
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand Down Expand Up @@ -674,8 +675,8 @@ uint32_t UserInputImplPubSubType::calculate_serialized_size(
eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2);
size_t current_alignment {0};
return static_cast<uint32_t>(calculator.calculate_serialized_size(
*static_cast<const UserInputImpl*>(data), current_alignment)) +
4u /*encapsulation*/;
*static_cast<const UserInputImpl*>(data), current_alignment)) +
4u /*encapsulation*/;
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand Down Expand Up @@ -730,8 +731,7 @@ bool UserInputImplPubSubType::compute_key(
UserInputImpl_max_key_cdr_typesize);

// Object that serializes the data.
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS,
eprosima::fastcdr::CdrVersion::XCDRv2);
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
eprosima::fastcdr::serialize_key(ser, *p_type);
if (force_md5 || UserInputImpl_max_key_cdr_typesize > 16)
Expand Down Expand Up @@ -804,6 +804,7 @@ bool MLModelMetadataImplPubSubType::serialize(
ser.serialize_encapsulation();
// Serialize the object.
ser << *p_type;
ser.set_dds_cdr_options({0,0});
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand Down Expand Up @@ -856,8 +857,8 @@ uint32_t MLModelMetadataImplPubSubType::calculate_serialized_size(
eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2);
size_t current_alignment {0};
return static_cast<uint32_t>(calculator.calculate_serialized_size(
*static_cast<const MLModelMetadataImpl*>(data), current_alignment)) +
4u /*encapsulation*/;
*static_cast<const MLModelMetadataImpl*>(data), current_alignment)) +
4u /*encapsulation*/;
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand Down Expand Up @@ -912,8 +913,7 @@ bool MLModelMetadataImplPubSubType::compute_key(
MLModelMetadataImpl_max_key_cdr_typesize);

// Object that serializes the data.
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS,
eprosima::fastcdr::CdrVersion::XCDRv2);
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
eprosima::fastcdr::serialize_key(ser, *p_type);
if (force_md5 || MLModelMetadataImpl_max_key_cdr_typesize > 16)
Expand Down Expand Up @@ -986,6 +986,7 @@ bool AppRequirementsImplPubSubType::serialize(
ser.serialize_encapsulation();
// Serialize the object.
ser << *p_type;
ser.set_dds_cdr_options({0,0});
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand Down Expand Up @@ -1038,8 +1039,8 @@ uint32_t AppRequirementsImplPubSubType::calculate_serialized_size(
eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2);
size_t current_alignment {0};
return static_cast<uint32_t>(calculator.calculate_serialized_size(
*static_cast<const AppRequirementsImpl*>(data), current_alignment)) +
4u /*encapsulation*/;
*static_cast<const AppRequirementsImpl*>(data), current_alignment)) +
4u /*encapsulation*/;
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand Down Expand Up @@ -1094,8 +1095,7 @@ bool AppRequirementsImplPubSubType::compute_key(
AppRequirementsImpl_max_key_cdr_typesize);

// Object that serializes the data.
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS,
eprosima::fastcdr::CdrVersion::XCDRv2);
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
eprosima::fastcdr::serialize_key(ser, *p_type);
if (force_md5 || AppRequirementsImpl_max_key_cdr_typesize > 16)
Expand Down Expand Up @@ -1168,6 +1168,7 @@ bool HWConstraintsImplPubSubType::serialize(
ser.serialize_encapsulation();
// Serialize the object.
ser << *p_type;
ser.set_dds_cdr_options({0,0});
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand Down Expand Up @@ -1220,8 +1221,8 @@ uint32_t HWConstraintsImplPubSubType::calculate_serialized_size(
eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2);
size_t current_alignment {0};
return static_cast<uint32_t>(calculator.calculate_serialized_size(
*static_cast<const HWConstraintsImpl*>(data), current_alignment)) +
4u /*encapsulation*/;
*static_cast<const HWConstraintsImpl*>(data), current_alignment)) +
4u /*encapsulation*/;
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand Down Expand Up @@ -1276,8 +1277,7 @@ bool HWConstraintsImplPubSubType::compute_key(
HWConstraintsImpl_max_key_cdr_typesize);

// Object that serializes the data.
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS,
eprosima::fastcdr::CdrVersion::XCDRv2);
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
eprosima::fastcdr::serialize_key(ser, *p_type);
if (force_md5 || HWConstraintsImpl_max_key_cdr_typesize > 16)
Expand Down Expand Up @@ -1350,6 +1350,7 @@ bool MLModelImplPubSubType::serialize(
ser.serialize_encapsulation();
// Serialize the object.
ser << *p_type;
ser.set_dds_cdr_options({0,0});
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand Down Expand Up @@ -1402,8 +1403,8 @@ uint32_t MLModelImplPubSubType::calculate_serialized_size(
eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2);
size_t current_alignment {0};
return static_cast<uint32_t>(calculator.calculate_serialized_size(
*static_cast<const MLModelImpl*>(data), current_alignment)) +
4u /*encapsulation*/;
*static_cast<const MLModelImpl*>(data), current_alignment)) +
4u /*encapsulation*/;
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand Down Expand Up @@ -1458,8 +1459,7 @@ bool MLModelImplPubSubType::compute_key(
MLModelImpl_max_key_cdr_typesize);

// Object that serializes the data.
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS,
eprosima::fastcdr::CdrVersion::XCDRv2);
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
eprosima::fastcdr::serialize_key(ser, *p_type);
if (force_md5 || MLModelImpl_max_key_cdr_typesize > 16)
Expand Down Expand Up @@ -1532,6 +1532,7 @@ bool HWResourceImplPubSubType::serialize(
ser.serialize_encapsulation();
// Serialize the object.
ser << *p_type;
ser.set_dds_cdr_options({0,0});
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand Down Expand Up @@ -1584,8 +1585,8 @@ uint32_t HWResourceImplPubSubType::calculate_serialized_size(
eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2);
size_t current_alignment {0};
return static_cast<uint32_t>(calculator.calculate_serialized_size(
*static_cast<const HWResourceImpl*>(data), current_alignment)) +
4u /*encapsulation*/;
*static_cast<const HWResourceImpl*>(data), current_alignment)) +
4u /*encapsulation*/;
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand Down Expand Up @@ -1640,8 +1641,7 @@ bool HWResourceImplPubSubType::compute_key(
HWResourceImpl_max_key_cdr_typesize);

// Object that serializes the data.
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS,
eprosima::fastcdr::CdrVersion::XCDRv2);
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
eprosima::fastcdr::serialize_key(ser, *p_type);
if (force_md5 || HWResourceImpl_max_key_cdr_typesize > 16)
Expand Down Expand Up @@ -1714,6 +1714,7 @@ bool CO2FootprintImplPubSubType::serialize(
ser.serialize_encapsulation();
// Serialize the object.
ser << *p_type;
ser.set_dds_cdr_options({0,0});
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand Down Expand Up @@ -1766,8 +1767,8 @@ uint32_t CO2FootprintImplPubSubType::calculate_serialized_size(
eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2);
size_t current_alignment {0};
return static_cast<uint32_t>(calculator.calculate_serialized_size(
*static_cast<const CO2FootprintImpl*>(data), current_alignment)) +
4u /*encapsulation*/;
*static_cast<const CO2FootprintImpl*>(data), current_alignment)) +
4u /*encapsulation*/;
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand Down Expand Up @@ -1822,8 +1823,7 @@ bool CO2FootprintImplPubSubType::compute_key(
CO2FootprintImpl_max_key_cdr_typesize);

// Object that serializes the data.
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS,
eprosima::fastcdr::CdrVersion::XCDRv2);
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
eprosima::fastcdr::serialize_key(ser, *p_type);
if (force_md5 || CO2FootprintImpl_max_key_cdr_typesize > 16)
Expand Down Expand Up @@ -1851,5 +1851,6 @@ void CO2FootprintImplPubSubType::register_type_object_representation()
register_CO2FootprintImpl_type_identifier(type_identifiers_);
}


// Include auxiliary functions like for serializing/deserializing.
#include "typesImplCdrAux.ipp"
2 changes: 0 additions & 2 deletions sustainml_cpp/examples/CliModules/typesImplPubSubTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,6 @@ class NodeStatusImplPubSubType : public eprosima::fastdds::dds::TopicDataType

};



/*!
* @brief This class represents the TopicDataType of the type NodeControlImpl defined by the user in the IDL file.
* @ingroup typesImpl
Expand Down
Loading
Loading