X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/13e0c316176dfe56c04b66d96b65a174e76d0549..bc5903068a99bfc50a9f7a479cc3305326f774e9:/src/surf/network_interface.hpp diff --git a/src/surf/network_interface.hpp b/src/surf/network_interface.hpp index b9425d2ba0..9a680453c1 100644 --- a/src/surf/network_interface.hpp +++ b/src/surf/network_interface.hpp @@ -22,6 +22,34 @@ typedef NetworkLink *NetworkLinkPtr; class NetworkAction; typedef NetworkAction *NetworkActionPtr; +/************* + * Callbacks * + *************/ + +/** @ingroup SURF_callbacks + * @brief Callbacks handler which emit the callbacks after NetworkLink creation * + * @detail Callback functions have the following signature: `void(NetworkLinkPtr)` + */ +extern surf_callback(void, NetworkLinkPtr) networkLinkCreatedCallbacks; + +/** @ingroup SURF_callbacks + * @brief Callbacks handler which emit the callbacks after NetworkLink destruction * + * @detail Callback functions have the following signature: `void(NetworkLinkPtr)` + */ +extern surf_callback(void, NetworkLinkPtr) networkLinkDestructedCallbacks; + +/** @ingroup SURF_callbacks + * @brief Callbacks handler which emit the callbacks after NetworkLink State changed * + * @detail Callback functions have the following signature: `void(NetworkLinkActionPtr)` + */ +extern surf_callback(void, NetworkLinkPtr) networkLinkStateChangedCallbacks; + +/** @ingroup SURF_callbacks + * @brief Callbacks handler which emit the callbacks after NetworkAction State changed * + * @detail Callback functions have the following signature: `void(NetworkActionPtr)` + */ +extern surf_callback(void, NetworkActionPtr) networkActionStateChangedCallbacks; + /********* * Tools * *********/ @@ -187,6 +215,11 @@ public: tmgr_history_t history, tmgr_trace_t state_trace); + /** + * @brief NetworkLink destructor + */ + ~NetworkLink(); + /** * @brief Get the bandwidth in bytes per second of current NetworkLink * @@ -216,6 +249,8 @@ public: */ bool isUsed(); + void setState(e_surf_resource_state_t state); + /* Using this object with the public part of model does not make sense */ double m_latCurrent; @@ -256,6 +291,8 @@ public: NetworkAction(ModelPtr model, double cost, bool failed, lmm_variable_t var) : Action(model, cost, failed, var) {}; + void setState(e_surf_action_state_t state); + double m_latency; double m_latCurrent; double m_weight;