#ifndef KERNEL_ROUTING_NETCARD_HPP_
#define KERNEL_ROUTING_NETCARD_HPP_
+#include <xbt/Extendable.hpp>
#include <xbt/base.h>
#include <xbt/signal.hpp>
namespace simgrid {
namespace kernel {
namespace routing {
-XBT_PUBLIC_DATA(simgrid::xbt::signal<void(NetCard*)>) netcardCreatedCallbacks;
/** @ingroup SURF_routing_interface
* @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
*/
-class NetCard {
+class NetCard : public simgrid::xbt::Extendable<NetCard> {
+
public:
enum class Type { Host, Router, As };
{
if (containingAS != nullptr)
id_ = containingAS->addComponent(this);
- simgrid::kernel::routing::netcardCreatedCallbacks(this);
+ simgrid::kernel::routing::NetCard::onCreation(this);
}
~NetCard() = default;
bool isHost() { return componentType_ == Type::Host; }
bool isRouter() { return componentType_ == Type::Router; }
+ static simgrid::xbt::signal<void(NetCard*)> onCreation;
+
private:
unsigned int id_;
std::string name_;