X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d785a64b1830b6a5d05561316ef7161ee1c67671..681600546425819d6810e4e595d35e843130d878:/include/simgrid/s4u/As.hpp diff --git a/include/simgrid/s4u/As.hpp b/include/simgrid/s4u/As.hpp index 50c4854814..f025657357 100644 --- a/include/simgrid/s4u/As.hpp +++ b/include/simgrid/s4u/As.hpp @@ -40,7 +40,7 @@ XBT_PUBLIC_CLASS As { protected: friend simgrid::kernel::routing::AsImpl; - explicit As(const char *name); + explicit As(As * father, const char* name); virtual ~As(); public: @@ -49,24 +49,30 @@ 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(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); + virtual void addBypassRoute(sg_platf_route_cbarg_t e_route) = 0; -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) + /*** Called on each newly created regular route (not on bypass routes) */ + static simgrid::xbt::signal* link_list)> + onRouteCreation; - std::map, std::vector*> bypassRoutes_; // srcName x dstName -> route +protected: + 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 + + xbt_dict_t children_ = xbt_dict_new_homogeneous(nullptr); // sub-ASes }; }}; // Namespace simgrid::s4u