XBT_OUT();
}
+simgrid::surf::signal<void(simgrid::surf::CpuAction*, e_surf_action_state_t, e_surf_action_state_t)> 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);
}
}
*************/
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<void(CpuAction*, e_surf_action_state_t, e_surf_action_state_t)>) cpuActionStateChangedCallbacks;
-
XBT_PUBLIC(void) cpu_add_traces();
/*********
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<void(simgrid::surf::CpuAction*, e_surf_action_state_t, e_surf_action_state_t)> onStateChange;
+
/** @brief CpuAction constructor */
CpuAction(simgrid::surf::Model *model, double cost, bool failed)
: Action(model, cost, failed) {} //FIXME:REMOVE
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(