protected:
friend s4u::Host;
friend s4u::Storage;
- void add_host(std::string name, simgrid::s4u::Host* host);
- void del_host(std::string name);
- void add_storage(std::string name, simgrid::s4u::Storage* storage);
- void del_storage(std::string name);
+ friend kernel::routing::NetPoint;
+ friend kernel::routing::NetZoneImpl;
+ void host_register(std::string name, simgrid::s4u::Host* host);
+ void host_unregister(std::string name);
+ void storage_register(std::string name, simgrid::s4u::Storage* storage);
+ void storage_unregister(std::string name);
+ void netpoint_register(simgrid::kernel::routing::NetPoint* card);
+ void netpoint_unregister(simgrid::kernel::routing::NetPoint* card);
public:
size_t get_host_count();
/** @brief Retrieve the netcard of the given name (or nullptr if not found) */
simgrid::kernel::routing::NetPoint* getNetpointByNameOrNull(std::string name);
void getNetpointList(std::vector<simgrid::kernel::routing::NetPoint*> * list);
- void netpointRegister(simgrid::kernel::routing::NetPoint * card);
- void netpointUnregister(simgrid::kernel::routing::NetPoint * card);
/** Returns whether SimGrid was initialized yet -- mostly for internal use */
static bool isInitialized();
id_ = netzone_p->addComponent(this);
else
id_ = static_cast<decltype(id_)>(-1);
- simgrid::s4u::Engine::getInstance()->netpointRegister(this);
+ simgrid::s4u::Engine::getInstance()->netpoint_register(this);
simgrid::kernel::routing::NetPoint::onCreation(this);
}
}
for (auto const& kv : bypass_routes_)
delete kv.second;
- simgrid::s4u::Engine::getInstance()->netpointUnregister(netpoint_);
+ simgrid::s4u::Engine::getInstance()->netpoint_unregister(netpoint_);
}
simgrid::s4u::Host* NetZoneImpl::create_host(const char* name, std::vector<double>* speedPerPstate, int coreAmount,
return res;
}
-void Engine::add_host(std::string name, simgrid::s4u::Host* host)
+void Engine::host_register(std::string name, simgrid::s4u::Host* host)
{
pimpl->hosts_[name] = host;
}
-void Engine::del_host(std::string name)
+void Engine::host_unregister(std::string name)
{
pimpl->hosts_.erase(name);
}
return storage == pimpl->storages_.end() ? nullptr : storage->second;
}
-void Engine::add_storage(std::string name, simgrid::s4u::Storage* storage)
+void Engine::storage_register(std::string name, simgrid::s4u::Storage* storage)
{
pimpl->storages_[name] = storage;
}
-void Engine::del_storage(std::string name)
+void Engine::storage_unregister(std::string name)
{
pimpl->storages_.erase(name);
}
list->push_back(kv.second);
}
/** @brief Register a new netpoint to the system */
-void Engine::netpointRegister(simgrid::kernel::routing::NetPoint* point)
+void Engine::netpoint_register(simgrid::kernel::routing::NetPoint* point)
{
// simgrid::simix::kernelImmediate([&]{ FIXME: this segfaults in set_thread
pimpl->netpoints_[point->get_name()] = point;
// });
}
/** @brief Unregister a given netpoint */
-void Engine::netpointUnregister(simgrid::kernel::routing::NetPoint* point)
+void Engine::netpoint_unregister(simgrid::kernel::routing::NetPoint* point)
{
simgrid::simix::kernelImmediate([this, point] {
pimpl->netpoints_.erase(point->get_name());
Host::Host(const char* name) : name_(name)
{
xbt_assert(Host::by_name_or_null(name) == nullptr, "Refusing to create a second host named '%s'.", name);
- Engine::getInstance()->add_host(std::string(name_), this);
+ Engine::getInstance()->host_register(std::string(name_), this);
new simgrid::surf::HostImpl(this);
}
delete pimpl_;
if (pimpl_netpoint != nullptr) // not removed yet by a children class
- simgrid::s4u::Engine::getInstance()->netpointUnregister(pimpl_netpoint);
+ simgrid::s4u::Engine::getInstance()->netpoint_unregister(pimpl_netpoint);
delete pimpl_cpu;
delete mounts;
}
if (not currentlyDestroying_) {
currentlyDestroying_ = true;
onDestruction(*this);
- Engine::getInstance()->del_host(std::string(name_));
+ Engine::getInstance()->host_unregister(std::string(name_));
delete this;
}
}
Storage::Storage(std::string name, surf::StorageImpl* pimpl) : pimpl_(pimpl), name_(name)
{
- simgrid::s4u::Engine::getInstance()->add_storage(name, this);
+ simgrid::s4u::Engine::getInstance()->storage_register(name, this);
}
Storage* Storage::byName(std::string name)