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

[20509] Update repository for Fast DDS 3.0.0 compatibility #86

Merged
merged 10 commits into from
Sep 16, 2024
Prev Previous commit
Next Next commit
Apply suggested changes
Signed-off-by: Lucia Echevarria <luciaechevarria@eprosima.com>
LuciaEchevarria99 committed Sep 15, 2024
commit 373bd9f62a8cb66b210e3ea7b441ac496e0dff63
Original file line number Diff line number Diff line change
@@ -14,8 +14,6 @@

#pragma once

#include <fastdds/dds/xtypes/dynamic_types/DynamicType.hpp>

#include <cpp_utils/collection/database/SafeDatabase.hpp>
#include <cpp_utils/types/Atomicable.hpp>

12 changes: 0 additions & 12 deletions fastddsspy_participants/test/unittest/model/DataStreamerTest.cpp
Original file line number Diff line number Diff line change
@@ -27,18 +27,6 @@ using namespace eprosima;
fastdds::dds::DynamicType::_ref_type create_schema(
ddspipe::core::types::DdsTopic& topic)
{
// // Opción 1:
// fastdds::dds::TypeSupport type(new DynamicPubSubType(dynamic_type_topic));
// type->setName(topic.type_name);

// Lo que había antes
// fastdds::dds::DynamicTypeBuilder:_ref_type dynamic_type_topic_builder;
// dynamic_type_topic_builder = fastrtps::types::DynamicTypeBuilderFactory::get_instance()->create_struct_builder();

// dynamic_type_topic_builder->set_name(topic.type_name);
// dynamic_type_topic = dynamic_type_topic_builder->build();

// Opción 2:
fastdds::dds::TypeDescriptor::_ref_type type_descriptor {fastdds::dds::traits<fastdds::dds::TypeDescriptor>::make_shared()};
type_descriptor->name(topic.type_name);
fastdds::dds::DynamicTypeBuilder::_ref_type struct_builder {fastdds::dds::DynamicTypeBuilderFactory::get_instance()->create_type(type_descriptor)};
14 changes: 12 additions & 2 deletions fastddsspy_tool/src/cpp/tool/Controller.cpp
Original file line number Diff line number Diff line change
@@ -143,7 +143,12 @@ void Controller::data_stream_callback_(
view_.show("---");
std::stringstream ss;
ss << std::setw(4);
auto ret = fastdds::dds::json_serialize(dyn_data, fastdds::dds::DynamicDataJsonFormat::EPROSIMA, ss);
if (fastdds::dds::RETCODE_OK != fastdds::dds::json_serialize(dyn_data, fastdds::dds::DynamicDataJsonFormat::EPROSIMA, ss))
{
EPROSIMA_LOG_WARNING(FASTDDSSPY_CONTROLLER,
"Not able to serialize data of topic " << topic.topic_name() << " into JSON format.");
return;
}
std::cout << ss.str() << std::endl;
view_.show("---\n");
}
@@ -175,7 +180,12 @@ void Controller::data_stream_callback_verbose_(
view_.show("data:\n---");
std::stringstream ss;
ss << std::setw(4);
auto ret = fastdds::dds::json_serialize(dyn_data, fastdds::dds::DynamicDataJsonFormat::EPROSIMA, ss);
if (fastdds::dds::RETCODE_OK != fastdds::dds::json_serialize(dyn_data, fastdds::dds::DynamicDataJsonFormat::EPROSIMA, ss))
{
EPROSIMA_LOG_WARNING(FASTDDSSPY_CONTROLLER,
"Not able to serialize data of topic " << topic.topic_name() << " into JSON format.");
return;
}
std::cout << ss.str() << std::endl;
view_.show("---\n");
}