SimGrid  3.11
Versatile Simulation of Distributed Systems
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Resource Class Referenceabstract

SURF resource interface class. More...

#include <surf_interface.hpp>

Inheritance diagram for Resource:
Cpu NetworkLink Storage Workstation WorkstationVM

Public Member Functions

 Resource ()
 Resource constructor.
 
 Resource (ModelPtr model, const char *name, xbt_dict_t props)
 Resource constructor. More...
 
 Resource (ModelPtr model, const char *name, xbt_dict_t props, lmm_constraint_t constraint)
 Resource constructor. More...
 
 Resource (ModelPtr model, const char *name, xbt_dict_t props, e_surf_resource_state_t stateInit)
 Resource constructor. More...
 
virtual ~Resource ()
 Resource destructor.
 
ModelPtr getModel ()
 Get the Model of the current Resource. More...
 
const char * getName ()
 Get the name of the current Resource. More...
 
virtual xbt_dict_t getProperties ()
 Get the properties of the current Resource. More...
 
virtual void updateState (tmgr_trace_event_t event_type, double value, double date)=0
 Update the state of the current Resource. More...
 
virtual bool isUsed ()=0
 Check if the current Resource is used. More...
 
bool isOn ()
 Check if the current Resource is active. More...
 
void turnOn ()
 Turn on the current Resource.
 
void turnOff ()
 Turn off the current Resource.
 
virtual e_surf_resource_state_t getState ()
 Get the state of the current Resource. More...
 
virtual void setState (e_surf_resource_state_t state)
 Set the state of the current Resource. More...
 
lmm_constraint_t getConstraint ()
 Get the lmm constraint associated to this Resource if it is part of a LMM component. More...
 

Detailed Description

SURF resource interface class.

A resource represent an element of a component (e.g.: a link for the network)

Constructor & Destructor Documentation

Resource::Resource ( ModelPtr  model,
const char *  name,
xbt_dict_t  props 
)

Resource constructor.

Parameters
modelModel associated to this Resource
nameThe name of the Resource
propsDictionary of properties associated to this Resource
Resource::Resource ( ModelPtr  model,
const char *  name,
xbt_dict_t  props,
lmm_constraint_t  constraint 
)

Resource constructor.

Parameters
modelModel associated to this Resource
nameThe name of the Resource
propsDictionary of properties associated to this Resource
constraintThe lmm constraint associated to this Resource if it is part of a LMM component
Resource::Resource ( ModelPtr  model,
const char *  name,
xbt_dict_t  props,
e_surf_resource_state_t  stateInit 
)

Resource constructor.

Parameters
modelModel associated to this Resource
nameThe name of the Resource
propsDictionary of properties associated to this Resource
stateInitthe initial state of the Resource

Member Function Documentation

ModelPtr Resource::getModel ( )

Get the Model of the current Resource.

Returns
The Model of the current Resource
const char * Resource::getName ( )

Get the name of the current Resource.

Returns
The name of the current Resource
xbt_dict_t Resource::getProperties ( )
virtual

Get the properties of the current Resource.

Returns
The properties of the current Resource

Reimplemented in Workstation.

virtual void Resource::updateState ( tmgr_trace_event_t  event_type,
double  value,
double  date 
)
pure virtual

Update the state of the current Resource.

[TODO]

Parameters
event_type[TODO]
value[TODO]
date[TODO]

Implemented in Storage.

virtual bool Resource::isUsed ( )
pure virtual

Check if the current Resource is used.

Returns
true if the current Resource is used, false otherwise

Implemented in NetworkLink, and Storage.

bool Resource::isOn ( )

Check if the current Resource is active.

Returns
true if the current Resource is active, false otherwise
e_surf_resource_state_t Resource::getState ( )
virtual

Get the state of the current Resource.

Returns
The state of the currenrt Resource
void Resource::setState ( e_surf_resource_state_t  state)
virtual

Set the state of the current Resource.

Parameters
stateThe new state of the current Resource

Reimplemented in NetworkLink, Cpu, Workstation, Storage, and WorkstationVM.

lmm_constraint_t Resource::getConstraint ( )

Get the lmm constraint associated to this Resource if it is part of a LMM component.

Returns
The lmm constraint associated to this Resource

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