-Resource::Resource(Model *model, const char *name)
- : Resource(model, name, SURF_RESOURCE_ON)
-{}
-
-Resource::Resource(Model *model, const char *name, lmm_constraint_t constraint)
- : Resource(model, name, constraint, SURF_RESOURCE_ON)
-{}
-
-Resource::Resource(
- Model *model, const char *name,
- lmm_constraint_t constraint, e_surf_resource_state_t stateInit)
- : p_name(xbt_strdup(name)), p_model(model)
- , m_running(true), m_stateCurrent(stateInit), p_constraint(constraint)
-{}
-
-Resource::Resource(Model *model, const char *name, e_surf_resource_state_t stateInit)
- : p_name(xbt_strdup(name)), p_model(model)
- , m_running(true), m_stateCurrent(stateInit)
-{}
-
-/** Cleanup code of the full object.
- *
- * The destructed callbacks might need to have a fully
- * created `Cpu` instance so they cannot be called `~Cpu()`
- * (at this point the fields of the parents have been destroyed
- * and the virtual methods are the ones of `Cpu`). If a `Cpu`
- * subclass overrides any virtual method, it should call this
- * method at the beginning of the destructor in order to trigger
- * the callbacks in the real state of the Cpu.
- *
- * Once the method has been called once, it becomes a noop ensuring
- * that the callbacks are not for each class of the hierarchy.
- *
- * A better solution would be to call a `Cpu::destroy()` method
- * before calling the destructor and trigger the callbacks here.
- */
-void Resource::die()
-{
- if (alive_) {
- onDie();
- alive_ = false;
- }
-}
-
-void Resource::onDie() {}