Skip to content

Commit

Permalink
Register and propagate MonitorService status type object (#5253)
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
  • Loading branch information
juanlofer-eprosima committed Sep 24, 2024
1 parent ce8e4eb commit 0bf7481
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/cpp/statistics/rtps/monitor-service/MonitorService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@

#include <fastdds/rtps/builtin/data/TopicDescription.hpp>

#include <fastdds/dds/core/ReturnCode.hpp>
#include <fastdds/publisher/DataWriterHistory.hpp>
#include <fastdds/statistics/topic_names.hpp>

#include <rtps/history/CacheChangePool.h>
#include <rtps/history/PoolConfig.h>
#include <rtps/history/TopicPayloadPoolRegistry.hpp>
#include <rtps/RTPSDomainImpl.hpp>
#include <statistics/rtps/StatisticsBase.hpp>
#include <utils/TimeConversion.hpp>

Expand Down Expand Up @@ -494,6 +496,20 @@ bool MonitorService::create_endpoint()
topic_desc.topic_name = MONITOR_SERVICE_TOPIC;
topic_desc.type_name = type_.get_name();

//! Register and propagate type object representation
type_.register_type_object_representation();
fastdds::dds::xtypes::TypeInformation type_info;
if (fastdds::dds::RETCODE_OK ==
RTPSDomainImpl::get_instance()->type_object_registry_observer().get_type_information(
type_.type_identifiers(), type_info))
{
topic_desc.type_information = type_info;
}
else
{
EPROSIMA_LOG_WARNING(MONITOR_SERVICE, "Failed to retrieve type information for " << MONITOR_SERVICE_TOPIC);
}

endpoint_registrator_(status_writer_, topic_desc, wqos);
}
else
Expand Down

0 comments on commit 0bf7481

Please sign in to comment.