Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move content from the sg_platf to the object hierarchy
[simgrid.git] / src / kernel / routing / AsImpl.cpp
index 40c9400..38b857e 100644 (file)
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(AsImpl,surf, "Implementation of S4U autonomous systems");
 
 namespace simgrid {
+  namespace kernel {
   namespace routing {
 
-    AsImpl::AsImpl(const char *name)
-    : As(name)
-    {
-    }
-    AsImpl::~AsImpl()
-    {
-    }
+  AsImpl::AsImpl(As* father, const char* name) : As(father, 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_);
+    XBT_DEBUG("Having set name '%s' id '%d'", name, netcard_->id());
+  }
+  AsImpl::~AsImpl() = default;
 
-    xbt_dynar_t AsImpl::getOneLinkRoutes() {
-      return nullptr;
+  xbt_dynar_t AsImpl::getOneLinkRoutes()
+  {
+    return nullptr;
     }
 
     /** @brief Get the common ancestor and its first childs in each line leading to src and dst */
@@ -217,5 +220,4 @@ namespace simgrid {
 
     }
 
-  }
-};
+}}} // namespace