Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
first compiling version
[simgrid.git] / src / surf / StorageImpl.hpp
index 530c728..6d47c15 100644 (file)
@@ -24,6 +24,13 @@ namespace surf {
  ***********/
 
 class StorageAction;
+/** @ingroup SURF_storage_interface
+ * @brief The possible type of action for the storage component
+ */
+enum e_surf_action_storage_type_t {
+  READ = 0, /**< Read a file */
+  WRITE     /**< Write in a file */
+};
 
 /*************
  * Callbacks *
@@ -64,7 +71,7 @@ public:
 class StorageImpl : public kernel::resource::Resource, public PropertyHolder {
 public:
   /** @brief Storage constructor */
-  StorageImpl(kernel::resource::Model* model, std::string name, kernel::lmm::System* maxminSystem, double bread,
+  StorageImpl(kernel::resource::Model* model, std::string name, kernel::lmm::System* maxmin_system, double bread,
               double bwrite, std::string type_id, std::string content_name, sg_size_t size, std::string attach);
 
   ~StorageImpl() override;
@@ -81,7 +88,7 @@ public:
   void turn_off() override;
 
   void destroy(); // Must be called instead of the destructor
-
+  virtual simgrid::kernel::resource::Action* io_start(sg_size_t size, e_surf_action_storage_type_t type) = 0;
   /**
    * @brief Read a file
    *
@@ -117,14 +124,6 @@ private:
  * Action *
  **********/
 
-/** @ingroup SURF_storage_interface
- * @brief The possible type of action for the storage component
- */
-enum e_surf_action_storage_type_t {
-  READ = 0, /**< Read a file */
-  WRITE     /**< Write in a file */
-};
-
 /** @ingroup SURF_storage_interface
  * @brief SURF storage action interface class
  */
@@ -171,11 +170,12 @@ public:
   std::string id;
   std::string model;
   std::string content;
-  std::map<std::string, std::string>* properties;
-  std::map<std::string, std::string>* model_properties;
+  std::unordered_map<std::string, std::string>* properties;
+  std::unordered_map<std::string, std::string>* model_properties;
   sg_size_t size;
-  StorageType(std::string id, std::string model, std::string content, std::map<std::string, std::string>* properties,
-              std::map<std::string, std::string>* model_properties, sg_size_t size)
+  StorageType(std::string id, std::string model, std::string content,
+              std::unordered_map<std::string, std::string>* properties,
+              std::unordered_map<std::string, std::string>* model_properties, sg_size_t size)
       : id(id), model(model), content(content), properties(properties), model_properties(model_properties), size(size)
   {
   }