namespace s4u {
-simgrid::xbt::signal<void(Host&)> Host::onCreation;
-simgrid::xbt::signal<void(Host&)> Host::onDestruction;
-simgrid::xbt::signal<void(Host&)> Host::onStateChange;
-simgrid::xbt::signal<void(Host&)> Host::onSpeedChange;
+simgrid::xbt::signal<void(Host&)> Host::on_creation;
+simgrid::xbt::signal<void(Host&)> Host::on_destruction;
+simgrid::xbt::signal<void(Host&)> Host::on_state_change;
+simgrid::xbt::signal<void(Host&)> Host::on_speed_change;
Host::Host(const char* name) : name_(name)
{
if (pimpl_netpoint != nullptr) // not removed yet by a children class
simgrid::s4u::Engine::get_instance()->netpoint_unregister(pimpl_netpoint);
delete pimpl_cpu;
- delete mounts;
+ delete mounts_;
}
/** @brief Fire the required callbacks and destroy the object
{
if (not currentlyDestroying_) {
currentlyDestroying_ = true;
- onDestruction(*this);
+ on_destruction(*this);
Engine::get_instance()->host_unregister(std::string(name_));
delete this;
}
simgrid::simix::simcall([this] {
this->extension<simgrid::simix::Host>()->turnOn();
this->pimpl_cpu->turn_on();
- onStateChange(*this);
+ on_state_change(*this);
});
}
}
smx_actor_t self = SIMIX_process_self();
simgrid::simix::simcall([this, self] {
SIMIX_host_off(this, self);
- onStateChange(*this);
+ on_state_change(*this);
});
}
}
std::unordered_map<std::string, Storage*> const& Host::getMountedStorages()
{
- if (mounts == nullptr) {
- mounts = new std::unordered_map<std::string, Storage*>();
+ if (mounts_ == nullptr) {
+ mounts_ = new std::unordered_map<std::string, Storage*>();
for (auto const& m : this->pimpl_->storage_) {
- mounts->insert({m.first, &m.second->piface_});
+ mounts_->insert({m.first, &m.second->piface_});
}
}
- return *mounts;
+ return *mounts_;
}
void Host::execute(double flops)