Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[s4u] Mailbox::receiver return a s4u::ActorPtr
[simgrid.git] / include / simgrid / s4u / As.hpp
index b79afa4..32d50b5 100644 (file)
@@ -6,20 +6,25 @@
 #ifndef SIMGRID_S4U_AS_HPP
 #define SIMGRID_S4U_AS_HPP
 
-#include "xbt/base.h"
-#include "xbt/graph.h"
-
-#include "simgrid/s4u/forward.hpp"
-#include <vector>
 #include <map>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include <xbt/base.h>
+#include <xbt/graph.h>
+
+#include <simgrid/s4u/forward.hpp>
 
 #include "src/surf/xml/platf_private.hpp" // FIXME: kill sg_platf_route_cbarg_t to remove that UGLY include
 
 namespace simgrid {
 
 namespace surf {
-  class AsImpl;
   class Link;
+}
+namespace routing {
+  class AsImpl;
   class NetCard;
 }
 namespace s4u {
@@ -31,14 +36,14 @@ namespace s4u {
  */
 XBT_PUBLIC_CLASS As {
 protected:
-  friend simgrid::surf::AsImpl;
+  friend simgrid::routing::AsImpl;
 
-  As(const char *name);
+  explicit As(const char *name);
   virtual ~As();
   
 public:
   /** @brief Seal your AS once you're done adding content, and before routing stuff through it */
-  virtual void Seal();
+  virtual void seal();
   char *name();
   As *father();;
   xbt_dict_t children(); // Sub AS
@@ -47,14 +52,14 @@ public:
   As *father_ = nullptr; // FIXME: hide me
 public:
   /* Add content to the AS, at parsing time. It should be sealed afterward. */
-  virtual int addComponent(surf::NetCard *elm); /* A host, a router or an AS, whatever */
+  virtual int addComponent(routing::NetCard *elm); /* A host, a router or an AS, whatever */
   virtual void addRoute(sg_platf_route_cbarg_t route);
   void addBypassRoute(sg_platf_route_cbarg_t e_route);
 
 protected:
   char *name_ = nullptr;
-  xbt_dict_t children_ = xbt_dict_new_homogeneous(NULL); // sub-ASes
-  xbt_dynar_t vertices_ = xbt_dynar_new(sizeof(char*),NULL); // our content, as known to our graph routing algorithm (maps vertexId -> vertex)
+  xbt_dict_t children_ = xbt_dict_new_homogeneous(nullptr); // sub-ASes
+  xbt_dynar_t vertices_ = xbt_dynar_new(sizeof(char*),nullptr); // our content, as known to our graph routing algorithm (maps vertexId -> vertex)
 
   std::map<std::pair<std::string, std::string>, std::vector<surf::Link*>*> bypassRoutes_; // srcName x dstName -> route