Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't mix public and private fields (sonar).
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 19 Mar 2021 12:27:31 +0000 (13:27 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 19 Mar 2021 15:12:50 +0000 (16:12 +0100)
examples/cpp/dht-kademlia/routing_table.hpp
src/kernel/EngineImpl.hpp
src/mc/udpor_global.hpp

index 9756edf..a87fd2f 100644 (file)
@@ -14,8 +14,8 @@ namespace kademlia {
 
 /* Routing table bucket */
 class Bucket {
-  unsigned int id_; // bucket id
 public:
+  const unsigned int id_;          // bucket id
   std::deque<unsigned int> nodes_; // Nodes in the bucket.
   unsigned int getId() const { return id_; }
   explicit Bucket(unsigned int id) noexcept : id_(id) {}
index deb5664..951418f 100644 (file)
@@ -26,6 +26,7 @@ class EngineImpl {
   actor::ActorCodeFactory default_function; // Function to use as a fallback when the provided name matches nothing
   std::vector<std::shared_ptr<resource::Model>> models_;
   std::unordered_map<resource::Model::Type, std::vector<resource::Model*>> models_by_type_;
+  routing::NetZoneImpl* netzone_root_ = nullptr;
 
   friend s4u::Engine;
 
@@ -57,7 +58,6 @@ public:
   /** @brief Get list of all models managed by this engine */
   const std::vector<std::shared_ptr<resource::Model>>& get_all_models() const { return models_; }
 
-  routing::NetZoneImpl* netzone_root_ = nullptr;
   static EngineImpl* get_instance() { return simgrid::s4u::Engine::get_instance()->pimpl; }
   actor::ActorCodeFactory get_function(const std::string& name)
   {
index bc01589..97bbfc6 100644 (file)
@@ -58,7 +58,6 @@ public:
 
 class UnfoldingEvent {
 public:
-  EventSet causes; // used to store directed ancestors of event e
   UnfoldingEvent(unsigned int nb_events, std::string const& trans_tag, EventSet const& causes, int sid = -1);
   UnfoldingEvent(const UnfoldingEvent&) = default;
   UnfoldingEvent& operator=(UnfoldingEvent const&) = default;
@@ -86,6 +85,7 @@ public:
   inline void set_transition_tag(std::string const& tr_tag) { transition_tag = tr_tag; }
 
 private:
+  EventSet causes; // used to store directed ancestors of event e
   int id = -1;
   int state_id{-1};
   std::string transition_tag{""}; // The tag of the last transition that lead to creating the event