From: Martin Quinson Date: Sat, 16 Jan 2016 14:18:46 +0000 (+0100) Subject: simplify the prototype of CpuAction::onStateChange X-Git-Tag: v3_13~1222 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/10c02c776839657b86a6f1bdbb9817a8268bc397?hp=996ff4a9b3cad349b4dc4d787a439a4b274e3e36;ds=sidebyside simplify the prototype of CpuAction::onStateChange I'm not sure of how to export it to the user. --- diff --git a/src/surf/cpu_interface.cpp b/src/surf/cpu_interface.cpp index 4be4445e2f..5b31783685 100644 --- a/src/surf/cpu_interface.cpp +++ b/src/surf/cpu_interface.cpp @@ -345,12 +345,12 @@ void CpuAction::setAffinity(Cpu *cpu, unsigned long mask) XBT_OUT(); } -simgrid::xbt::signal CpuAction::onStateChange; +simgrid::xbt::signal CpuAction::onStateChange; void CpuAction::setState(e_surf_action_state_t state){ - e_surf_action_state_t old = getState(); + e_surf_action_state_t previous = getState(); Action::setState(state); - onStateChange(this, old, state); + onStateChange(this, previous); } } diff --git a/src/surf/cpu_interface.hpp b/src/surf/cpu_interface.hpp index 066670c7bd..4ba92de8bc 100644 --- a/src/surf/cpu_interface.hpp +++ b/src/surf/cpu_interface.hpp @@ -175,9 +175,9 @@ 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)` + * @details Callback functions have the following signature: `void(CpuAction *action, e_surf_action_state_t previous)` */ - static simgrid::xbt::signal onStateChange; + static simgrid::xbt::signal onStateChange; /** @brief CpuAction constructor */ CpuAction(simgrid::surf::Model *model, double cost, bool failed) diff --git a/src/surf/plugins/energy.cpp b/src/surf/plugins/energy.cpp index bbbb065afc..5823df6d5a 100644 --- a/src/surf/plugins/energy.cpp +++ b/src/surf/plugins/energy.cpp @@ -201,8 +201,7 @@ static void onCreation(simgrid::s4u::Host& host) { host.extension_set(new HostEnergy(&host)); } -static void onActionStateChange(simgrid::surf::CpuAction *action, - e_surf_action_state_t old, e_surf_action_state_t cur) { +static void onActionStateChange(simgrid::surf::CpuAction *action, e_surf_action_state_t previous) { const char *name = getActionCpu(action)->getName(); simgrid::surf::Host *host = sg_host_by_name(name)->extension(); simgrid::surf::VirtualMachine *vm = dynamic_cast(host);