From: Martin Quinson Date: Tue, 22 Dec 2015 21:28:49 +0000 (+0100) Subject: rename callback cpuActionStateChangedCallbacks into CpuAction::onStateChange X-Git-Tag: v3_13~1406 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/7eb416a6f56eb2184652a78def2dee572a41d8ca rename callback cpuActionStateChangedCallbacks into CpuAction::onStateChange --- diff --git a/src/surf/cpu_interface.cpp b/src/surf/cpu_interface.cpp index f9f6a12ea5..51b1d1edf4 100644 --- a/src/surf/cpu_interface.cpp +++ b/src/surf/cpu_interface.cpp @@ -330,10 +330,12 @@ void CpuAction::setAffinity(Cpu *cpu, unsigned long mask) XBT_OUT(); } +simgrid::surf::signal CpuAction::onStateChange; + void CpuAction::setState(e_surf_action_state_t state){ e_surf_action_state_t old = getState(); Action::setState(state); - cpuActionStateChangedCallbacks(this, old, state); + onStateChange(this, old, state); } } diff --git a/src/surf/cpu_interface.hpp b/src/surf/cpu_interface.hpp index ff5b3c1210..12a8e00d41 100644 --- a/src/surf/cpu_interface.hpp +++ b/src/surf/cpu_interface.hpp @@ -27,12 +27,6 @@ class CpuPlugin; *************/ XBT_PUBLIC(Cpu*) getActionCpu(CpuAction *action); -/** @ingroup SURF_callbacks - * @brief Callbacks handler which emit the callbacks after CpuAction State changed * - * @details Callback functions have the following signature: `void(CpuAction *action, e_surf_action_state_t old, e_surf_action_state_t current)` - */ -XBT_PUBLIC_DATA(simgrid::surf::signal) cpuActionStateChangedCallbacks; - XBT_PUBLIC(void) cpu_add_traces(); /********* @@ -182,6 +176,11 @@ public: XBT_PUBLIC_CLASS CpuAction : public simgrid::surf::Action { friend XBT_PUBLIC(Cpu*) getActionCpu(CpuAction *action); public: +/** @brief Callbacks handler which emit the callbacks after CpuAction State changed * + * @details Callback functions have the following signature: `void(CpuAction *action, e_surf_action_state_t old, e_surf_action_state_t current)` + */ + static simgrid::surf::signal onStateChange; + /** @brief CpuAction constructor */ CpuAction(simgrid::surf::Model *model, double cost, bool failed) : Action(model, cost, failed) {} //FIXME:REMOVE diff --git a/src/surf/plugins/energy.cpp b/src/surf/plugins/energy.cpp index d7bf6db890..d1c16eacc4 100644 --- a/src/surf/plugins/energy.cpp +++ b/src/surf/plugins/energy.cpp @@ -145,7 +145,7 @@ void sg_energy_plugin_init() { simgrid::surf::VMCreatedCallbacks.connect(energyVMCreatedCallback); simgrid::surf::Host::onCreation.connect(energyHostCreatedCallback); simgrid::surf::Host::onDestruction.connect(energyHostDestructedCallback); - simgrid::surf::cpuActionStateChangedCallbacks.connect( + simgrid::surf::CpuAction::onStateChange.connect( energyCpuActionStateChangedCallback); simgrid::surf::surfExitCallbacks.connect(sg_energy_plugin_exit); simgrid::surf::Host::onStateChange.connect(