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

SURF storage interface class. More...

#include <storage_interface.hpp>

Inheritance diagram for Storage:
Resource

Public Member Functions

 Storage (ModelPtr model, const char *name, xbt_dict_t props, const char *type_id, char *content_name, char *content_type, sg_size_t size)
 Storage constructor. More...
 
 Storage (ModelPtr model, const char *name, xbt_dict_t props, lmm_system_t maxminSystem, double bread, double bwrite, double bconnection, const char *type_id, char *content_name, char *content_type, sg_size_t size, char *attach)
 Storage constructor. More...
 
 ~Storage ()
 Storage destructor.
 
bool isUsed ()
 Check if the Storage is used. More...
 
void updateState (tmgr_trace_event_t event_type, double value, double date)
 Update the state of the current Storage. More...
 
void setState (e_surf_resource_state_t state)
 Set the state of the current Resource. More...
 
virtual StorageActionPtr open (const char *mount, const char *path)=0
 Open a file. More...
 
virtual StorageActionPtr close (surf_file_t fd)=0
 Close a file. More...
 
virtual StorageActionPtr read (surf_file_t fd, sg_size_t size)=0
 Read a file. More...
 
virtual StorageActionPtr 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...
 
- Public Member Functions inherited from Resource
 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...
 
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...
 
lmm_constraint_t getConstraint ()
 Get the lmm constraint associated to this Resource if it is part of a LMM component. More...
 

Detailed Description

SURF storage interface class.

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

Constructor & Destructor Documentation

Storage::Storage ( ModelPtr  model,
const char *  name,
xbt_dict_t  props,
const char *  type_id,
char *  content_name,
char *  content_type,
sg_size_t  size 
)

Storage constructor.

Parameters
modelStorageModel associated to this Storage
nameThe name of the Storage
propsDictionary of properties associated to this Storage
type_id[description]
content_name[description]
content_type[description]
size[description]
Storage::Storage ( ModelPtr  model,
const char *  name,
xbt_dict_t  props,
lmm_system_t  maxminSystem,
double  bread,
double  bwrite,
double  bconnection,
const char *  type_id,
char *  content_name,
char *  content_type,
sg_size_t  size,
char *  attach 
)

Storage constructor.

Parameters
modelStorageModel associated to this Storage
nameThe name of the Storage
propsDictionary 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]

Member Function Documentation

bool Storage::isUsed ( )
virtual

Check if the Storage is used.

Returns
true if the current Storage is used, false otherwise

Implements Resource.

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

Update the state of the current Storage.

Parameters
event_type[description]
value[description]
date[description]

Implements Resource.

void Storage::setState ( e_surf_resource_state_t  state)
virtual

Set the state of the current Resource.

Parameters
stateThe new state of the current Resource

Reimplemented from Resource.

virtual StorageActionPtr Storage::open ( const char *  mount,
const char *  path 
)
pure virtual

Open a file.

Parameters
mountThe mount point
pathThe path to the file
Returns
The StorageAction corresponding to the opening
virtual StorageActionPtr Storage::close ( surf_file_t  fd)
pure virtual

Close a file.

Parameters
fdThe file descriptor to close
Returns
The StorageAction corresponding to the closing
virtual StorageActionPtr Storage::read ( surf_file_t  fd,
sg_size_t  size 
)
pure virtual

Read a file.

Parameters
fdThe file descriptor to read
sizeThe size in bytes to read
Returns
The StorageAction corresponding to the reading
virtual StorageActionPtr Storage::write ( surf_file_t  fd,
sg_size_t  size 
)
pure virtual

Write a file.

Parameters
fdThe file descriptor to write
sizeThe size in bytes to write
Returns
The StorageAction corresponding to the writing
xbt_dict_t Storage::getContent ( )
virtual

Get the content of the current Storage.

Returns
A xbt_dict_t with path as keys and size in bytes as values
sg_size_t Storage::getSize ( )
virtual

Get the size in bytes of the current Storage.

Returns
The size in bytes of the current Storage
sg_size_t Storage::getFreeSize ( )
virtual

Get the available size in bytes of the current Storage.

Returns
The available size in bytes of the current Storage
sg_size_t Storage::getUsedSize ( )
virtual

Get the used size in bytes of the current Storage.

Returns
The used size in bytes of the current Storage

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