action->getVariable(), 0)));
}
-simgrid::surf::signal<void(Cpu*)> cpuCreatedCallbacks;
-simgrid::surf::signal<void(Cpu*)> cpuDestructedCallbacks;
-simgrid::surf::signal<void(Cpu*, e_surf_resource_state_t, e_surf_resource_state_t)> cpuStateChangedCallbacks;
simgrid::surf::signal<void(CpuAction*, e_surf_action_state_t, e_surf_action_state_t)> cpuActionStateChangedCallbacks;
+
void cpu_add_traces(){
surf_cpu_model_pm->addTraces();
}
void Cpu::onDie()
{
- cpuDestructedCallbacks(this);
Resource::onDie();
}
return m_core;
}
-void Cpu::setState(e_surf_resource_state_t state)
-{
- e_surf_resource_state_t old = Resource::getState();
- Resource::setState(state);
- cpuStateChangedCallbacks(this, old, state);
-}
-
void Cpu::plug(simgrid::Host* host)
{
if (this->m_host != nullptr)
xbt_die("Already plugged into host %s", host->id().c_str());
host->extension_set(this);
this->m_host = host;
- simgrid::surf::cpuCreatedCallbacks(this);
- simgrid::surf::cpuStateChangedCallbacks(this,
- SURF_RESOURCE_ON, this->getState());
}
/**********
*************/
XBT_PUBLIC(Cpu*) getActionCpu(CpuAction *action);
-/** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after Cpu creation *
- * @details Callback functions have the following signature: `void(CpuPtr)`
- */
-XBT_PUBLIC_DATA(simgrid::surf::signal<void(Cpu*)>) cpuCreatedCallbacks;
-
-/** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after Cpu destruction *
- * @details Callback functions have the following signature: `void(CpuPtr)`
- */
-XBT_PUBLIC_DATA(simgrid::surf::signal<void(Cpu*)>) cpuDestructedCallbacks;
-
-/** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after Cpu State changed *
- * @details Callback functions have the following signature: `void(CpuAction *action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
- */
-XBT_PUBLIC_DATA(simgrid::surf::signal<void(Cpu*, e_surf_resource_state_t, e_surf_resource_state_t)>) cpuStateChangedCallbacks;
-
/** @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)`
virtual void setPstate(int pstate_index)=0;
virtual int getPstate()=0;
- void setState(e_surf_resource_state_t state);
void plug(simgrid::Host* host);
void addTraces(void);