SimGrid  3.21
Versatile Simulation of Distributed Systems
simgrid::s4u::Storage Class Reference

Detailed Description

Storage represent the disk resources, usually associated to a given host.

By default, SimGrid does not keep track of the actual data being written but only computes the time taken by the corresponding data movement.

#include <Storage.hpp>

Inherits simgrid::xbt::Extendable< Storage >.

Public Member Functions

 Storage (std::string name, surf::StorageImpl *pimpl)
 
std::string const & get_name () const
 Retrieves the name of that storage as a C++ string. More...
 
const char * get_cname () const
 Retrieves the name of that storage as a C string. More...
 
const char * get_type ()
 
Hostget_host ()
 
void set_host (Host *host)
 
std::unordered_map< std::string, std::string > * get_properties ()
 
const char * get_property (std::string key)
 
void set_property (std::string, std::string value)
 
void set_data (void *data)
 
void * get_data ()
 
IoPtr io_init (sg_size_t size, s4u::Io::OpType type)
 
IoPtr read_async (sg_size_t size)
 
sg_size_t read (sg_size_t size)
 
IoPtr write_async (sg_size_t size)
 
sg_size_t write (sg_size_t size)
 
surf::StorageImpl * get_impl ()
 
StoragebyName (std::string name)
 
std::string const & getName () const
 
const char * getCname () const
 
const char * getType ()
 
HostgetHost ()
 
std::map< std::string, std::string > * getProperties ()
 
const char * getProperty (const char *key)
 
void setProperty (std::string key, std::string value)
 
void setUserdata (void *data)
 
void * getUserdata ()
 
- Public Member Functions inherited from simgrid::xbt::Extendable< Storage >
 Extendable ()
 
 ~Extendable ()
 
void * extension (std::size_t rank)
 
U * extension (Extension< Storage, U > rank)
 
U * extension ()
 
void extension_set (std::size_t rank, void *value, bool use_dtor=true)
 
void extension_set (Extension< Storage, U > rank, U *value, bool use_dtor=true)
 
void extension_set (U *p)
 

Static Public Member Functions

static Storageby_name (std::string name)
 Retrieve a Storage by its name. More...
 
static Storageby_name_or_null (std::string name)
 
- Static Public Member Functions inherited from simgrid::xbt::Extendable< Storage >
static size_t extension_create (void(*deleter)(void *))
 
static Extension< Storage, U > extension_create (void(*deleter)(void *))
 
static Extension< Storage, U > extension_create ()
 

Static Public Attributes

static simgrid::xbt::signal< void(s4u::Storage &)> on_creation
 Callback signal fired when a new Storage is created. More...
 
static simgrid::xbt::signal< void(s4u::Storage &)> on_destruction
 Callback signal fired when a Storage is destroyed. More...
 
static simgrid::xbt::signal< void(s4u::Storage &)> on_state_change
 Callback signal fired when a Storage's state changes. More...
 

Protected Member Functions

virtual ~Storage ()=default
 

Constructor & Destructor Documentation

◆ Storage()

simgrid::s4u::Storage::Storage ( std::string  name,
surf::StorageImpl *  pimpl 
)
explicit

◆ ~Storage()

virtual simgrid::s4u::Storage::~Storage ( )
protectedvirtualdefault

Member Function Documentation

◆ by_name()

static Storage* simgrid::s4u::Storage::by_name ( std::string  name)
static

Retrieve a Storage by its name.

It must exist in the platform file

◆ by_name_or_null()

static Storage* simgrid::s4u::Storage::by_name_or_null ( std::string  name)
static

◆ get_name()

std::string const& simgrid::s4u::Storage::get_name ( ) const
inline

Retrieves the name of that storage as a C++ string.

◆ get_cname()

const char* simgrid::s4u::Storage::get_cname ( ) const
inline

Retrieves the name of that storage as a C string.

◆ get_type()

const char* simgrid::s4u::Storage::get_type ( )

◆ get_host()

Host* simgrid::s4u::Storage::get_host ( )
inline

◆ set_host()

void simgrid::s4u::Storage::set_host ( Host host)
inline

◆ get_properties()

std::unordered_map<std::string, std::string>* simgrid::s4u::Storage::get_properties ( )

◆ get_property()

const char* simgrid::s4u::Storage::get_property ( std::string  key)

◆ set_property()

void simgrid::s4u::Storage::set_property ( std::string  ,
std::string  value 
)

◆ set_data()

void simgrid::s4u::Storage::set_data ( void *  data)
inline

◆ get_data()

void* simgrid::s4u::Storage::get_data ( )
inline

◆ io_init()

IoPtr simgrid::s4u::Storage::io_init ( sg_size_t  size,
s4u::Io::OpType  type 
)

◆ read_async()

IoPtr simgrid::s4u::Storage::read_async ( sg_size_t  size)

◆ read()

sg_size_t simgrid::s4u::Storage::read ( sg_size_t  size)

◆ write_async()

IoPtr simgrid::s4u::Storage::write_async ( sg_size_t  size)

◆ write()

sg_size_t simgrid::s4u::Storage::write ( sg_size_t  size)

◆ get_impl()

surf::StorageImpl* simgrid::s4u::Storage::get_impl ( )
inline

◆ byName()

Storage* simgrid::s4u::Storage::byName ( std::string  name)
inline

◆ getName()

std::string const& simgrid::s4u::Storage::getName ( ) const
inline

◆ getCname()

const char* simgrid::s4u::Storage::getCname ( ) const
inline

◆ getType()

const char* simgrid::s4u::Storage::getType ( )
inline

◆ getHost()

Host* simgrid::s4u::Storage::getHost ( )
inline

◆ getProperties()

std::map<std::string, std::string>* simgrid::s4u::Storage::getProperties ( )
inline

◆ getProperty()

const char* simgrid::s4u::Storage::getProperty ( const char *  key)
inline

◆ setProperty()

void simgrid::s4u::Storage::setProperty ( std::string  key,
std::string  value 
)
inline

◆ setUserdata()

void simgrid::s4u::Storage::setUserdata ( void *  data)
inline

◆ getUserdata()

void* simgrid::s4u::Storage::getUserdata ( )
inline

Member Data Documentation

◆ on_creation

simgrid::xbt::signal<void(s4u::Storage&)> simgrid::s4u::Storage::on_creation
static

Callback signal fired when a new Storage is created.

◆ on_destruction

simgrid::xbt::signal<void(s4u::Storage&)> simgrid::s4u::Storage::on_destruction
static

Callback signal fired when a Storage is destroyed.

◆ on_state_change

simgrid::xbt::signal<void(s4u::Storage&)> simgrid::s4u::Storage::on_state_change
static

Callback signal fired when a Storage's state changes.


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