Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
reduce the public exposure of netcards_dict
[simgrid.git] / src / s4u / s4u_engine.cpp
index 0f8798d..71bf838 100644 (file)
@@ -111,5 +111,10 @@ NetZone* Engine::netzoneByNameOrNull(const char* name)
   return netzoneByNameRecursive(netRoot(), name);
 }
 
+/** @brief Retrieve the netcard of the given name (or nullptr if not found) */
+simgrid::kernel::routing::NetCard* Engine::netcardByNameOrNull(const char* name)
+{
+  return static_cast<simgrid::kernel::routing::NetCard*>(xbt_dict_get_or_null(netcards_dict, name));
+}
 }
 }