X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a714f2cc13ccf01d24d8848aafc9085aef8eb6ce..8d777265e12b0b9c5f13fecfc719474cdd214e9e:/src/surf/network_interface.hpp diff --git a/src/surf/network_interface.hpp b/src/surf/network_interface.hpp index 2226805752..5e26f23832 100644 --- a/src/surf/network_interface.hpp +++ b/src/surf/network_interface.hpp @@ -33,35 +33,14 @@ class NetworkAction; * Callbacks * *************/ -/** @ingroup SURF_callbacks - * @brief Callbacks handler which emits the callbacks after Link creation - * @details Callback functions have the following signature: `void(Link*)` - */ -XBT_PUBLIC_DATA(simgrid::surf::signal) networkLinkCreatedCallbacks; - -/** @ingroup SURF_callbacks - * @brief Callbacks handler which emits the callbacks after Link destruction - * @details Callback functions have the following signature: `void(Link*)` - */ -XBT_PUBLIC_DATA(simgrid::surf::signal) networkLinkDestructedCallbacks; - -/** @ingroup SURF_callbacks - * @brief Callbacks handler which emits the callbacks after Link State changed - * @details Callback functions have the following signature: `void(LinkAction *action, e_surf_resource_state_t old, e_surf_resource_state_t current)` - */ -XBT_PUBLIC_DATA(simgrid::surf::signal) networkLinkStateChangedCallbacks; -/** @ingroup SURF_callbacks - * @brief Callbacks handler which emits the callbacks after NetworkAction State changed - * @details Callback functions have the following signature: `void(NetworkAction *action, e_surf_action_state_t old, e_surf_action_state_t current)` - */ -XBT_PUBLIC_DATA(simgrid::surf::signal) networkActionStateChangedCallbacks; +/** @brief Callback signal fired when the state of a NetworkAction changes + * Signature: `void(NetworkAction *action, e_surf_action_state_t old, e_surf_action_state_t current)` */ +XBT_PUBLIC_DATA(simgrid::xbt::signal) networkActionStateChangedCallbacks; -/** @ingroup SURF_callbacks - * @brief Callbacks handler which emits the callbacks after communication created - * @details Callback functions have the following signature: `void(NetworkAction *action, RoutingEdge *src, RoutingEdge *dst, double size, double rate)` - */ -XBT_PUBLIC_DATA(simgrid::surf::signal) networkCommunicateCallbacks; +/** @brief Callback signal fired when a NetworkAction is created (when a communication starts) + * Signature: `void(NetworkAction *action, RoutingEdge *src, RoutingEdge *dst, double size, double rate)` */ +XBT_PUBLIC_DATA(simgrid::xbt::signal) networkCommunicateCallbacks; } } @@ -71,8 +50,6 @@ XBT_PUBLIC_DATA(simgrid::surf::signal onCreation; + + /** @brief Callback signal fired when a Link is destroyed. + * Signature: void(Link*) */ + static simgrid::xbt::signal onDestruction; + + /** @brief Callback signal fired when the state of a Link changes + * Signature: `void(LinkAction *action, int previouslyOn, int currentlyOn)` */ + static simgrid::xbt::signal onStateChange; + /** @brief Get the bandwidth in bytes per second of current Link */ virtual double getBandwidth(); @@ -229,21 +228,22 @@ public: /** @brief Update the latency in seconds of current Link */ virtual void updateLatency(double value, double date=surf_get_clock())=0; - /** @brief The sharing policy is a @{link #e_surf_link_sharing_policy_t} (0: FATPIPE, 1: SHARED, 2: FULLDUPLEX) */ + /** @brief The sharing policy is a @{link e_surf_link_sharing_policy_t::EType} (0: FATPIPE, 1: SHARED, 2: FULLDUPLEX) */ virtual int sharingPolicy(); /** @brief Check if the Link is used */ - bool isUsed(); + bool isUsed() override; - void setState(e_surf_resource_state_t state); + void turnOn() override; + void turnOff() override; /* Using this object with the public part of model does not make sense */ double m_latCurrent = 0; - tmgr_trace_event_t p_latEvent = NULL; + tmgr_trace_iterator_t p_latEvent = NULL; /* LMM */ - tmgr_trace_event_t p_stateEvent = NULL; + tmgr_trace_iterator_t p_stateEvent = NULL; s_surf_metric_t p_speed; /* User data */ @@ -258,7 +258,7 @@ private: static boost::unordered_map *links; public: static Link *byName(const char* name); - static int linksAmount(); + static int linksCount(); static Link **linksList(); static void linksExit(); };