Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[surf] Move storageCreatedCallbacks outside of constructor
authorGabriel Corona <gabriel.corona@loria.fr>
Tue, 24 Nov 2015 12:31:42 +0000 (13:31 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Tue, 24 Nov 2015 12:31:42 +0000 (13:31 +0100)
src/surf/storage_interface.cpp
src/surf/storage_n11.cpp

index 073a6ef..4720735 100644 (file)
@@ -61,7 +61,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))
 {
  , 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);
 }
   p_content = parseContent(content_name);
   setState(SURF_RESOURCE_ON);
 }
@@ -75,7 +74,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)) {
  , 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);
   p_content = parseContent(content_name);
   p_attach = xbt_strdup(attach);
   setState(SURF_RESOURCE_ON);
index a2614f8..01769e1 100644 (file)
@@ -252,7 +252,7 @@ Storage *StorageN11Model::createStorage(const char* id, const char* type_id,
   Storage *storage = new StorageN11(this, id, properties, p_maxminSystem,
       Bread, Bwrite, Bconnection, type_id, (char *)content_name,
       xbt_strdup(content_type), storage_type->size, (char *) attach);
   Storage *storage = new StorageN11(this, id, properties, p_maxminSystem,
       Bread, Bwrite, Bconnection, type_id, (char *)content_name,
       xbt_strdup(content_type), storage_type->size, (char *) attach);
-
+  surf_callback_emit(storageCreatedCallbacks, storage);
   xbt_lib_set(storage_lib, id, SURF_STORAGE_LEVEL, storage);
 
   XBT_DEBUG("SURF storage create resource\n\t\tid '%s'\n\t\ttype '%s'\n\t\tproperties '%p'\n\t\tBread '%f'\n",
   xbt_lib_set(storage_lib, id, SURF_STORAGE_LEVEL, storage);
 
   XBT_DEBUG("SURF storage create resource\n\t\tid '%s'\n\t\ttype '%s'\n\t\tproperties '%p'\n\t\tBread '%f'\n",