X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/180d22ed01b2f5b81d586afdf205a5954524ce3b..c076aa56c88595b4f625df015a02aa870ab3947d:/examples/s4u/dht-kademlia/node.hpp diff --git a/examples/s4u/dht-kademlia/node.hpp b/examples/s4u/dht-kademlia/node.hpp index 27fa2c76fe..0aa8d80310 100644 --- a/examples/s4u/dht-kademlia/node.hpp +++ b/examples/s4u/dht-kademlia/node.hpp @@ -15,16 +15,15 @@ namespace kademlia { class Node { unsigned int id_; // node id - 160 bits - RoutingTable* table = nullptr; // node routing table + RoutingTable table; // node routing table public: simgrid::s4u::CommPtr receive_comm; void* received_msg = nullptr; 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) {} + explicit Node(unsigned int node_id) : id_(node_id), table(node_id), receive_comm(nullptr) {} Node(const Node&) = delete; Node& operator=(const Node&) = delete; - ~Node() { delete table; } unsigned int getId() { return id_; } bool join(unsigned int known_id);