- explicit HostImpl(s4u::Host* host);
- virtual ~HostImpl();
-
- /** @brief Get the vector of storages (by names) attached to the Host */
- virtual std::vector<const char*> get_attached_storages();
-
- std::map<std::string, simgrid::surf::StorageImpl*> storage_;
- simgrid::s4u::Host* piface_ = nullptr;
-
- void turn_on();
- void turn_off();
+ 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);
+ s4u::VirtualMachine* create_vm(const std::string& name, int core_amount, size_t ramsize = 1024);
+ s4u::VirtualMachine* create_vm(const std::string& name, s4u::VirtualMachine* vm);
+ void destroy_vm(const std::string& name);
+ void add_disk(const s4u::Disk* disk);
+ void remove_disk(const std::string& name);
+ /** @brief Moves VM from this host to destination. Only sets the vm_ accordingly */
+ void move_vm(VirtualMachineImpl* vm, HostImpl* destination);
+ std::vector<s4u::VirtualMachine*> get_vms() const;
+ VirtualMachineImpl* get_vm_by_name_or_null(const std::string& name) const;
+
+ 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 */
+ std::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(); }
+
+ routing::NetZoneImpl* get_englobing_zone() const { return englobing_zone_; }
+ /** @brief Set the NetZone in which this Host is included */
+ HostImpl* set_englobing_zone(routing::NetZoneImpl* netzone_p);
+
+ void turn_on() const;
+ void turn_off(const actor::ActorImpl* issuer);