diff --git a/include/fastdds_statistics_backend/StatisticsBackend.hpp b/include/fastdds_statistics_backend/StatisticsBackend.hpp index 873876f8..236cd563 100644 --- a/include/fastdds_statistics_backend/StatisticsBackend.hpp +++ b/include/fastdds_statistics_backend/StatisticsBackend.hpp @@ -263,6 +263,16 @@ class StatisticsBackend static Info get_info( EntityId entity_id); + /** + * @brief Get the IDL representation of a data type in string format for a given topic entity + * + * @param entity_id The entity for which the data type IDL is retrieved. + * @return String object describing the entity's data type IDL. + */ + FASTDDS_STATISTICS_BACKEND_DllAPI + static std::string get_type_idl( + EntityId entity_id); + /** * @brief Provides access to the data measured during the monitoring. * diff --git a/src/cpp/StatisticsBackend.cpp b/src/cpp/StatisticsBackend.cpp index a05858a3..83b8a3c4 100644 --- a/src/cpp/StatisticsBackend.cpp +++ b/src/cpp/StatisticsBackend.cpp @@ -537,6 +537,19 @@ Info StatisticsBackend::get_info( return StatisticsBackendData::get_instance()->database_->get_info(entity_id); } +std::string StatisticsBackend::get_type_idl( + EntityId entity_id) +{ + // Check if the entity is a topic + if (EntityKind::TOPIC != get_type(entity_id)) + { + throw BadParameter("EntityId received does not match with a valid topic entity"); + } + Info topic_info = StatisticsBackend::get_info(entity_id); + return StatisticsBackendData::get_instance()->database_->get_type_idl(topic_info[DATA_TYPE_TAG]); + +} + std::vector StatisticsBackend::get_data( DataKind data_type, const std::vector& entity_ids_source, diff --git a/src/cpp/database/database.cpp b/src/cpp/database/database.cpp index ef5eb873..44774b76 100644 --- a/src/cpp/database/database.cpp +++ b/src/cpp/database/database.cpp @@ -5352,8 +5352,7 @@ Info Database::get_info( break; } } - // __FLAG__ - std::cout << "Info:" << info << std::endl; + return info; }