Skip to content

Commit 1ef9c08

Browse files
committed
Refs 22894: connecting functions with the monitor
Signed-off-by: Juanjo Garcia <[email protected]>
1 parent 3026b3d commit 1ef9c08

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/cpp/StatisticsBackend.cpp

+24
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,30 @@ std::string StatisticsBackend::get_type_idl(
559559
return StatisticsBackendData::get_instance()->database_->get_type_idl(topic_info[DATA_TYPE_TAG]);
560560
}
561561

562+
std::string StatisticsBackend::get_ros2_type_name(
563+
EntityId entity_id)
564+
{
565+
// Check if the entity is a topic
566+
if (EntityKind::TOPIC != get_type(entity_id))
567+
{
568+
throw BadParameter("EntityId received does not match with a valid topic entity");
569+
}
570+
Info topic_info = StatisticsBackend::get_info(entity_id);
571+
return StatisticsBackendData::get_instance()->database_->get_ros2_type_name(topic_info[DATA_TYPE_TAG]);
572+
}
573+
574+
std::string StatisticsBackend::get_ros2_type_idl(
575+
EntityId entity_id)
576+
{
577+
// Check if the entity is a topic
578+
if (EntityKind::TOPIC != get_type(entity_id))
579+
{
580+
throw BadParameter("EntityId received does not match with a valid topic entity");
581+
}
582+
Info topic_info = StatisticsBackend::get_info(entity_id);
583+
return StatisticsBackendData::get_instance()->database_->get_ros2_type_idl(topic_info[DATA_TYPE_TAG]);
584+
}
585+
562586
EntityId StatisticsBackend::get_endpoint_topic_id(
563587
EntityId endpoint_id)
564588
{

0 commit comments

Comments
 (0)