SimGrid  3.13
Versatile Simulation of Distributed Systems
simgrid::surf::Resource Class Referenceabstract

SURF resource interface class. More...

#include <surf_interface.hpp>

Inheritance diagram for simgrid::surf::Resource:
simgrid::surf::Cpu simgrid::surf::HostImpl simgrid::surf::Link simgrid::surf::Storage simgrid::surf::CpuCas01 simgrid::surf::CpuL07 simgrid::surf::CpuTi simgrid::surf::VirtualMachine simgrid::surf::LinkL07 simgrid::surf::LinkNS3 simgrid::surf::NetworkCm02Link simgrid::surf::StorageN11

Public Member Functions

 Resource (Model *model, const char *name)
 Constructor of non-LMM Resources. More...
 
 Resource (Model *model, const char *name, lmm_constraint_t constraint)
 Constructor of LMM Resources. More...
 
virtual ~Resource ()
 
ModelgetModel () 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

lmm_constraint_t constraint_ = nullptr
 

Detailed Description

SURF resource interface class.

This is the ancestor class of every resources in SimGrid, such as links, CPU or storage

Constructor & Destructor Documentation

simgrid::surf::Resource::Resource ( Model model,
const char *  name 
)

Constructor of non-LMM Resources.

Parameters
modelModel associated to this Resource
nameThe name of the Resource
simgrid::surf::Resource::Resource ( Model model,
const char *  name,
lmm_constraint_t  constraint 
)

Constructor of LMM Resources.

Parameters
modelModel associated to this Resource
nameThe name of the Resource
constraintThe lmm constraint associated to this Resource if it is part of a LMM component
simgrid::surf::Resource::~Resource ( )
virtual

Member Function Documentation

Model * simgrid::surf::Resource::getModel ( ) const

Get the Model of the current Resource.

const char * simgrid::surf::Resource::getName ( ) const

Get the name of the current Resource.

bool simgrid::surf::Resource::operator== ( const Resource other) const
virtual void simgrid::surf::Resource::apply_event ( tmgr_trace_iterator_t  event,
double  value 
)
pure virtual

Apply an event of external load event to that resource.

Parameters
eventWhat happened
value[TODO]

Implemented in simgrid::surf::HostImpl, simgrid::surf::Storage, simgrid::surf::CpuTi, simgrid::surf::LinkL07, simgrid::surf::CpuL07, simgrid::surf::NetworkCm02Link, simgrid::surf::CpuCas01, and simgrid::surf::LinkNS3.

virtual bool simgrid::surf::Resource::isUsed ( )
pure virtual
bool simgrid::surf::Resource::isOn ( ) const
virtual

Check if the current Resource is active.

Reimplemented in simgrid::surf::HostImpl.

bool simgrid::surf::Resource::isOff ( ) const
virtual

Check if the current Resource is shut down.

Reimplemented in simgrid::surf::HostImpl.

void simgrid::surf::Resource::turnOn ( )
virtual
void simgrid::surf::Resource::turnOff ( )
virtual
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)

Member Data Documentation

lmm_constraint_t simgrid::surf::Resource::constraint_ = nullptr
protected

The documentation for this class was generated from the following files: