Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cleanup in the Link field names
[simgrid.git] / src / kernel / routing / AsImpl.cpp
index 38b857ee58fd94cc2841e7de130bf4981241c5f2..42d269cb91b3ab40cb5d9020a080ad2fdac4460d 100644 (file)
@@ -16,6 +16,9 @@ namespace simgrid {
 
   AsImpl::AsImpl(As* father, const char* name) : As(father, name)
   {
+    xbt_assert(nullptr == xbt_lib_get_or_null(as_router_lib, name, ROUTING_ASR_LEVEL),
+               "Refusing to create a second AS called \"%s\".", name);
+
     netcard_ = new simgrid::kernel::routing::NetCardImpl(name, simgrid::kernel::routing::NetCard::Type::As,
                                                          static_cast<AsImpl*>(father));
     xbt_lib_set(as_router_lib, name, ROUTING_ASR_LEVEL, (void*)netcard_);
@@ -187,7 +190,7 @@ namespace simgrid {
         for (surf::Link *link : *bypassed_route) {
           links->push_back(link);
           if (latency)
-            *latency += link->getLatency();
+            *latency += link->latency();
         }
         return;
       }