simgrid::xbt::Extension<simgrid::Host, Cpu> Cpu::EXTENSION_ID;
-void Cpu::init()
+void Cpu::classInit()
{
if (!EXTENSION_ID.valid())
EXTENSION_ID = simgrid::Host::extension_create<simgrid::surf::Cpu>();
: Cpu(model, name, core, speedPeak, speedScale, SURF_RESOURCE_ON)
{}
-void Cpu::onDie()
-{
- Resource::onDie();
-}
-
Cpu::~Cpu()
{
- this->die();
if (p_constraintCoreId){
for (int i = 0; i < m_core; i++) {
xbt_free(p_constraintCoreId[i]);
void Cpu::plug(simgrid::Host* host)
{
if (this->m_host != nullptr)
- xbt_die("Already plugged into host %s", host->id().c_str());
+ xbt_die("Already plugged into host %s", host->getName().c_str());
host->extension_set(this);
this->m_host = host;
}
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);
}
}