Skip to content

Commit

Permalink
Add support for complex arrays (#52)
Browse files Browse the repository at this point in the history
Signed-off-by: Juan López Fernández <juanlopez@eprosima.com>
  • Loading branch information
juanlofer-eprosima authored Feb 2, 2023
1 parent 016db34 commit 265a22e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
18 changes: 9 additions & 9 deletions plugins/datastreamer_plugin/fastdds/Participant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,6 @@ void Participant::on_type_discovery(
const fastrtps::types::TypeObject* object,
fastrtps::types::DynamicType_ptr dyn_type)
{
if (!dyn_type)
{
// Fast DDS may call this callback with a nullptr in dyn_type because of reasons. Avoid break.
WARNING("on_type_discovery callback called with nullptr dyn type");
return;
}

DEBUG("TypeObject discovered: " << dyn_type->get_name() << " for topic: " << topic.to_string());

// TOOD study this
// In case of complex data types, registering here means that the data type will be incorrectly registered
// because the internal data will be received and registered faster than lookup service, which produces an error
Expand All @@ -286,6 +277,15 @@ void Participant::on_type_discovery(
// not only check it has been registered but it has been discovered by the Service, that may be in process of
// registering when this callback arrives

// if (!dyn_type)
// {
// // Fast DDS may call this callback with a nullptr in dyn_type because of reasons. Avoid break.
// WARNING("on_type_discovery callback called with nullptr dyn type");
// return;
// }

// DEBUG("TypeObject discovered: " << dyn_type->get_name() << " for topic: " << topic.to_string());

// Create TypeSupport and register it
// eprosima::fastdds::dds::TypeSupport(
// new eprosima::fastrtps::types::DynamicPubSubType(dyn_type)).register_type(participant_);
Expand Down
7 changes: 2 additions & 5 deletions plugins/datastreamer_plugin/utils/dynamic_types_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ DynamicData* get_parent_data_of_member(
switch (kind)
{
case fastrtps::types::TK_STRUCTURE:
case fastrtps::types::TK_ARRAY:
{
// Access to the data inside the structure
DynamicData* child_data;
Expand All @@ -294,11 +295,7 @@ DynamicData* get_parent_data_of_member(
kind_tree,
array_indexes + 1);
}
case fastrtps::types::TK_ARRAY:
{
// TODO (this is not so important as a type with a complex array will die before
// arriving here)
}

// TODO
default:
// TODO add exception
Expand Down

0 comments on commit 265a22e

Please sign in to comment.