From: Arnaud Giersch Date: Tue, 14 May 2019 09:21:01 +0000 (+0200) Subject: Snake case. X-Git-Tag: v3.22.4~127^2~17 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/cc79d648c6fd0e8fc281e263c24fe72adbe59769 Snake case. --- diff --git a/src/surf/HostImpl.cpp b/src/surf/HostImpl.cpp index 09d521b66f..ff008bafaa 100644 --- a/src/surf/HostImpl.cpp +++ b/src/surf/HostImpl.cpp @@ -152,7 +152,7 @@ std::vector HostImpl::get_attached_storages() { std::vector 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; } diff --git a/src/surf/StorageImpl.cpp b/src/surf/StorageImpl.cpp index 31851772ae..8821467df8 100644 --- a/src/surf/StorageImpl.cpp +++ b/src/surf/StorageImpl.cpp @@ -47,13 +47,13 @@ StorageImpl::StorageImpl(kernel::resource::Model* model, const std::string& name { 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 @@ -62,8 +62,8 @@ StorageImpl::~StorageImpl() */ void StorageImpl::destroy() { - if (not currentlyDestroying_) { - currentlyDestroying_ = true; + if (not currently_destroying_) { + currently_destroying_ = true; s4u::Storage::on_destruction(this->piface_); delete this; } diff --git a/src/surf/StorageImpl.hpp b/src/surf/StorageImpl.hpp index ab66f327ed..da13a3ced4 100644 --- a/src/surf/StorageImpl.hpp +++ b/src/surf/StorageImpl.hpp @@ -98,17 +98,17 @@ public: * @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_; diff --git a/src/surf/storage_n11.cpp b/src/surf/storage_n11.cpp index 1b4095a89c..6518688671 100644 --- a/src/surf/storage_n11.cpp +++ b/src/surf/storage_n11.cpp @@ -22,12 +22,12 @@ void check_disk_attachment() { 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())); } } @@ -127,10 +127,10 @@ StorageN11Action::StorageN11Action(Model* model, double cost, bool failed, Stora 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;