#include "surf_interface.hpp"
#include "src/surf/xml/platf_private.hpp" // FIXME: including this here is pure madness. KILKILKIL XML.
-#include "src/surf/AsImpl.hpp"
+#include "src/kernel/routing/AsImpl.hpp"
#include <float.h>
#include <vector>
-#include <map>
SG_BEGIN_DECL()
XBT_PUBLIC(void) routing_model_create(Link *loopback);
SG_END_DECL()
namespace simgrid {
-namespace surf {
+namespace kernel {
+namespace routing {
XBT_PUBLIC_DATA(simgrid::xbt::signal<void(s4u::As*)>) asCreatedCallbacks;
XBT_PUBLIC_DATA(simgrid::xbt::signal<void(NetCard*)>) netcardCreatedCallbacks;
class NetCard {
public:
virtual ~NetCard(){};
- virtual int id()=0; // Our rank in the vertices_ array of our containing AS.
+ virtual unsigned int id()=0; // Our rank in the vertices_ array of our containing AS.
virtual char *name()=0;
virtual AsImpl *containingAS()=0; // This is the AS in which I am
virtual bool isAS()=0;
{
if (containingAS != nullptr)
id_ = containingAS->addComponent(this);
- simgrid::surf::netcardCreatedCallbacks(this);
+ simgrid::kernel::routing::netcardCreatedCallbacks(this);
}
~NetCardImpl() { xbt_free(name_);};
- int id() override {return id_;}
+ unsigned int id() override {return id_;}
char *name() override {return name_;}
AsImpl *containingAS() override {return containingAS_;}
bool isRouter() override {return componentType_ == Type::Router;}
private:
- int id_ = -1;
+ unsigned int id_;
char *name_;
NetCard::Type componentType_;
AsImpl *containingAS_;
: src_(src), dst_(dst), link_(link) {};
NetCard *src_;
NetCard *dst_;
- void *link_;
+ void *link_; // FIXME: void* should die just like the death*
};
/** @ingroup SURF_routing_interface
*/
XBT_PUBLIC_CLASS RoutingPlatf {
public:
- RoutingPlatf(Link *loopback);
+ explicit RoutingPlatf(Link *loopback);
~RoutingPlatf();
AsImpl *root_ = nullptr;
Link *loopback_;
- xbt_dynar_t getOneLinkRoutes(void);
+ xbt_dynar_t getOneLinkRoutes();
void getRouteAndLatency(NetCard *src, NetCard *dst, std::vector<Link*> * links, double *latency);
};
-}
-}
+}}}
#endif /* NETWORK_ROUTING_HPP_ */