From cdc03fc96da89f61950be092cf6b7ac069075e29 Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Thu, 24 Oct 2019 18:43:58 +0200 Subject: [PATCH] make actors_at_boot_ private --- src/s4u/s4u_Actor.cpp | 4 ++-- src/surf/HostImpl.hpp | 3 ++- src/surf/sg_platf.cpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/s4u/s4u_Actor.cpp b/src/s4u/s4u_Actor.cpp index 5859a097b6..51bfd453cd 100644 --- a/src/s4u/s4u_Actor.cpp +++ b/src/s4u/s4u_Actor.cpp @@ -115,8 +115,8 @@ void Actor::set_auto_restart(bool autorestart) pimpl_->set_auto_restart(autorestart); kernel::actor::ProcessArg* arg = new kernel::actor::ProcessArg(pimpl_->get_host(), pimpl_); - XBT_DEBUG("Adding Process %s to the actors_at_boot_ list of Host %s", arg->name.c_str(), arg->host->get_cname()); - pimpl_->get_host()->pimpl_->actors_at_boot_.emplace_back(arg); + XBT_DEBUG("Adding %s to the actors_at_boot_ list of Host %s", arg->name.c_str(), arg->host->get_cname()); + pimpl_->get_host()->pimpl_->add_actor_at_boot(arg); }); } diff --git a/src/surf/HostImpl.hpp b/src/surf/HostImpl.hpp index 474fc6e3da..fa0c5db181 100644 --- a/src/surf/HostImpl.hpp +++ b/src/surf/HostImpl.hpp @@ -43,6 +43,7 @@ public: * @details An host represents a machine with a aggregation of a Cpu, a RoutingEdge and a Storage */ class XBT_PRIVATE HostImpl : public simgrid::surf::PropertyHolder { + std::vector actors_at_boot_; public: friend simgrid::vm::VirtualMachineImpl; @@ -67,6 +68,7 @@ public: size_t get_actor_count(); void add_actor(kernel::actor::ActorImpl* actor) { actor_list_.push_back(*actor); } void remove_actor(kernel::actor::ActorImpl* actor) { xbt::intrusive_erase(actor_list_, *actor); } + void add_actor_at_boot(kernel::actor::ProcessArg* arg) { actors_at_boot_.emplace_back(arg); } typedef boost::intrusive::list< kernel::actor::ActorImpl, @@ -76,7 +78,6 @@ public: // FIXME: make these private ActorList actor_list_; - std::vector actors_at_boot_; }; } } diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 9f7b6350fd..c86fbbbb7b 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -460,7 +460,7 @@ void sg_platf_new_actor(simgrid::kernel::routing::ActorCreationArgs* actor) simgrid::kernel::actor::ProcessArg* arg = new simgrid::kernel::actor::ProcessArg(actor_name, code, nullptr, host, kill_time, properties, auto_restart); - host->pimpl_->actors_at_boot_.emplace_back(arg); + host->pimpl_->add_actor_at_boot(arg); if (start_time > SIMIX_get_clock()) { -- 2.20.1