From bec4b84b4f0780b18e50d933866a91937759db8f Mon Sep 17 00:00:00 2001 From: juancarlosgg Date: Mon, 18 Nov 2024 18:28:27 +0100 Subject: [PATCH] clang-tidy: fix warnings --- api/dsr_api.cpp | 56 +++++++++++++++++------------------- core/rtps/dsrparticipant.cpp | 16 +++++------ core/types/common_types.cpp | 2 +- 3 files changed, 34 insertions(+), 40 deletions(-) diff --git a/api/dsr_api.cpp b/api/dsr_api.cpp index 364c945..6baad43 100644 --- a/api/dsr_api.cpp +++ b/api/dsr_api.cpp @@ -949,10 +949,10 @@ void DSRGraph::join_delta_node(IDL::MvregNode &&mvreg) auto delete_unprocessed_deltas = [&](){ unprocessed_delta_node_att.erase(id); - decltype(unprocessed_delta_edge_from)::node_type node_handle = std::move(unprocessed_delta_edge_from.extract(id)); + decltype(unprocessed_delta_edge_from)::node_type node_handle = unprocessed_delta_edge_from.extract(id); while (!node_handle.empty()) { - node_handle = std::move(unprocessed_delta_edge_from.extract(id)); + node_handle = unprocessed_delta_edge_from.extract(id); } std::erase_if(unprocessed_delta_edge_to, @@ -965,7 +965,7 @@ void DSRGraph::join_delta_node(IDL::MvregNode &&mvreg) std::unordered_set,hash_tuple> map_new_to_edges = {}; auto consume_unprocessed_deltas = [&](){ - decltype(unprocessed_delta_node_att)::node_type node_handle_node_att = std::move(unprocessed_delta_node_att.extract(id)); + decltype(unprocessed_delta_node_att)::node_type node_handle_node_att = unprocessed_delta_node_att.extract(id); while (!node_handle_node_att.empty()) { auto &[att_name, delta, timestamp_node_att] = node_handle_node_att.mapped(); @@ -973,10 +973,10 @@ void DSRGraph::join_delta_node(IDL::MvregNode &&mvreg) if (timestamp < timestamp_node_att) { process_delta_node_attr(id, att_name,std::move(delta)); } - node_handle_node_att = std::move(unprocessed_delta_node_att.extract(id)); + node_handle_node_att = unprocessed_delta_node_att.extract(id); } - decltype(unprocessed_delta_edge_from)::node_type node_handle_edge = std::move(unprocessed_delta_edge_from.extract(id)); + decltype(unprocessed_delta_edge_from)::node_type node_handle_edge = unprocessed_delta_edge_from.extract(id); while (!node_handle_edge.empty()) { auto &[to, type, delta, timestamp_edge] = node_handle_edge.mapped(); auto att_key = std::tuple{id, to, type}; @@ -985,23 +985,22 @@ void DSRGraph::join_delta_node(IDL::MvregNode &&mvreg) if (process_delta_edge(id, to, type, std::move(delta))) map_new_to_edges.emplace(std::pair{to, type}); } if (nodes.contains(id) and nodes.at(id).read_reg().fano().contains({to, type})) { - decltype(unprocessed_delta_edge_att)::node_type node_handle_edge_att = std::move( - unprocessed_delta_edge_att.extract(att_key)); + decltype(unprocessed_delta_edge_att)::node_type node_handle_edge_att = unprocessed_delta_edge_att.extract(att_key); while (!node_handle_edge_att.empty()) { auto &[att_name, delta, timestamp_edge_att] = node_handle_edge_att.mapped(); std::cout << "edge_att " << id<< ", " <(it.second) == id && std::get<1>(it.second) == type;}); - node_handle_edge = std::move(unprocessed_delta_edge_from.extract(id)); + node_handle_edge = unprocessed_delta_edge_from.extract(id); } - node_handle_edge = std::move(unprocessed_delta_edge_to.extract(id)); + node_handle_edge = unprocessed_delta_edge_to.extract(id); while (!node_handle_edge.empty()) { auto &[from, type, delta, timestamp_edge] = node_handle_edge.mapped(); auto att_key = std::tuple{from, id, type}; @@ -1010,19 +1009,18 @@ void DSRGraph::join_delta_node(IDL::MvregNode &&mvreg) process_delta_edge(from, id, type, std::move(delta)); } if (nodes.contains(from) and nodes.at(from).read_reg().fano().contains({id, type})) { - decltype(unprocessed_delta_edge_att)::node_type node_handle_edge_att = std::move( - unprocessed_delta_edge_att.extract(att_key)); + decltype(unprocessed_delta_edge_att)::node_type node_handle_edge_att = unprocessed_delta_edge_att.extract(att_key); while (!node_handle_edge_att.empty()) { auto &[att_name, delta, timestamp_edge_att] = node_handle_edge_att.mapped(); //std::cout << "edge_att " << from<< ", " <(node_handle.mapped()), std::get<1>(node_handle.mapped())}); - node_handle = std::move(unprocessed_delta_edge_from.extract(id)); + node_handle = unprocessed_delta_edge_from.extract(id); } std::erase_if(unprocessed_delta_edge_to, [&](auto &it){ return std::get<0>(it.second) == id;}); }; auto consume_unprocessed_deltas = [&](){ - decltype(unprocessed_delta_node_att)::node_type node_handle_node_att = std::move(unprocessed_delta_node_att.extract(id)); + decltype(unprocessed_delta_node_att)::node_type node_handle_node_att = unprocessed_delta_node_att.extract(id); while (!node_handle_node_att.empty()) { auto &[att_name, delta, timestamp_node_att] = node_handle_node_att.mapped(); if (timestamp < timestamp_node_att) { process_delta_node_attr(id, att_name,std::move(delta)); } - node_handle_node_att = std::move(unprocessed_delta_node_att.extract(id)); + node_handle_node_att = unprocessed_delta_node_att.extract(id); } - decltype(unprocessed_delta_edge_from)::node_type node_handle_edge = std::move(unprocessed_delta_edge_from.extract(id)); + decltype(unprocessed_delta_edge_from)::node_type node_handle_edge = unprocessed_delta_edge_from.extract(id); while (!node_handle_edge.empty()) { auto &[to, type, delta, timestamp_edge] = node_handle_edge.mapped(); auto att_key = std::tuple{id, to, type}; @@ -1399,25 +1397,24 @@ void DSRGraph::join_full_graph(IDL::OrMap &&full_graph) process_delta_edge(id, to, type, std::move(delta)); } if (nodes.contains(id) and nodes.at(id).read_reg().fano().contains({to, type})) { - decltype(unprocessed_delta_edge_att)::node_type node_handle_edge_att = std::move( - unprocessed_delta_edge_att.extract(att_key)); + decltype(unprocessed_delta_edge_att)::node_type node_handle_edge_att = unprocessed_delta_edge_att.extract(att_key); while (!node_handle_edge_att.empty()) { auto &[att_name, delta, timestamp_edge_att] = node_handle_edge_att.mapped(); std::cout << "edge_att " << id<< ", " <(it.second) == id && std::get<1>(it.second) == type;}); - node_handle_edge = std::move(unprocessed_delta_edge_from.extract(id)); + node_handle_edge = unprocessed_delta_edge_from.extract(id); } //TODO: Check - node_handle_edge = std::move(unprocessed_delta_edge_to.extract(id)); + node_handle_edge = unprocessed_delta_edge_to.extract(id); while (!node_handle_edge.empty()) { auto &[from, type, delta, timestamp_edge] = node_handle_edge.mapped(); auto att_key = std::tuple{from, id, type}; @@ -1426,19 +1423,18 @@ void DSRGraph::join_full_graph(IDL::OrMap &&full_graph) process_delta_edge(from, id, type, std::move(delta)); } if (nodes.contains(from) and nodes.at(from).read_reg().fano().contains({id, type})) { - decltype(unprocessed_delta_edge_att)::node_type node_handle_edge_att = std::move( - unprocessed_delta_edge_att.extract(att_key)); + decltype(unprocessed_delta_edge_att)::node_type node_handle_edge_att = unprocessed_delta_edge_att.extract(att_key); while (!node_handle_edge_att.empty()) { auto &[att_name, delta, timestamp_edge_att] = node_handle_edge_att.mapped(); //std::cout << "edge_att " << from<< ", " < DSRParticipant::ini //Create a descriptor for the new transport. auto custom_transport = std::make_shared(); - //auto custom_transport = std::make_shared(); //std::make_shared(); + //auto custom_transport = std::make_shared(); custom_transport->sendBufferSize = 33554432; custom_transport->receiveBufferSize = 33554432; - //custom_transport->segment_size(50000000); - //custom_transport->maxMessageSize = 50000000;; custom_transport->maxMessageSize = 65000; PParam.transport().user_transports.push_back(custom_transport); - if (not localhost) + + custom_transport->interface_allowlist.emplace_back("127.0.0.1"); + + /*if (not localhost) { + std::vector ips; eprosima::fastdds::rtps::IPFinder::getIPs(&ips, false); @@ -63,11 +65,7 @@ std::tuple DSRParticipant::ini } } - } else { - - custom_transport->interfaceWhiteList.emplace_back("127.0.0.1"); - - } + }*/ PParam.transport().send_socket_buffer_size = 33554432; PParam.transport().listen_socket_buffer_size = 33554432; diff --git a/core/types/common_types.cpp b/core/types/common_types.cpp index 591afe5..70c123e 100644 --- a/core/types/common_types.cpp +++ b/core/types/common_types.cpp @@ -15,7 +15,7 @@ namespace DSR { IDL::Attrib att; att.timestamp(m_timestamp); att.type(m_value.index()); - att.value(std::move(to_IDL_val())); + att.value(to_IDL_val()); att.agent_id(m_agent_id); return att; }