X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/153259d001d7e03ebc06ea7dc27803788a9cdb9d..a8c316ac06c17368f52aff8c009e63421103cc24:/src/surf/host_interface.hpp diff --git a/src/surf/host_interface.hpp b/src/surf/host_interface.hpp index 8fde63d95d..986bff7db4 100644 --- a/src/surf/host_interface.hpp +++ b/src/surf/host_interface.hpp @@ -26,29 +26,6 @@ class XBT_PRIVATE HostModel; class XBT_PRIVATE Host; class XBT_PRIVATE HostAction; -/************* - * Callbacks * - *************/ - -/** @ingroup SURF_callbacks - * @brief Callbacks fired after Host creation. Signature: `void(Host*)` - */ -XBT_PUBLIC_DATA(simgrid::surf::signal) hostCreatedCallbacks; - -/** @ingroup SURF_callbacks - * @brief Callbacks fired Host destruction. Signature: `void(Host*)` - */ -XBT_PUBLIC_DATA(simgrid::surf::signal) hostDestructedCallbacks; - -/** @ingroup SURF_callbacks - * @brief Callbacks fired after Host State changed. Signature: `void(Host *, e_surf_resource_state_t old, e_surf_resource_state_t current)` - */ -XBT_PUBLIC_DATA(simgrid::surf::signal) hostStateChangedCallbacks; - -/** @ingroup SURF_callbacks - * @brief Callbacks fired HostAction State changed. Signature: `void(HostAction *, e_surf_action_state_t old, e_surf_action_state_t current)` - */ -XBT_PUBLIC_DATA(simgrid::surf::signal) hostActionStateChangedCallbacks; } } @@ -70,7 +47,7 @@ namespace surf { * @brief SURF Host model interface class * @details A model is an object which handle the interactions between its Resources and its Actions */ -class HostModel : public Model { +class HostModel : public Model{ public: HostModel() : Model() {} ~HostModel() {} @@ -99,6 +76,13 @@ class Host : public simgrid::surf::Resource, public simgrid::surf::PropertyHolder { public: static simgrid::xbt::Extension EXTENSION_ID; + + /* callbacks */ + static simgrid::surf::signal onCreation; /** Called on each newly created object */ + static simgrid::surf::signal onDestruction; /** Called just before destructing an object */ + static simgrid::surf::signal onStateChange; + +public: static void init(); /** * @brief Host constructor @@ -292,6 +276,8 @@ private: */ class HostAction : public Action { public: + static simgrid::surf::signal onStateChange; + /** * @brief HostAction constructor *