Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Declare functions "const" in examples/ and teshsuite/.
[simgrid.git] / examples / s4u / dht-chord / s4u-dht-chord.hpp
index 2df51b0..4b9e85f 100644 (file)
@@ -55,6 +55,7 @@ class Node {
   bool joined        = false;
   int id_;                           // my id
   int pred_id_ = -1;                 // predecessor id
+  simgrid::xbt::random::XbtRandom random; // random number generator for this node
   simgrid::s4u::Mailbox* mailbox_;   // my mailbox
   std::vector<int> fingers_;         // finger table,(fingers[0] is my successor)
   int next_finger_to_fix;            // index of the next finger to fix in fix_fingers()
@@ -80,7 +81,7 @@ public:
   int remoteFindSuccessor(int ask_to, int id);
 
   void notify(int predecessor_candidate_id);
-  void remoteNotify(int notify_id, int predecessor_candidate_id);
+  void remoteNotify(int notify_id, int predecessor_candidate_id) const;
   void stabilize();
   void handleMessage(ChordMessage* message);