Skip to content

Commit

Permalink
Add support for Extended Incompatible QoS (#257)
Browse files Browse the repository at this point in the history
* Refs #22066: Update & regenerate monitorservice types

Signed-off-by: Carlosespicur <[email protected]>

* Refs #22066: Add Extended Incompatible QoS sample processing methods

Signed-off-by: Carlosespicur <[email protected]>

* Refs #22066: Add tests for extended incompatible QoS samples

* Refs #22066: Uncrustify

Signed-off-by: Carlosespicur <[email protected]>

* Refs #22066: Fix failed tests

Signed-off-by: Carlosespicur <[email protected]>

* Refs #22066: Fix compilation in Windows 2019

Signed-off-by: Carlos Espinoza Curto <[email protected]>

---------

Signed-off-by: Carlosespicur <[email protected]>
Signed-off-by: Carlos Espinoza Curto <[email protected]>
  • Loading branch information
Carlosespicur authored Dec 10, 2024
1 parent b5f636a commit ba2a608
Show file tree
Hide file tree
Showing 37 changed files with 10,115 additions and 7,600 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/configurations/Windows/colcon.meta
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"cmake-args":
[
"-DCMAKE_CXX_FLAGS='/WX /EHsc'",
"-DCMAKE_CXX_FLAGS='/WX /EHsc /bigobj'",
"-Ax64",
"-T host=x64"
]
Expand Down
6 changes: 5 additions & 1 deletion docs/rst/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ Colcon
datareader
datasharing
datawriter
Deserialize
destructor
eprosima
eProsima
ExtendedIncompatibleQosSample
Foonathan
gcovr
Github
Gtest
guid
intraprocess
metatraffic
monitorization
Expand All @@ -28,7 +32,7 @@ preprocessed
Qos
QoS
Subclassed
Todo
timepoint
Todo
uncorrectly
wget
13 changes: 5 additions & 8 deletions examples/cpp/HelloWorldExample/HelloWorld.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ class HelloWorld
eProsima_user_DllExport HelloWorld(
const HelloWorld& x)
{
m_index = x.m_index;
m_index = x.m_index;

m_message = x.m_message;
m_message = x.m_message;

}

Expand All @@ -105,9 +105,9 @@ class HelloWorld
const HelloWorld& x)
{

m_index = x.m_index;
m_index = x.m_index;

m_message = x.m_message;
m_message = x.m_message;

return *this;
}
Expand All @@ -133,7 +133,7 @@ class HelloWorld
const HelloWorld& x) const
{
return (m_index == x.m_index &&
m_message == x.m_message);
m_message == x.m_message);
}

/*!
Expand Down Expand Up @@ -174,7 +174,6 @@ class HelloWorld
return m_index;
}


/*!
* @brief This function copies the value in member message
* @param _message New value to be copied in member message
Expand Down Expand Up @@ -213,8 +212,6 @@ class HelloWorld
return m_message;
}



private:

uint32_t m_index{0};
Expand Down
28 changes: 13 additions & 15 deletions examples/cpp/HelloWorldExample/HelloWorldCdrAux.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ eProsima_user_DllExport size_t calculate_serialized_size(
current_alignment)};


calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0),
data.index(), current_alignment);
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0),
data.index(), current_alignment);

calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1),
data.message(), current_alignment);
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1),
data.message(), current_alignment);


calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment);
Expand All @@ -76,7 +76,7 @@ eProsima_user_DllExport void serialize(
scdr
<< eprosima::fastcdr::MemberId(0) << data.index()
<< eprosima::fastcdr::MemberId(1) << data.message()
;
;
scdr.end_serialize_type(current_state);
}

Expand All @@ -93,13 +93,13 @@ eProsima_user_DllExport void deserialize(
bool ret_value = true;
switch (mid.id)
{
case 0:
dcdr >> data.index();
break;
case 0:
dcdr >> data.index();
break;

case 1:
dcdr >> data.message();
break;
case 1:
dcdr >> data.message();
break;

default:
ret_value = false;
Expand All @@ -116,14 +116,12 @@ void serialize_key(

static_cast<void>(scdr);
static_cast<void>(data);
scdr << data.index();
scdr << data.index();

scdr << data.message();
scdr << data.message();

}



} // namespace fastcdr
} // namespace eprosima

Expand Down
8 changes: 4 additions & 4 deletions examples/cpp/HelloWorldExample/HelloWorldPubSubTypes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ uint32_t HelloWorldPubSubType::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 HelloWorld*>(data), current_alignment)) +
4u /*encapsulation*/;
*static_cast<const HelloWorld*>(data), current_alignment)) +
4u /*encapsulation*/;
}
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
{
Expand Down Expand Up @@ -184,7 +184,8 @@ bool HelloWorldPubSubType::compute_key(
HelloWorld_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 || HelloWorld_max_key_cdr_typesize > 16)
Expand Down Expand Up @@ -212,6 +213,5 @@ void HelloWorldPubSubType::register_type_object_representation()
register_HelloWorld_type_identifier(type_identifiers_);
}


// Include auxiliary functions like for serializing/deserializing.
#include "HelloWorldCdrAux.ipp"
62 changes: 42 additions & 20 deletions examples/cpp/HelloWorldExample/HelloWorldTypeObjectSupport.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ void register_HelloWorld_type_identifier(

ReturnCode_t return_code_HelloWorld {eprosima::fastdds::dds::RETCODE_OK};
return_code_HelloWorld =
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().
get_type_identifiers(
"HelloWorld", type_ids_HelloWorld);
if (eprosima::fastdds::dds::RETCODE_OK != return_code_HelloWorld)
{
StructTypeFlag struct_flags_HelloWorld = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::FINAL,
false, false);
StructTypeFlag struct_flags_HelloWorld = TypeObjectUtils::build_struct_type_flag(
eprosima::fastdds::dds::xtypes::ExtensibilityKind::FINAL,
false, false);
QualifiedTypeName type_name_HelloWorld = "HelloWorld";
eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_HelloWorld;
eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_HelloWorld;
Expand All @@ -61,15 +63,18 @@ void register_HelloWorld_type_identifier(
ann_custom_HelloWorld = tmp_ann_custom_HelloWorld;
}

CompleteTypeDetail detail_HelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HelloWorld, ann_custom_HelloWorld, type_name_HelloWorld.to_string());
CompleteTypeDetail detail_HelloWorld = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_HelloWorld,
ann_custom_HelloWorld,
type_name_HelloWorld.to_string());
CompleteStructHeader header_HelloWorld;
header_HelloWorld = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_HelloWorld);
CompleteStructMemberSeq member_seq_HelloWorld;
{
TypeIdentifierPair type_ids_index;
ReturnCode_t return_code_index {eprosima::fastdds::dds::RETCODE_OK};
return_code_index =
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().
get_type_identifiers(
"_uint32_t", type_ids_index);

if (eprosima::fastdds::dds::RETCODE_OK != return_code_index)
Expand All @@ -78,11 +83,15 @@ void register_HelloWorld_type_identifier(
"index Structure member TypeIdentifier unknown to TypeObjectRegistry.");
return;
}
StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
false, false, false, false);
StructMemberFlag member_flags_index = TypeObjectUtils::build_struct_member_flag(
eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
false, false, false, false);
MemberId member_id_index = 0x00000000;
bool common_index_ec {false};
CommonStructMember common_index {TypeObjectUtils::build_common_struct_member(member_id_index, member_flags_index, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_index, common_index_ec))};
CommonStructMember common_index {TypeObjectUtils::build_common_struct_member(member_id_index,
member_flags_index, TypeObjectUtils::retrieve_complete_type_identifier(
type_ids_index,
common_index_ec))};
if (!common_index_ec)
{
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure index member TypeIdentifier inconsistent.");
Expand All @@ -91,15 +100,19 @@ void register_HelloWorld_type_identifier(
MemberName name_index = "index";
eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_index;
ann_custom_HelloWorld.reset();
CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index, member_ann_builtin_index, ann_custom_HelloWorld);
CompleteStructMember member_index = TypeObjectUtils::build_complete_struct_member(common_index, detail_index);
CompleteMemberDetail detail_index = TypeObjectUtils::build_complete_member_detail(name_index,
member_ann_builtin_index,
ann_custom_HelloWorld);
CompleteStructMember member_index =
TypeObjectUtils::build_complete_struct_member(common_index, detail_index);
TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_index);
}
{
TypeIdentifierPair type_ids_message;
ReturnCode_t return_code_message {eprosima::fastdds::dds::RETCODE_OK};
return_code_message =
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().
get_type_identifiers(
"anonymous_string_unbounded", type_ids_message);

if (eprosima::fastdds::dds::RETCODE_OK != return_code_message)
Expand All @@ -112,15 +125,19 @@ void register_HelloWorld_type_identifier(
"anonymous_string_unbounded", type_ids_message))
{
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
"anonymous_string_unbounded already registered in TypeObjectRegistry for a different type.");
"anonymous_string_unbounded already registered in TypeObjectRegistry for a different type.");
}
}
}
StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
false, false, false, false);
StructMemberFlag member_flags_message = TypeObjectUtils::build_struct_member_flag(
eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
false, false, false, false);
MemberId member_id_message = 0x00000001;
bool common_message_ec {false};
CommonStructMember common_message {TypeObjectUtils::build_common_struct_member(member_id_message, member_flags_message, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_message, common_message_ec))};
CommonStructMember common_message {TypeObjectUtils::build_common_struct_member(member_id_message,
member_flags_message, TypeObjectUtils::retrieve_complete_type_identifier(
type_ids_message,
common_message_ec))};
if (!common_message_ec)
{
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure message member TypeIdentifier inconsistent.");
Expand All @@ -129,17 +146,22 @@ void register_HelloWorld_type_identifier(
MemberName name_message = "message";
eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_message;
ann_custom_HelloWorld.reset();
CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message, member_ann_builtin_message, ann_custom_HelloWorld);
CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message, detail_message);
CompleteMemberDetail detail_message = TypeObjectUtils::build_complete_member_detail(name_message,
member_ann_builtin_message,
ann_custom_HelloWorld);
CompleteStructMember member_message = TypeObjectUtils::build_complete_struct_member(common_message,
detail_message);
TypeObjectUtils::add_complete_struct_member(member_seq_HelloWorld, member_message);
}
CompleteStructType struct_type_HelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloWorld, header_HelloWorld, member_seq_HelloWorld);
CompleteStructType struct_type_HelloWorld = TypeObjectUtils::build_complete_struct_type(struct_flags_HelloWorld,
header_HelloWorld,
member_seq_HelloWorld);
if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloWorld, type_name_HelloWorld.to_string(), type_ids_HelloWorld))
TypeObjectUtils::build_and_register_struct_type_object(struct_type_HelloWorld,
type_name_HelloWorld.to_string(), type_ids_HelloWorld))
{
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
"HelloWorld already registered in TypeObjectRegistry for a different type.");
}
}
}

8 changes: 8 additions & 0 deletions include/fastdds_statistics_backend/StatisticsBackend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,14 @@ class StatisticsBackend
static void set_alias(
EntityId entity_id,
const std::string& alias);

/**
* @brief Deserialize entity guid to string format.
* @param data Entity guid.
*/
FASTDDS_STATISTICS_BACKEND_DllAPI
static std::string deserialize_guid(
fastdds::statistics::detail::GUID_s data);
};

} // namespace statistics_backend
Expand Down
Loading

0 comments on commit ba2a608

Please sign in to comment.