Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
smpi: fix issue with message IDs. In case of persistent request reused multiple times...
[simgrid.git] / examples / cpp / dht-kademlia / node.hpp
index 44063d26970b5d286ae14e330c55c980a528c9ea..afe2cc70c7a1d67a0c42b83c1558208d6bff1bdc 100644 (file)
@@ -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;