Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
More coding style updates for sg_link.
[simgrid.git] / src / s4u / s4u_Netzone.cpp
index acf827eaade88a69f80b4fd346129465bef671c7..8ab5462637b409c9166aed79ce91e9b7fe295220 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-2020. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -7,6 +7,7 @@
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/NetZone.hpp"
+#include "simgrid/simix.hpp"
 #include "simgrid/zone.h"
 
 namespace simgrid {
@@ -67,7 +68,7 @@ std::vector<Host*> NetZone::get_all_hosts() const
   return pimpl_->get_all_hosts();
 }
 
-int NetZone::get_host_count()
+int NetZone::get_host_count() const
 {
   return pimpl_->get_host_count();
 }
@@ -89,6 +90,15 @@ void NetZone::add_bypass_route(kernel::routing::NetPoint* src, kernel::routing::
 {
   pimpl_->add_bypass_route(src, dst, gw_src, gw_dst, link_list, symmetrical);
 }
+
+void NetZone::extract_xbt_graph(const s_xbt_graph_t* graph, std::map<std::string, xbt_node_t>* nodes,
+                                std::map<std::string, xbt_edge_t>* edges)
+{
+  for (auto const& child : get_children())
+    child->extract_xbt_graph(graph, nodes, edges);
+
+  pimpl_->get_graph(graph, nodes, edges);
+}
 } // namespace s4u
 } // namespace simgrid