Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Snake case.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 14 May 2019 09:21:01 +0000 (11:21 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 14 May 2019 15:17:02 +0000 (17:17 +0200)
src/surf/HostImpl.cpp
src/surf/StorageImpl.cpp
src/surf/StorageImpl.hpp
src/surf/storage_n11.cpp

index 09d521b..ff008ba 100644 (file)
@@ -152,7 +152,7 @@ std::vector<const char*> HostImpl::get_attached_storages()
 {
   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;
 }
index 3185177..8821467 100644 (file)
@@ -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;
   }
index ab66f32..da13a3c 100644 (file)
@@ -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_;
index 1b4095a..6518688 100644 (file)
@@ -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;