Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #45 from mpoquet/master
[simgrid.git] / src / surf / storage_interface.hpp
index a449ac9..125962e 100644 (file)
@@ -43,9 +43,9 @@ XBT_PUBLIC_DATA(simgrid::surf::signal<void(simgrid::surf::Storage*)>) storageDes
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Storage State changed *
- * @details Callback functions have the following signature: `void(StorageAction *action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
+ * @details Callback functions have the following signature: `void(StorageAction *action, int previouslyOn, int currentlyOn)`
  */
-XBT_PUBLIC_DATA(simgrid::surf::signal<void(simgrid::surf::Storage*, e_surf_resource_state_t, e_surf_resource_state_t)>) storageStateChangedCallbacks;
+XBT_PUBLIC_DATA(simgrid::surf::signal<void(simgrid::surf::Storage*, int, int)>) storageStateChangedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after StorageAction State changed *
@@ -109,7 +109,7 @@ public:
    * @param size [description]
    */
   Storage(Model *model, const char *name, xbt_dict_t props,
-          const char* type_id, char *content_name, char *content_type,
+          const char* type_id, const char *content_name, const char *content_type,
           sg_size_t size);
 
   /**
@@ -131,8 +131,8 @@ public:
   Storage(Model *model, const char *name, xbt_dict_t props,
           lmm_system_t maxminSystem, double bread, double bwrite,
           double bconnection,
-          const char* type_id, char *content_name, char *content_type,
-          sg_size_t size, char *attach);
+          const char* type_id, const char *content_name, const char *content_type,
+          sg_size_t size, const char *attach);
 
   ~Storage();
 
@@ -148,14 +148,15 @@ public:
    */
   void updateState(tmgr_trace_event_t event_type, double value, double date);
 
-  void setState(e_surf_resource_state_t state);
+  void turnOn() override;
+  void turnOff() override;
 
   xbt_dict_t p_content;
   char* p_contentType;
   sg_size_t m_size;
   sg_size_t m_usedSize;
   char * p_typeId;
-  char* p_attach;
+  char* p_attach; //FIXME: this is the name of the host. Use the host directly
 
   /**
    * @brief Open a file
@@ -222,7 +223,7 @@ public:
   virtual sg_size_t getUsedSize();
 
 
-  xbt_dict_t parseContent(char *filename);
+  xbt_dict_t parseContent(const char *filename);
 
   xbt_dynar_t p_writeActions;