Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Make parameter a pointer-to-const.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 23 Mar 2021 12:36:57 +0000 (13:36 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 23 Mar 2021 12:36:57 +0000 (13:36 +0100)
include/simgrid/s4u/NetZone.hpp
src/s4u/s4u_Netzone.cpp

index 09ef29c..6ad381c 100644 (file)
@@ -41,7 +41,7 @@ public:
 
   XBT_ATTRIB_DEPRECATED_v331("Please use get_parent()") NetZone* get_father();
   NetZone* get_parent() const;
-  NetZone* set_parent(NetZone* parent);
+  NetZone* set_parent(const NetZone* parent);
 
   std::vector<Host*> get_all_hosts() const;
   int get_host_count() const;
@@ -55,7 +55,7 @@ public:
   void set_property(const std::string& key, const std::string& value);
 
   std::vector<NetZone*> get_children() const;
-  NetZone* add_child(NetZone* new_zone);
+  NetZone* add_child(const NetZone* new_zone);
 
   void extract_xbt_graph(const s_xbt_graph_t* graph, std::map<std::string, xbt_node_t, std::less<>>* nodes,
                          std::map<std::string, xbt_edge_t, std::less<>>* edges);
index 8858aa3..5905229 100644 (file)
@@ -45,7 +45,7 @@ std::vector<NetZone*> NetZone::get_children() const
   return res;
 }
 
-NetZone* NetZone::add_child(NetZone* new_zone)
+NetZone* NetZone::add_child(const NetZone* new_zone)
 {
   pimpl_->add_child(new_zone->get_impl());
   return this;
@@ -71,7 +71,7 @@ NetZone* NetZone::get_parent() const
   return pimpl_->get_parent()->get_iface();
 }
 
-NetZone* NetZone::set_parent(NetZone* parent)
+NetZone* NetZone::set_parent(const NetZone* parent)
 {
   pimpl_->set_parent(parent->get_impl());
   return this;