-/* Copyright (c) 2013-2021. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2013-2022. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
}
}
-static void remove_active_exec(s4u::Activity& task)
+static void remove_active_exec(s4u::Activity const& task)
{
- const auto* exec = dynamic_cast<s4u::Exec*>(&task);
+ const auto* exec = dynamic_cast<s4u::Exec const*>(&task);
if (exec == nullptr)
return;
if (not exec->is_assigned())
VMModel::VMModel(const std::string& name) : HostModel(name)
{
- s4u::Host::on_state_change.connect(host_state_change);
- s4u::Exec::on_start.connect(add_active_exec);
- s4u::Activity::on_completion.connect(remove_active_exec);
+ s4u::Host::on_state_change_cb(host_state_change);
+ s4u::Exec::on_start_cb(add_active_exec);
+ s4u::Activity::on_completion_cb(remove_active_exec);
activity::ActivityImpl::on_resumed.connect(add_active_activity);
activity::ActivityImpl::on_suspended.connect(remove_active_activity);
}
/** @brief A physical host does not disappear in the current SimGrid code, but a VM may disappear during a simulation */
void VirtualMachineImpl::vm_destroy()
{
- s4u::VirtualMachine::on_destruction(*piface_);
/* I was already removed from the allVms set if the VM was destroyed cleanly */
auto iter = find(allVms_.begin(), allVms_.end(), piface_);
if (iter != allVms_.end())