Skip to content

Commit

Permalink
Refs #21458: Add IDL getter for Monitor controller communication
Browse files Browse the repository at this point in the history
Signed-off-by: Carlosespicur <[email protected]>
  • Loading branch information
Carlosespicur authored and JesusPoderoso committed Sep 2, 2024
1 parent ca5cb08 commit c6f7cf7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
10 changes: 10 additions & 0 deletions include/fastdds_statistics_backend/StatisticsBackend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
13 changes: 13 additions & 0 deletions src/cpp/StatisticsBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<StatisticsData> StatisticsBackend::get_data(
DataKind data_type,
const std::vector<EntityId>& entity_ids_source,
Expand Down
3 changes: 1 addition & 2 deletions src/cpp/database/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5352,8 +5352,7 @@ Info Database::get_info(
break;
}
}
// __FLAG__
std::cout << "Info:" << info << std::endl;

return info;

}
Expand Down

0 comments on commit c6f7cf7

Please sign in to comment.