kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
std::vector<surf::LinkImpl*>* link_list)>
onRouteCreation;
+ static simgrid::xbt::signal<void(NetZone&)> onCreation;
protected:
std::vector<kernel::routing::NetPoint*>
for (auto kv : *props)
res->setProperty(kv.first.c_str(), kv.second.c_str());
- simgrid::s4u::Host::onCreation(*res);
+ simgrid::s4u::Host::onCreation(*res); // notify the signal
return res;
}
kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
std::vector<surf::LinkImpl*>* link_list)>
NetZone::onRouteCreation;
+simgrid::xbt::signal<void(NetZone&)> NetZone::onCreation;
NetZone::NetZone(NetZone* father, const char* name) : father_(father), name_(xbt_strdup(name))
{
/*
* Callbacks
*/
-void sg_instr_AS_begin(sg_platf_AS_cbarg_t AS)
+static void sg_instr_AS_begin(simgrid::s4u::NetZone& netzone)
{
- const char*id = AS->id;
+ const char* id = netzone.name();
if (PJ_container_get_root() == nullptr){
PJ_container_alloc ();
{
//always need the call backs to ASes (we need only the root AS),
//to create the rootContainer and the rootType properly
- if (not TRACE_is_enabled() || not TRACE_needs_platform())
+ if (not TRACE_is_enabled())
return;
- simgrid::s4u::Link::onCreation.connect(instr_routing_parse_start_link);
- simgrid::s4u::onPlatformCreated.connect(instr_routing_parse_end_platform);
- simgrid::s4u::Host::onCreation.connect(sg_instr_new_host);
+ if (TRACE_needs_platform()) {
+ simgrid::s4u::Link::onCreation.connect(instr_routing_parse_start_link);
+ simgrid::s4u::onPlatformCreated.connect(instr_routing_parse_end_platform);
+ simgrid::s4u::Host::onCreation.connect(sg_instr_new_host);
+ }
+ simgrid::s4u::NetZone::onCreation.connect(sg_instr_AS_begin);
}
/*
/* set the new current component of the tree */
current_routing = new_as;
- if (TRACE_is_enabled())
- sg_instr_AS_begin(AS);
+ simgrid::s4u::NetZone::onCreation(*new_as); // notify the signal
return new_as;
}
XBT_PUBLIC(void) routing_route_free(sg_platf_route_cbarg_t route);
/********** Instr. **********/
-XBT_PRIVATE void sg_instr_AS_begin(sg_platf_AS_cbarg_t AS);
XBT_PRIVATE void sg_instr_new_router(const char* name);
XBT_PRIVATE void sg_instr_AS_end();