X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9735863c1ccb1ae8b55853262d6e1c3ee3a8698f..455435b8a7cc8d84037aa66104a73d4760d9666f:/include/simgrid/s4u/As.hpp diff --git a/include/simgrid/s4u/As.hpp b/include/simgrid/s4u/As.hpp index b79afa45ff..33fcb48e11 100644 --- a/include/simgrid/s4u/As.hpp +++ b/include/simgrid/s4u/As.hpp @@ -6,21 +6,29 @@ #ifndef SIMGRID_S4U_AS_HPP #define SIMGRID_S4U_AS_HPP -#include "xbt/base.h" -#include "xbt/graph.h" - -#include "simgrid/s4u/forward.hpp" -#include #include +#include +#include +#include + +#include +#include + +#include #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; - class NetCard; +} +namespace kernel { + namespace routing { + class AsImpl; + class NetCard; + class BypassRoute; + } } namespace s4u { @@ -31,35 +39,43 @@ namespace s4u { */ XBT_PUBLIC_CLASS As { protected: - friend simgrid::surf::AsImpl; + friend simgrid::kernel::routing::AsImpl; - As(const char *name); + explicit As(As * father, 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 - 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(surf::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(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) + /*** 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 + + std::map, kernel::routing::BypassRoute*> + bypassRoutes_; // src x dst -> route + xbt_dict_t children_ = xbt_dict_new_homogeneous(nullptr); // sub-ASes }; }}; // Namespace simgrid::s4u