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(); }
static simgrid::xbt::signal<void(NetCard*)> onCreation;
+ bool operator<(const NetCard &rhs) const { return name_ < rhs.name_; }
+
private:
unsigned int id_;
std::string name_;