Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Cosmetics.
[simgrid.git] / src / kernel / routing / NetZoneImpl.cpp
index 81a638323cb325ab6945a996e886949cda0acd84..0528a43d9f12a43878d1c322d9488b7ff086f832 100644 (file)
@@ -24,7 +24,7 @@ NetZoneImpl::NetZoneImpl(NetZoneImpl* father, const std::string& name, resource:
   xbt_assert(nullptr == s4u::Engine::get_instance()->netpoint_by_name_or_null(get_name()),
              "Refusing to create a second NetZone called '%s'.", get_cname());
 
-  netpoint_ = new NetPoint(name_, NetPoint::Type::NetZone, father);
+  netpoint_ = new NetPoint(name_, NetPoint::Type::NetZone, father_);
   XBT_DEBUG("NetZone '%s' created with the id '%u'", get_cname(), netpoint_->id());
 }
 
@@ -44,7 +44,7 @@ NetZoneImpl::~NetZoneImpl()
  * Only the hosts that are directly contained in this NetZone are retrieved,
  * not the ones contained in sub-netzones.
  */
-std::vector<s4u::Host*> NetZoneImpl::get_all_hosts()
+std::vector<s4u::Host*> NetZoneImpl::get_all_hosts() const
 {
   std::vector<s4u::Host*> res;
   for (auto const& card : get_vertices()) {
@@ -54,7 +54,7 @@ std::vector<s4u::Host*> NetZoneImpl::get_all_hosts()
   }
   return res;
 }
-int NetZoneImpl::get_host_count()
+int NetZoneImpl::get_host_count() const
 {
   int count = 0;
   for (auto const& card : get_vertices()) {
@@ -202,13 +202,13 @@ static void find_common_ancestors(NetPoint* src, NetPoint* dst,
   NetZoneImpl* current = src->get_englobing_zone();
   while (current != nullptr) {
     path_src.push_back(current);
-    current = static_cast<NetZoneImpl*>(current->get_father());
+    current = current->get_father();
   }
   std::vector<NetZoneImpl*> path_dst;
   current = dst->get_englobing_zone();
   while (current != nullptr) {
     path_dst.push_back(current);
-    current = static_cast<NetZoneImpl*>(current->get_father());
+    current = current->get_father();
   }
 
   /* (3) find the common father.
@@ -265,14 +265,14 @@ bool NetZoneImpl::get_bypass_route(NetPoint* src, NetPoint* dst,
   std::vector<NetZoneImpl*> path_src;
   NetZoneImpl* current = src->get_englobing_zone();
   while (current != nullptr) {
-    path_src.push_back(static_cast<NetZoneImpl*>(current));
+    path_src.push_back(current);
     current = current->father_;
   }
 
   std::vector<NetZoneImpl*> path_dst;
   current = dst->get_englobing_zone();
   while (current != nullptr) {
-    path_dst.push_back(static_cast<NetZoneImpl*>(current));
+    path_dst.push_back(current);
     current = current->father_;
   }