From 47c2eeb95ed3d3fbe111d467d296dbec95e15d93 Mon Sep 17 00:00:00 2001 From: rex-schilasky <49162693+rex-schilasky@users.noreply.github.com> Date: Sat, 3 Feb 2024 13:57:42 +0100 Subject: [PATCH] monitoring loop fixed --- .../src/monitoring/ecal_monitoring_impl.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/core/src/monitoring/ecal_monitoring_impl.cpp b/src/core/src/monitoring/ecal_monitoring_impl.cpp index bcd438f..fd71556 100644 --- a/src/core/src/monitoring/ecal_monitoring_impl.cpp +++ b/src/core/src/monitoring/ecal_monitoring_impl.cpp @@ -270,7 +270,7 @@ namespace eCAL std::string topic_datatype_encoding = sample_topic.tdatatype.encoding; std::string topic_datatype_name = sample_topic.tdatatype.name; std::string topic_datatype_desc = sample_topic.tdatatype.desc; - auto attr = sample_topic.attr; + auto attr = sample_topic.attr; // try to get topic info const std::string topic_name_id = topic_name + topic_id; @@ -458,16 +458,15 @@ namespace eCAL // update flexible content ServerInfo.rclock++; ServerInfo.methods.clear(); - for (int i = 0; i < sample_.service.methods.size(); ++i) + for (const auto& sample_service_method : sample_.service.methods) { struct Monitoring::SMethodMon method; - auto sample_service_methods = sample_.service.methods[i]; - method.mname = sample_service_methods.mname; - method.req_type = sample_service_methods.req_type; - method.req_desc = sample_service_methods.req_desc; - method.resp_type = sample_service_methods.resp_type; - method.resp_desc = sample_service_methods.resp_desc; - method.call_count = sample_service_methods.call_count; + method.mname = sample_service_method.mname; + method.req_type = sample_service_method.req_type; + method.req_desc = sample_service_method.req_desc; + method.resp_type = sample_service_method.resp_type; + method.resp_desc = sample_service_method.resp_desc; + method.call_count = sample_service_method.call_count; ServerInfo.methods.push_back(method); }