SimGrid  3.18
Versatile Simulation of Distributed Systems
simgrid::surf::StorageImpl Class Referenceabstract

Detailed Description

SURF storage interface class.

A Storage represent a storage unit (e.g.: hard drive, usb key)

#include <StorageImpl.hpp>

Inheritance diagram for simgrid::surf::StorageImpl:
simgrid::surf::Resource simgrid::surf::PropertyHolder simgrid::surf::StorageN11

Public Member Functions

 StorageImpl (Model *model, std::string name, lmm_system_t maxminSystem, double bread, double bwrite, std::string type_id, std::string content_name, sg_size_t size, std::string attach)
 Storage constructor. More...
 
 ~StorageImpl () override
 
bool isUsed () override
 Check if the Storage is used (if an action currently uses its resources) More...
 
void apply_event (tmgr_trace_event_t event, double value) override
 Apply an event of external load event to that resource. More...
 
void turnOn () override
 Turn on the current Resource. More...
 
void turnOff () override
 Turn off the current Resource. More...
 
virtual StorageActionread (sg_size_t size)=0
 Read a file. More...
 
virtual StorageActionwrite (sg_size_t size)=0
 Write a file. More...
 
virtual std::string getHost ()
 
- Public Member Functions inherited from simgrid::surf::Resource
 Resource (Model *model, const std::string &name, lmm_constraint_t constraint)
 Constructor of LMM Resources. More...
 
virtual ~Resource ()
 
Modelmodel () const
 Get the Model of the current Resource. More...
 
const std::stringgetName () const
 Get the name of the current Resource. More...
 
const char * getCname () const
 Get the name of the current Resource. More...
 
bool operator== (const Resource &other) const
 
virtual double getLoad ()
 returns the current load (in flops per second, byte per second or similar) 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...
 
lmm_constraint_t constraint () const
 Get the lmm constraint associated to this Resource if it is part of a LMM component (or null if none) More...
 
- Public Member Functions inherited from simgrid::surf::PropertyHolder
 PropertyHolder ()=default
 
 ~PropertyHolder ()
 
const char * getProperty (std::string key)
 Return the property associated to the provided key (or nullptr if not existing) More...
 
void setProperty (std::string id, std::string value)
 Change the value of a given key in the property set. More...
 
std::map< std::string, std::string > * getProperties ()
 Return the whole set of properties. More...
 

Static Public Member Functions

static StorageImplbyName (std::string name)
 
static std::unordered_map< std::string, StorageImpl * > * storagesMap ()
 

Public Attributes

s4u::Storage piface_
 Public interface. More...
 
lmm_constraint_t constraintWrite_
 
lmm_constraint_t constraintRead_
 
std::string typeId_
 
std::string content_name
 
sg_size_t size_
 

Additional Inherited Members

- Protected Attributes inherited from simgrid::surf::Resource
const lmm_constraint_t constraint_ = nullptr
 

Constructor & Destructor Documentation

◆ StorageImpl()

simgrid::surf::StorageImpl::StorageImpl ( Model model,
std::string  name,
lmm_system_t  maxminSystem,
double  bread,
double  bwrite,
std::string  type_id,
std::string  content_name,
sg_size_t  size,
std::string  attach 
)

Storage constructor.

◆ ~StorageImpl()

simgrid::surf::StorageImpl::~StorageImpl ( )
override

Member Function Documentation

◆ byName()

StorageImpl * simgrid::surf::StorageImpl::byName ( std::string  name)
static

◆ isUsed()

bool simgrid::surf::StorageImpl::isUsed ( )
overridevirtual

Check if the Storage is used (if an action currently uses its resources)

Implements simgrid::surf::Resource.

◆ apply_event()

void simgrid::surf::StorageImpl::apply_event ( tmgr_trace_event_t  event,
double  value 
)
overridevirtual

Apply an event of external load event to that resource.

Parameters
eventWhat happened
value[TODO]

Implements simgrid::surf::Resource.

◆ turnOn()

void simgrid::surf::StorageImpl::turnOn ( )
overridevirtual

Turn on the current Resource.

Reimplemented from simgrid::surf::Resource.

◆ turnOff()

void simgrid::surf::StorageImpl::turnOff ( )
overridevirtual

Turn off the current Resource.

Reimplemented from simgrid::surf::Resource.

◆ read()

virtual StorageAction* simgrid::surf::StorageImpl::read ( sg_size_t  size)
pure virtual

Read a file.

Parameters
sizeThe size in bytes to read
Returns
The StorageAction corresponding to the reading

Implemented in simgrid::surf::StorageN11.

◆ write()

virtual StorageAction* simgrid::surf::StorageImpl::write ( sg_size_t  size)
pure virtual

Write a file.

Parameters
sizeThe size in bytes to write
Returns
The StorageAction corresponding to the writing

Implemented in simgrid::surf::StorageN11.

◆ getHost()

virtual std::string simgrid::surf::StorageImpl::getHost ( )
inlinevirtual

◆ storagesMap()

static std::unordered_map<std::string, StorageImpl*>* simgrid::surf::StorageImpl::storagesMap ( )
inlinestatic

Member Data Documentation

◆ piface_

s4u::Storage simgrid::surf::StorageImpl::piface_

Public interface.

◆ constraintWrite_

lmm_constraint_t simgrid::surf::StorageImpl::constraintWrite_

◆ constraintRead_

lmm_constraint_t simgrid::surf::StorageImpl::constraintRead_

◆ typeId_

std::string simgrid::surf::StorageImpl::typeId_

◆ content_name

std::string simgrid::surf::StorageImpl::content_name

◆ size_

sg_size_t simgrid::surf::StorageImpl::size_

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