SimGrid
3.13
Versatile Simulation of Distributed Systems
|
SURF storage interface class. More...
#include <storage_interface.hpp>
Public Member Functions | |
Storage (Model *model, const char *name, xbt_dict_t props, const char *type_id, const char *content_name, const char *content_type, sg_size_t size) | |
Storage constructor. More... | |
Storage (Model *model, const char *name, xbt_dict_t props, lmm_system_t maxminSystem, double bread, double bwrite, double bconnection, const char *type_id, const char *content_name, const char *content_type, sg_size_t size, const char *attach) | |
Storage constructor. More... | |
~Storage () | |
bool | isUsed () override |
Check if the Storage is used (if an action currently uses its resources) More... | |
void | apply_event (tmgr_trace_iterator_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 StorageAction * | open (const char *mount, const char *path)=0 |
Open a file. More... | |
virtual StorageAction * | close (surf_file_t fd)=0 |
Close a file. More... | |
virtual StorageAction * | read (surf_file_t fd, sg_size_t size)=0 |
Read a file. More... | |
virtual StorageAction * | write (surf_file_t fd, sg_size_t size)=0 |
Write a file. More... | |
virtual xbt_dict_t | getContent () |
Get the content of the current Storage. More... | |
virtual sg_size_t | getSize () |
Get the size in bytes of the current Storage. More... | |
virtual sg_size_t | getFreeSize () |
Get the available size in bytes of the current Storage. More... | |
virtual sg_size_t | getUsedSize () |
Get the used size in bytes of the current Storage. More... | |
xbt_dict_t | parseContent (const char *filename) |
![]() | |
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 () |
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 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 | getConstraint () const |
Get the lmm constraint associated to this Resource if it is part of a LMM component (or null if none) More... | |
![]() | |
PropertyHolder (xbt_dict_t props) | |
~PropertyHolder () | |
const char * | getProperty (const char *id) |
Return the property associated to the provided key (or NULL if not existing) More... | |
void | setProperty (const char *id, const char *value) |
Change the value of a given key in the property set. More... | |
xbt_dict_t | getProperties () |
Return the whole set of properties. More... | |
Public Attributes | |
xbt_dict_t | p_content |
char * | p_contentType |
sg_size_t | m_size |
sg_size_t | m_usedSize |
char * | p_typeId |
char * | p_attach |
xbt_dynar_t | p_writeActions |
lmm_constraint_t | p_constraintWrite |
lmm_constraint_t | p_constraintRead |
Additional Inherited Members | |
![]() | |
lmm_constraint_t | constraint_ = nullptr |
SURF storage interface class.
A Storage represent a storage unit (e.g.: hard drive, usb key)
simgrid::surf::Storage::Storage | ( | Model * | model, |
const char * | name, | ||
xbt_dict_t | props, | ||
const char * | type_id, | ||
const char * | content_name, | ||
const char * | content_type, | ||
sg_size_t | size | ||
) |
Storage constructor.
model | StorageModel associated to this Storage |
name | The name of the Storage |
props | Dictionary of properties associated to this Storage |
type_id | [description] |
content_name | [description] |
content_type | [description] |
size | [description] |
simgrid::surf::Storage::Storage | ( | Model * | model, |
const char * | name, | ||
xbt_dict_t | props, | ||
lmm_system_t | maxminSystem, | ||
double | bread, | ||
double | bwrite, | ||
double | bconnection, | ||
const char * | type_id, | ||
const char * | content_name, | ||
const char * | content_type, | ||
sg_size_t | size, | ||
const char * | attach | ||
) |
Storage constructor.
model | StorageModel associated to this Storage |
name | The name of the Storage |
props | Dictionary of properties associated to this Storage |
maxminSystem | [description] |
bread | [description] |
bwrite | [description] |
bconnection | [description] |
type_id | [description] |
content_name | [description] |
content_type | [description] |
size | [description] |
attach | [description] |
simgrid::s4u::Storage::~Storage | ( | ) |
|
overridevirtual |
Check if the Storage is used (if an action currently uses its resources)
Implements simgrid::surf::Resource.
|
overridevirtual |
Apply an event of external load event to that resource.
event | What happened |
value | [TODO] |
Implements simgrid::surf::Resource.
|
overridevirtual |
Turn on the current Resource.
Reimplemented from simgrid::surf::Resource.
|
overridevirtual |
Turn off the current Resource.
Reimplemented from simgrid::surf::Resource.
|
pure virtual |
Open a file.
mount | The mount point |
path | The path to the file |
Implemented in simgrid::surf::StorageN11.
|
pure virtual |
Close a file.
fd | The file descriptor to close |
Implemented in simgrid::surf::StorageN11.
|
pure virtual |
Read a file.
fd | The file descriptor to read |
size | The size in bytes to read |
Implemented in simgrid::surf::StorageN11.
|
pure virtual |
Write a file.
fd | The file descriptor to write |
size | The size in bytes to write |
Implemented in simgrid::surf::StorageN11.
|
virtual |
Get the content of the current Storage.
|
virtual |
|
virtual |
|
virtual |
xbt_dict_t simgrid::surf::Storage::parseContent | ( | const char * | filename | ) |
xbt_dict_t simgrid::surf::Storage::p_content |
char* simgrid::surf::Storage::p_contentType |
sg_size_t simgrid::surf::Storage::m_size |
sg_size_t simgrid::surf::Storage::m_usedSize |
char* simgrid::surf::Storage::p_typeId |
char* simgrid::surf::Storage::p_attach |
xbt_dynar_t simgrid::surf::Storage::p_writeActions |
lmm_constraint_t simgrid::surf::Storage::p_constraintWrite |
lmm_constraint_t simgrid::surf::Storage::p_constraintRead |