Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://framagit.org/simgrid/simgrid
[simgrid.git] / src / surf / StorageImpl.hpp
index 70d8e4b..1e38c51 100644 (file)
@@ -34,18 +34,6 @@ class StorageAction;
 /** @ingroup SURF_storage_interface
  * @brief The possible type of action for the storage component
  */
-/*************
- * Callbacks *
- *************/
-
-/** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after StorageAction State changed *
- * @details Callback functions have the following signature: `void(StorageAction *action,
- * simgrid::kernel::resource::Action::State old, simgrid::kernel::resource::Action::State current)`
- */
-XBT_PUBLIC_DATA
-simgrid::xbt::signal<void(StorageAction*, kernel::resource::Action::State, kernel::resource::Action::State)>
-    on_state_change;
 
 /*********
  * Model *
@@ -94,7 +82,7 @@ public:
   void turn_off() override;
 
   void destroy(); // Must be called instead of the destructor
-  virtual Action* io_start(sg_size_t size, s4u::Io::OpType type) = 0;
+  virtual StorageAction* io_start(sg_size_t size, s4u::Io::OpType type) = 0;
   /**
    * @brief Read a file
    *
@@ -110,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
+  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_;
@@ -135,7 +123,12 @@ private:
  */
 class StorageAction : public Action {
 public:
-  static xbt::signal<void(StorageAction*, Action::State, Action::State)> on_state_change;
+  /**
+   * @brief Callbacks handler which emit the callbacks after StorageAction State changed *
+   * @details Callback functions have the following signature: `void(StorageAction& action,
+   * simgrid::kernel::resource::Action::State old, simgrid::kernel::resource::Action::State current)`
+   */
+  static xbt::signal<void(StorageAction const&, Action::State, Action::State)> on_state_change;
 
   /**
    * @brief StorageAction constructor