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

Detailed Description

I/O Activity, representing the asynchronous disk access.

They are generated from simgrid::s4u::Storage::read() and simgrid::s4u::Storage::write().

#include <Io.hpp>

Inherits simgrid::s4u::Activity.

Public Types

enum  OpType { OpType::READ, OpType::WRITE }
 
- Public Types inherited from simgrid::s4u::Activity
enum  State {
  State::INITED = 0, State::STARTED, State::CANCELED, State::ERRORED,
  State::FINISHED
}
 

Public Member Functions

 ~Io ()=default
 
Iostart () override
 Starts a previously created activity. More...
 
Iowait () override
 Tests whether the given activity is terminated yet. More...
 
Iowait_for (double timeout) override
 Blocks until the activity is terminated, or until the timeout is elapsed Raises: timeout exception. More...
 
Iocancel () override
 Cancel that activity. More...
 
bool test () override
 Returns whether this activity is completed. More...
 
double get_remaining () override
 Get the remaining amount of work that this Activity entails. More...
 
sg_size_t get_performed_ioops ()
 
- Public Member Functions inherited from simgrid::s4u::Activity
void wait_until (double time_limit)
 Blocks until the activity is terminated, or until the time limit is reached Raises: timeout exception. More...
 
Activity::State get_state ()
 Retrieve the current state of the activity. More...
 
Activityset_remaining (double remains)
 Set the [remaining] amount of work that this Activity will entail. More...
 
Activityset_user_data (void *data)
 Put some user data onto the Activity. More...
 
void * get_user_data ()
 Retrieve the user data of the Activity. More...
 

Friends

void intrusive_ptr_release (simgrid::s4u::Io *i)
 
void intrusive_ptr_add_ref (simgrid::s4u::Io *i)
 

Additional Inherited Members

- Protected Member Functions inherited from simgrid::s4u::Activity
 Activity ()=default
 
virtual ~Activity ()=default
 

Member Enumeration Documentation

◆ OpType

Enumerator
READ 
WRITE 

Constructor & Destructor Documentation

◆ ~Io()

simgrid::s4u::Io::~Io ( )
default

Member Function Documentation

◆ start()

Io* simgrid::s4u::Io::start ( )
overridevirtual

Starts a previously created activity.

This function is optional: you can call wait() even if you didn't call start()

Implements simgrid::s4u::Activity.

◆ wait()

Io* simgrid::s4u::Io::wait ( )
overridevirtual

Tests whether the given activity is terminated yet.

This is a pure function. Blocks until the activity is terminated

Implements simgrid::s4u::Activity.

◆ wait_for()

Io* simgrid::s4u::Io::wait_for ( double  timeout)
overridevirtual

Blocks until the activity is terminated, or until the timeout is elapsed Raises: timeout exception.

Implements simgrid::s4u::Activity.

◆ cancel()

Io* simgrid::s4u::Io::cancel ( )
overridevirtual

Cancel that activity.

Implements simgrid::s4u::Activity.

◆ test()

bool simgrid::s4u::Io::test ( )
overridevirtual

Returns whether this activity is completed.

Implements simgrid::s4u::Activity.

◆ get_remaining()

double simgrid::s4u::Io::get_remaining ( )
overridevirtual

Get the remaining amount of work that this Activity entails.

When it's 0, it's done.

Reimplemented from simgrid::s4u::Activity.

◆ get_performed_ioops()

sg_size_t simgrid::s4u::Io::get_performed_ioops ( )

Friends And Related Function Documentation

◆ intrusive_ptr_release

void intrusive_ptr_release ( simgrid::s4u::Io i)
friend

◆ intrusive_ptr_add_ref

void intrusive_ptr_add_ref ( simgrid::s4u::Io i)
friend

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