-/** @brief Retrieve the AS of the given name (or nullptr if not found) */
-As *Engine::asByNameOrNull(const char *name) {
- return asByNameRecursive(rootAs(),name);
+/** @brief Retrieve the NetZone of the given name (or nullptr if not found) */
+NetZone* Engine::getNetzoneByNameOrNull(const char* name)
+{
+ return netzoneByNameRecursive(getNetRoot(), name);
+}
+
+/** @brief Retrieve the netpoint of the given name (or nullptr if not found) */
+simgrid::kernel::routing::NetPoint* Engine::getNetpointByNameOrNull(std::string name)
+{
+ auto netp = pimpl->netpoints_.find(name);
+ return netp == pimpl->netpoints_.end() ? nullptr : netp->second;
+}
+
+/** @brief Fill the provided vector with all existing netpoints */
+void Engine::getNetpointList(std::vector<simgrid::kernel::routing::NetPoint*>* list)
+{
+ for (auto const& kv : pimpl->netpoints_)
+ list->push_back(kv.second);
+}
+/** @brief Register a new netpoint to the system */
+void Engine::netpointRegister(simgrid::kernel::routing::NetPoint* point)
+{
+ // simgrid::simix::kernelImmediate([&]{ FIXME: this segfaults in set_thread
+ pimpl->netpoints_[point->getName()] = point;
+ // });
+}
+/** @brief Unregister a given netpoint */
+void Engine::netpointUnregister(simgrid::kernel::routing::NetPoint* point)
+{
+ simgrid::simix::kernelImmediate([this, point] {
+ pimpl->netpoints_.erase(point->getName());
+ delete point;
+ });