diff --git a/src/cpp/statistics/rtps/monitor-service/MonitorService.cpp b/src/cpp/statistics/rtps/monitor-service/MonitorService.cpp index bc2813eb03..4b03ebde68 100644 --- a/src/cpp/statistics/rtps/monitor-service/MonitorService.cpp +++ b/src/cpp/statistics/rtps/monitor-service/MonitorService.cpp @@ -159,6 +159,14 @@ bool MonitorService::disable_monitor_service() bool MonitorService::remove_local_entity( const fastdds::rtps::EntityId_t& entity_id) { + // Remove the entity from the extended incompatible QoS collection + { + std::lock_guard lock(extended_incompatible_qos_mtx_); + GUID_t entity_guid = {local_participant_guid_.guidPrefix, entity_id}; + extended_incompatible_qos_collection_.erase(entity_guid); + } + + // Remove the entity from the local entities { std::lock_guard lock (mtx_); @@ -166,6 +174,11 @@ bool MonitorService::remove_local_entity( if (!local_entities_[entity_id].second) { changed_entities_.push_back(entity_id); + if (!timer_active_.load()) + { + event_->restart_timer(); + timer_active_.store(true); + } } //! But remove it from the collection of entities @@ -326,6 +339,12 @@ bool MonitorService::write_status( status_retrieved = status_queryable_.get_monitoring_status(local_entity_guid, data); break; } + case StatusKind::EXTENDED_INCOMPATIBLE_QOS: + { + std::lock_guard lock(extended_incompatible_qos_mtx_); + data.extended_incompatible_qos_status(extended_incompatible_qos_collection_[local_entity_guid]); + break; + } default: { EPROSIMA_LOG_ERROR(MONITOR_SERVICE, "Referring to an unknown status"); diff --git a/src/cpp/statistics/rtps/monitor-service/MonitorService.hpp b/src/cpp/statistics/rtps/monitor-service/MonitorService.hpp index 5e94517f87..d41e15ce46 100644 --- a/src/cpp/statistics/rtps/monitor-service/MonitorService.hpp +++ b/src/cpp/statistics/rtps/monitor-service/MonitorService.hpp @@ -71,6 +71,8 @@ class MonitorService { static constexpr int MIN_TIME_BETWEEN_PUBS_MS = 500; + friend class MonitorServiceListener; + public: using endpoint_creator_t = std::function + extended_incompatible_qos_collection_; + + std::mutex extended_incompatible_qos_mtx_; }; #endif // FASTDDS_STATISTICS