- 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_});
- }
+ if (not coords.empty())
+ kernel::actor::simcall_object_access(pimpl_, [this, coords] { this->pimpl_netpoint_->set_coordinates(coords); });
+ return this;
+}
+std::vector<Disk*> Host::get_disks() const
+{
+ return this->pimpl_->get_disks();
+}
+
+Disk* Host::create_disk(const std::string& name, double read_bandwidth, double write_bandwidth)
+{
+ return kernel::actor::simcall_answered([this, &name, read_bandwidth, write_bandwidth] {
+ auto* disk = pimpl_->create_disk(name, read_bandwidth, write_bandwidth);
+ pimpl_->add_disk(disk);
+ return disk;
+ });
+}
+
+Disk* Host::create_disk(const std::string& name, const std::string& read_bandwidth, const std::string& write_bandwidth)
+{
+ double d_read;
+ try {
+ d_read = xbt_parse_get_bandwidth("", 0, read_bandwidth, "");
+ } catch (const simgrid::ParseError&) {
+ throw std::invalid_argument("Impossible to create disk: " + name + ". Invalid read bandwidth: " + read_bandwidth);
+ }
+ double d_write;
+ try {
+ d_write = xbt_parse_get_bandwidth("", 0, write_bandwidth, "");
+ } catch (const simgrid::ParseError&) {
+ throw std::invalid_argument("Impossible to create disk: " + name + ". Invalid write bandwidth: " + write_bandwidth);