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

Detailed Description

SURF resource interface class.

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

#include <surf_interface.hpp>

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

Public Member Functions

 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

const lmm_constraint_t constraint_ = nullptr
 

Constructor & Destructor Documentation

◆ 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

◆ ~Resource()

simgrid::surf::Resource::~Resource ( )
virtualdefault

Member Function Documentation

◆ getModel()

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

Get the Model of the current Resource.

◆ getName()

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

Get the name of the current Resource.

◆ operator==()

bool simgrid::surf::Resource::operator== ( const Resource other) const

◆ apply_event()

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::CpuTi, simgrid::surf::Storage, simgrid::surf::LinkL07, simgrid::surf::CpuL07, simgrid::surf::NetworkCm02Link, simgrid::surf::CpuCas01, and simgrid::surf::LinkNS3.

◆ isUsed()

virtual bool simgrid::surf::Resource::isUsed ( )
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.

◆ isOn()

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

Check if the current Resource is active.

◆ isOff()

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

Check if the current Resource is shut down.

◆ turnOn()

void simgrid::surf::Resource::turnOn ( )
virtual

Turn on the current Resource.

Reimplemented in simgrid::surf::Link, and simgrid::surf::Storage.

◆ turnOff()

void simgrid::surf::Resource::turnOff ( )
virtual

Turn off the current Resource.

Reimplemented in simgrid::surf::Link, and simgrid::surf::Storage.

◆ getConstraint()

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

◆ constraint_

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

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