Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use simgrid::Host instead of xbt_dictelt_t for root main object
[simgrid.git] / src / surf / storage_interface.cpp
index 5718a00..a723966 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "storage_interface.hpp"
 #include "surf_private.h"
+#include "xbt/file.h" /* xbt_getline */
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_storage, surf,
                                 "Logging specific to the SURF storage module");
@@ -18,16 +19,19 @@ int SURF_STORAGE_LEVEL;
 xbt_lib_t storage_type_lib;
 int ROUTING_STORAGE_TYPE_LEVEL; //Routing for storage_type level
 xbt_dynar_t mount_list = NULL;
-StorageModel *surf_storage_model = NULL;
+simgrid::surf::StorageModel *surf_storage_model = NULL;
+
+namespace simgrid {
+namespace surf {
 
 /*************
  * Callbacks *
  *************/
 
-surf_callback(void, Storage*) storageCreatedCallbacks;
-surf_callback(void, Storage*) storageDestructedCallbacks;
-surf_callback(void, Storage*, e_surf_resource_state_t, e_surf_resource_state_t) storageStateChangedCallbacks;
-surf_callback(void, StorageAction*, e_surf_action_state_t, e_surf_action_state_t) storageActionStateChangedCallbacks;
+surf_callback(void, simgrid::surf::Storage*) storageCreatedCallbacks;
+surf_callback(void, simgrid::surf::Storage*) storageDestructedCallbacks;
+surf_callback(void, simgrid::surf::Storage*, e_surf_resource_state_t, e_surf_resource_state_t) storageStateChangedCallbacks;
+surf_callback(void, simgrid::surf::StorageAction*, e_surf_action_state_t, e_surf_action_state_t) storageActionStateChangedCallbacks;
 
 /*********
  * Model *
@@ -60,7 +64,6 @@ Storage::Storage(Model *model, const char *name, xbt_dict_t props,
  , p_typeId(xbt_strdup(type_id))
  , p_writeActions(xbt_dynar_new(sizeof(Action*),NULL))
 {
-  surf_callback_emit(storageCreatedCallbacks, this);
   p_content = parseContent(content_name);
   setState(SURF_RESOURCE_ON);
 }
@@ -74,7 +77,6 @@ Storage::Storage(Model *model, const char *name, xbt_dict_t props,
  , m_size(size), m_usedSize(0)
  , p_typeId(xbt_strdup(type_id))
  , p_writeActions(xbt_dynar_new(sizeof(Action*),NULL)) {
-  surf_callback_emit(storageCreatedCallbacks, this);
   p_content = parseContent(content_name);
   p_attach = xbt_strdup(attach);
   setState(SURF_RESOURCE_ON);
@@ -196,3 +198,6 @@ void StorageAction::setState(e_surf_action_state_t state){
   Action::setState(state);
   surf_callback_emit(storageActionStateChangedCallbacks, this, old, state);
 }
+
+}
+}