|
SimGrid
3.14.159
Versatile Simulation of Distributed Systems
|
SURF resource interface class.
This is the ancestor class of every resources in SimGrid, such as links, CPU or storage
#include <surf_interface.hpp>
Public Member Functions | |
| Resource (Model *model, const char *name, lmm_constraint_t constraint) | |
| Constructor of LMM Resources. More... | |
| virtual | ~Resource () |
| Model * | getModel () const |
| Get the Model of the current Resource. More... | |
| const char * | getName () const |
| Get the name of the current Resource. More... | |
| bool | operator== (const Resource &other) const |
| virtual void | apply_event (tmgr_trace_iterator_t event, double value)=0 |
| Apply an event of external load event to that resource. More... | |
| virtual bool | isUsed ()=0 |
| Check if the current Resource is used (if it currently serves an action) More... | |
| virtual bool | isOn () const |
| Check if the current Resource is active. More... | |
| virtual bool | isOff () const |
| Check if the current Resource is shut down. More... | |
| virtual void | turnOn () |
| Turn on the current Resource. More... | |
| virtual void | turnOff () |
| Turn off the current Resource. More... | |
| lmm_constraint_t | getConstraint () const |
| Get the lmm constraint associated to this Resource if it is part of a LMM component (or null if none) More... | |
Protected Attributes | |
| const lmm_constraint_t | constraint_ = nullptr |
| simgrid::surf::Resource::Resource | ( | Model * | model, |
| const char * | name, | ||
| lmm_constraint_t | constraint | ||
| ) |
|
virtualdefault |
| const char * simgrid::surf::Resource::getName | ( | ) | const |
Get the name of the current Resource.
| bool simgrid::surf::Resource::operator== | ( | const Resource & | other | ) | const |
|
pure virtual |
Apply an event of external load event to that resource.
| event | What happened |
| value | [TODO] |
Implemented in simgrid::surf::CpuTi, simgrid::surf::Storage, simgrid::surf::LinkL07, simgrid::surf::CpuL07, simgrid::surf::NetworkCm02Link, simgrid::surf::CpuCas01, and simgrid::surf::LinkNS3.
|
pure virtual |
Check if the current Resource is used (if it currently serves an action)
Implemented in simgrid::surf::Link, simgrid::surf::CpuTi, simgrid::surf::Storage, simgrid::surf::LinkL07, simgrid::surf::CpuL07, and simgrid::surf::CpuCas01.
|
virtual |
Check if the current Resource is active.
|
virtual |
Check if the current Resource is shut down.
|
virtual |
Turn on the current Resource.
Reimplemented in simgrid::surf::Link, and simgrid::surf::Storage.
|
virtual |
Turn off the current Resource.
Reimplemented in simgrid::surf::Link, and simgrid::surf::Storage.
| lmm_constraint_t simgrid::surf::Resource::getConstraint | ( | ) | const |
Get the lmm constraint associated to this Resource if it is part of a LMM component (or null if none)
|
protected |