{
std::vector<const char*> storages;
for (auto const& s : storage_)
- if (s.second->getHost() == piface_->get_cname())
+ if (s.second->get_host() == piface_->get_cname())
storages.push_back(s.second->piface_.get_cname());
return storages;
}
{
StorageImpl::turn_on();
XBT_DEBUG("Create resource with Bread '%f' Bwrite '%f' and Size '%llu'", bread, bwrite, size);
- constraintRead_ = maxminSystem->constraint_new(this, bread);
- constraintWrite_ = maxminSystem->constraint_new(this, bwrite);
+ constraint_read_ = maxminSystem->constraint_new(this, bread);
+ constraint_write_ = maxminSystem->constraint_new(this, bwrite);
}
StorageImpl::~StorageImpl()
{
- xbt_assert(currentlyDestroying_, "Don't delete Storages directly. Call destroy() instead.");
+ xbt_assert(currently_destroying_, "Don't delete Storages directly. Call destroy() instead.");
}
/** @brief Fire the required callbacks and destroy the object
*/
void StorageImpl::destroy()
{
- if (not currentlyDestroying_) {
- currentlyDestroying_ = true;
+ if (not currently_destroying_) {
+ currently_destroying_ = true;
s4u::Storage::on_destruction(this->piface_);
delete this;
}
* @return The StorageAction corresponding to the writing
*/
virtual StorageAction* write(sg_size_t size) = 0;
- virtual std::string getHost() { return attach_; }
+ const std::string& get_host() const { return attach_; }
- lmm::Constraint* constraintWrite_; /* Constraint for maximum write bandwidth*/
- lmm::Constraint* constraintRead_; /* Constraint for maximum write bandwidth*/
+ lmm::Constraint* constraint_write_; /* Constraint for maximum write bandwidth*/
+ lmm::Constraint* constraint_read_; /* Constraint for maximum write bandwidth*/
std::string typeId_;
std::string content_name_; // Only used at parsing time then goes to the FileSystemExtension
sg_size_t size_; // Only used at parsing time then goes to the FileSystemExtension
private:
- bool currentlyDestroying_ = false;
+ bool currently_destroying_ = false;
// Name of the host to which this storage is attached. Only used at platform parsing time, then the interface stores
// the Host directly.
std::string attach_;
{
for (auto const& s : simgrid::s4u::Engine::get_instance()->get_all_storages()) {
simgrid::kernel::routing::NetPoint* host_elm =
- simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(s->get_impl()->getHost());
+ simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(s->get_impl()->get_host());
if (not host_elm)
surf_parse_error(std::string("Unable to attach storage ") + s->get_cname() + ": host " +
- s->get_impl()->getHost() + " does not exist.");
+ s->get_impl()->get_host() + " does not exist.");
else
- s->set_host(simgrid::s4u::Host::by_name(s->get_impl()->getHost()));
+ s->set_host(simgrid::s4u::Host::by_name(s->get_impl()->get_host()));
}
}
model->get_maxmin_system()->expand(storage->get_constraint(), get_variable(), 1.0);
switch(type) {
case s4u::Io::OpType::READ:
- model->get_maxmin_system()->expand(storage->constraintRead_, get_variable(), 1.0);
+ model->get_maxmin_system()->expand(storage->constraint_read_, get_variable(), 1.0);
break;
case s4u::Io::OpType::WRITE:
- model->get_maxmin_system()->expand(storage->constraintWrite_, get_variable(), 1.0);
+ model->get_maxmin_system()->expand(storage->constraint_write_, get_variable(), 1.0);
break;
default:
THROW_UNIMPLEMENTED;