Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
AS are called netzones, now
[simgrid.git] / src / kernel / routing / NetCard.hpp
index 3f03189..0f0b45d 100644 (file)
@@ -19,26 +19,20 @@ namespace simgrid {
 namespace kernel {
 namespace routing {
 
-/** @ingroup SURF_routing_interface
- * @brief Network cards are the vertices in the graph representing the network, used to compute paths between nodes.
+/** @ingroup ROUTING_API
+ *  @brief Network cards are the vertices in the graph representing the network, used to compute paths between nodes.
  *
- * @details This represents a position in the network. One can route information between two netcards
+ * @details This represents a position in the network. One can send information between two netcards
  */
 class NetCard : public simgrid::xbt::Extendable<NetCard> {
 
 public:
   enum class Type { Host, Router, NetZone };
 
-  NetCard(std::string name, NetCard::Type componentType, NetZoneImpl* netzone_p)
-      : name_(name), componentType_(componentType), netzone_(netzone_p)
-  {
-    if (netzone_p != nullptr)
-      id_ = netzone_p->addComponent(this);
-    simgrid::kernel::routing::NetCard::onCreation(this);
-  }
+  NetCard(std::string name, NetCard::Type componentType, NetZoneImpl* netzone_p);
   ~NetCard() = default;
 
-  // Our rank in the vertices_ array of our containing AS.
+  // Our rank in the vertices_ array of the netzone that contains us.
   unsigned int id() { return id_; }
   std::string name() { return name_; }
   const char* cname() { return name_.c_str(); }
@@ -51,6 +45,8 @@ public:
 
   static simgrid::xbt::signal<void(NetCard*)> onCreation;
 
+  bool operator<(const NetCard &rhs) const { return name_ < rhs.name_; }
+
 private:
   unsigned int id_;
   std::string name_;