Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Convert some config flags to C++ API.
[simgrid.git] / src / surf / StorageImpl.cpp
index 56ad247..999ec2a 100644 (file)
@@ -30,9 +30,9 @@ simgrid::xbt::signal<void(StorageAction*, kernel::resource::Action::State, kerne
  * Model *
  *********/
 
-StorageModel::StorageModel() : Model()
+StorageModel::StorageModel() : Model(Model::UpdateAlgo::Full)
 {
-  maxmin_system_ = new simgrid::kernel::lmm::System(true /* selective update */);
+  set_maxmin_system(new simgrid::kernel::lmm::System(true /* selective update */));
 }
 
 StorageModel::~StorageModel()
@@ -44,8 +44,8 @@ StorageModel::~StorageModel()
  * Resource *
  ************/
 
-StorageImpl::StorageImpl(kernel::resource::Model* model, std::string name, lmm_system_t maxminSystem, double bread,
-                         double bwrite, std::string type_id, std::string content_name, sg_size_t size,
+StorageImpl::StorageImpl(kernel::resource::Model* model, std::string name, kernel::lmm::System* maxminSystem,
+                         double bread, double bwrite, std::string type_id, std::string content_name, sg_size_t size,
                          std::string attach)
     : Resource(model, name.c_str(), maxminSystem->constraint_new(this, std::max(bread, bwrite)))
     , piface_(name, this)
@@ -54,7 +54,7 @@ StorageImpl::StorageImpl(kernel::resource::Model* model, std::string name, lmm_s
     , size_(size)
     , attach_(attach)
 {
-  StorageImpl::turnOn();
+  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);
@@ -65,7 +65,7 @@ StorageImpl::~StorageImpl()
   storageDestructedCallbacks(this);
 }
 
-bool StorageImpl::isUsed()
+bool StorageImpl::is_used()
 {
   THROW_UNIMPLEMENTED;
   return false;
@@ -76,17 +76,17 @@ void StorageImpl::apply_event(tmgr_trace_event_t /*event*/, double /*value*/)
   THROW_UNIMPLEMENTED;
 }
 
-void StorageImpl::turnOn()
+void StorageImpl::turn_on()
 {
-  if (isOff()) {
-    Resource::turnOn();
+  if (is_off()) {
+    Resource::turn_on();
     storageStateChangedCallbacks(this, 0, 1);
   }
 }
-void StorageImpl::turnOff()
+void StorageImpl::turn_off()
 {
-  if (isOn()) {
-    Resource::turnOff();
+  if (is_on()) {
+    Resource::turn_off();
     storageStateChangedCallbacks(this, 1, 0);
   }
 }
@@ -94,10 +94,10 @@ void StorageImpl::turnOff()
 /**********
  * Action *
  **********/
-void StorageAction::setState(Action::State state)
+void StorageAction::set_state(Action::State state)
 {
-  Action::State old = getState();
-  Action::setState(state);
+  Action::State old = get_state();
+  Action::set_state(state);
   storageActionStateChangedCallbacks(this, old, state);
 }
 }