- explicit HostImpl(s4u::Host* host);
- virtual ~HostImpl() = default;
-
- /** @brief Get the vector of storages (by names) attached to the Host */
- virtual void getAttachedStorageList(std::vector<const char*>* storages);
-
- std::map<std::string, simgrid::surf::StorageImpl*> storage_;
- simgrid::s4u::Host* piface_ = nullptr;
-
- simgrid::s4u::Host* getHost() { return piface_; }
+ friend VirtualMachineImpl;
+ explicit HostImpl(const std::string& name);
+
+ void destroy(); // Must be called instead of the destructor
+
+ std::vector<s4u::Disk*> get_disks() const;
+ s4u::Disk* create_disk(const std::string& name, double read_bandwidth, double write_bandwidth);
+ void add_disk(const s4u::Disk* disk);
+ void remove_disk(const std::string& name);
+
+ virtual const s4u::Host* get_iface() const { return &piface_; }
+ virtual s4u::Host* get_iface() { return &piface_; }
+
+ /** Retrieves the name of that host as a C++ string */
+ xbt::string const& get_name() const { return name_; }
+ /** Retrieves the name of that host as a C string */
+ const char* get_cname() const { return name_.c_str(); }
+
+ void turn_on() const;
+ void turn_off(const actor::ActorImpl* issuer);
+ std::vector<s4u::ActorPtr> get_all_actors();
+ size_t get_actor_count() const;
+ void add_actor(actor::ActorImpl* actor) { actor_list_.push_back(*actor); }
+ void remove_actor(actor::ActorImpl* actor) { xbt::intrusive_erase(actor_list_, *actor); }
+ void add_actor_at_boot(actor::ProcessArg* arg) { actors_at_boot_.emplace_back(arg); }
+
+ void seal();
+
+ template <class F> void foreach_actor(F function)
+ {
+ for (auto& actor : actor_list_)
+ function(actor);
+ }