From: Arnaud Giersch Date: Thu, 18 Jan 2018 09:21:13 +0000 (+0100) Subject: Disable unused copy constructors (and please cppcheck). X-Git-Tag: v3.19~265 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/08a8ba5b7ccd6f4aa2393fd6c8e32267121314f1?hp=ecdbfb840d579e6ea34d9676a8feb9fab975ea32 Disable unused copy constructors (and please cppcheck). --- diff --git a/examples/s4u/dht-kademlia/node.hpp b/examples/s4u/dht-kademlia/node.hpp index 10625d03ae..178f380a88 100644 --- a/examples/s4u/dht-kademlia/node.hpp +++ b/examples/s4u/dht-kademlia/node.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2014-2017. The SimGrid Team. +/* Copyright (c) 2012, 2014-2018. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -22,6 +22,8 @@ public: unsigned int find_node_success = 0; // Number of find_node which have succeeded. unsigned int find_node_failed = 0; // Number of find_node which have failed. explicit Node(unsigned int node_id) : id_(node_id), table(new RoutingTable(node_id)), receive_comm(nullptr) {} + Node(const Node&) = delete; + Node& operator=(const Node&) = delete; ~Node() { delete table; } unsigned int getId() { return id_; } diff --git a/examples/s4u/dht-kademlia/routing_table.hpp b/examples/s4u/dht-kademlia/routing_table.hpp index 60354ce0f4..bbe7128dc2 100644 --- a/examples/s4u/dht-kademlia/routing_table.hpp +++ b/examples/s4u/dht-kademlia/routing_table.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2014, 2017. The SimGrid Team. +/* Copyright (c) 2012, 2014, 2017-2018. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -27,6 +27,8 @@ class RoutingTable { public: Bucket** buckets; // Node bucket list - 160 sized. explicit RoutingTable(unsigned int node_id); + RoutingTable(const RoutingTable&) = delete; + RoutingTable& operator=(const RoutingTable&) = delete; ~RoutingTable(); void print(); Bucket* findBucket(unsigned int id);