X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0bfafcab47ae9cd7856bd8d129404c33079d6afe..505d827ccafbb31eb15cfbd72bdc6079e50525e2:/examples/cpp/dht-kademlia/node.hpp diff --git a/examples/cpp/dht-kademlia/node.hpp b/examples/cpp/dht-kademlia/node.hpp index 44063d2697..afe2cc70c7 100644 --- a/examples/cpp/dht-kademlia/node.hpp +++ b/examples/cpp/dht-kademlia/node.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2021. The SimGrid Team. +/* Copyright (c) 2012-2023. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -20,14 +20,16 @@ class Node { RoutingTable table; // node routing table 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. -public: simgrid::s4u::CommPtr receive_comm = nullptr; Message* received_msg = nullptr; + +public: explicit Node(unsigned int node_id) : id_(node_id), table(node_id) {} Node(const Node&) = delete; Node& operator=(const Node&) = delete; unsigned int getId() const { return id_; } + Message* receive(simgrid::s4u::Mailbox* mailbox); bool join(unsigned int known_id); void sendFindNode(unsigned int id, unsigned int destination) const; unsigned int sendFindNodeToBest(const Answer* node_list) const;