X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6699370d7de47422c60b0a6c2f2d30dad680dfca..312fb09ad52ce2677ad845a760d477b688a30d2c:/include/simgrid/s4u/As.hpp diff --git a/include/simgrid/s4u/As.hpp b/include/simgrid/s4u/As.hpp index 32d50b595f..a02359d54e 100644 --- a/include/simgrid/s4u/As.hpp +++ b/include/simgrid/s4u/As.hpp @@ -23,9 +23,11 @@ namespace simgrid { namespace surf { class Link; } -namespace routing { - class AsImpl; - class NetCard; +namespace kernel { + namespace routing { + class AsImpl; + class NetCard; + } } namespace s4u { @@ -36,9 +38,9 @@ namespace s4u { */ XBT_PUBLIC_CLASS As { protected: - friend simgrid::routing::AsImpl; + friend simgrid::kernel::routing::AsImpl; - explicit As(const char *name); + explicit As(As * father, const char* name); virtual ~As(); public: @@ -47,24 +49,25 @@ public: char *name(); As *father();; xbt_dict_t children(); // Sub AS - xbt_dynar_t hosts(); // my content + xbt_dynar_t hosts(); // my content as a dynar - As *father_ = nullptr; // FIXME: hide me public: /* Add content to the AS, at parsing time. It should be sealed afterward. */ - virtual int addComponent(routing::NetCard *elm); /* A host, a router or an AS, whatever */ + virtual int addComponent(kernel::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(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::vector*> bypassRoutes_; // srcName x dstName -> route + std::vector vertices_; // our content, as known to our graph routing algorithm (maps vertexId -> vertex) private: + As* father_ = nullptr; + char* name_ = nullptr; + bool sealed_ = false; // We cannot add more content when sealed + + std::map, std::vector*> bypassRoutes_; // srcName x dstName -> route + xbt_dict_t children_ = xbt_dict_new_homogeneous(nullptr); // sub-ASes }; }}; // Namespace simgrid::s4u