+/** @brief Returns the amount of links in the platform */
+size_t Engine::getLinkCount()
+{
+ return simgrid::surf::LinkImpl::linksCount();
+}
+/** @brief Fills the passed list with all links found in the platform */
+void Engine::getLinkList(std::vector<Link*>* list)
+{
+ simgrid::surf::LinkImpl::linksList(list);
+}
+/** @brief Returns the list of all links found in the platform */
+std::vector<Link*> Engine::getLinkList()
+{
+ std::vector<Link*> res;
+ simgrid::surf::LinkImpl::linksList(&res);
+ return res;
+}
+
+void Engine::run() {
+ if (MC_is_active()) {
+ MC_run();
+ } else {
+ SIMIX_run();
+ }
+}
+
+s4u::NetZone* Engine::getNetRoot()
+{
+ return pimpl->netRoot_;
+}
+
+static s4u::NetZone* netzoneByNameRecursive(s4u::NetZone* current, const char* name)
+{
+ if (not strcmp(current->getCname(), name))
+ return current;
+
+ for (auto const& elem : *(current->getChildren())) {
+ simgrid::s4u::NetZone* tmp = netzoneByNameRecursive(elem, name);
+ if (tmp != nullptr) {
+ return tmp;
+ }
+ }
+ return nullptr;
+}
+
+/** @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;
+ });
+}
+
+bool Engine::isInitialized()
+{
+ return Engine::instance_ != nullptr;
+}
+void Engine::setConfig(std::string str)
+{
+ xbt_cfg_set_parse(str.c_str());
+}