X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f9e6853d2c5b7b867211700bc12f0ee57f640b30..a279c221114b93985c6aa249e71cc4141082b310:/src/surf/storage_interface.cpp diff --git a/src/surf/storage_interface.cpp b/src/surf/storage_interface.cpp index 5e1ef7340f..d1c824d2fb 100644 --- a/src/surf/storage_interface.cpp +++ b/src/surf/storage_interface.cpp @@ -26,8 +26,8 @@ StorageModelPtr surf_storage_model = NULL; surf_callback(void, StoragePtr) storageCreatedCallbacks; surf_callback(void, StoragePtr) storageDestructedCallbacks; -surf_callback(void, StoragePtr) storageStateChangedCallbacks; -surf_callback(void, StorageActionPtr) storageActionStateChangedCallbacks; +surf_callback(void, StoragePtr, e_surf_resource_state_t, e_surf_resource_state_t) storageStateChangedCallbacks; +surf_callback(void, StorageActionPtr, e_surf_action_state_t, e_surf_action_state_t) storageActionStateChangedCallbacks; /********* * Model * @@ -138,8 +138,9 @@ void Storage::updateState(tmgr_trace_event_t /*event_type*/, double /*value*/, d void Storage::setState(e_surf_resource_state_t state) { + e_surf_resource_state_t old = Resource::getState(); Resource::setState(state); - surf_callback_emit(storageStateChangedCallbacks, this); + surf_callback_emit(storageStateChangedCallbacks, this, old, state); } xbt_dict_t Storage::getContent() @@ -179,6 +180,7 @@ StorageAction::StorageAction(ModelPtr model, double cost, bool failed, lmm_varia } void StorageAction::setState(e_surf_action_state_t state){ + e_surf_action_state_t old = getState(); Action::setState(state); - surf_callback_emit(storageActionStateChangedCallbacks, this); + surf_callback_emit(storageActionStateChangedCallbacks, this, old, state); }