SimGrid
3.21
Versatile Simulation of Distributed Systems
|
Activities.
This class is the ancestor of every activities that an actor can undertake. That is, activities are all the things that do take time to the actor in the simulated world.
They are somewhat linked but not identical to simgrid::kernel::resource::Action, that are stuff occurring on a resource:
#include <Activity.hpp>
Inherited by simgrid::s4u::Comm, simgrid::s4u::Exec, and simgrid::s4u::Io.
Public Types | |
enum | State { State::INITED = 0, State::STARTED, State::CANCELED, State::ERRORED, State::FINISHED } |
Public Member Functions | |
virtual Activity * | start ()=0 |
Starts a previously created activity. More... | |
virtual Activity * | wait ()=0 |
Tests whether the given activity is terminated yet. More... | |
virtual Activity * | wait_for (double timeout)=0 |
Blocks until the activity is terminated, or until the timeout is elapsed Raises: timeout exception. More... | |
void | wait_until (double time_limit) |
Blocks until the activity is terminated, or until the time limit is reached Raises: timeout exception. More... | |
virtual Activity * | cancel ()=0 |
Cancel that activity. More... | |
Activity::State | get_state () |
Retrieve the current state of the activity. More... | |
virtual bool | test ()=0 |
Returns whether this activity is completed. More... | |
virtual double | get_remaining () |
Get the remaining amount of work that this Activity entails. More... | |
Activity * | set_remaining (double remains) |
Set the [remaining] amount of work that this Activity will entail. More... | |
Activity * | set_user_data (void *data) |
Put some user data onto the Activity. More... | |
void * | get_user_data () |
Retrieve the user data of the Activity. More... | |
Protected Member Functions | |
Activity ()=default | |
virtual | ~Activity ()=default |
Friends | |
void | intrusive_ptr_release (Comm *c) |
void | intrusive_ptr_add_ref (Comm *c) |
void | intrusive_ptr_release (Exec *e) |
void | intrusive_ptr_add_ref (Exec *e) |
void | intrusive_ptr_release (Io *i) |
void | intrusive_ptr_add_ref (Io *i) |
|
strong |
|
protecteddefault |
|
protectedvirtualdefault |
|
pure virtual |
Starts a previously created activity.
This function is optional: you can call wait() even if you didn't call start()
Implemented in simgrid::s4u::Comm, simgrid::s4u::Io, and simgrid::s4u::Exec.
|
pure virtual |
Tests whether the given activity is terminated yet.
This is a pure function. Blocks until the activity is terminated
Implemented in simgrid::s4u::Comm, simgrid::s4u::Io, and simgrid::s4u::Exec.
|
pure virtual |
Blocks until the activity is terminated, or until the timeout is elapsed Raises: timeout exception.
Implemented in simgrid::s4u::Comm, simgrid::s4u::Io, and simgrid::s4u::Exec.
void simgrid::s4u::Activity::wait_until | ( | double | time_limit | ) |
Blocks until the activity is terminated, or until the time limit is reached Raises: timeout exception.
|
pure virtual |
Cancel that activity.
Implemented in simgrid::s4u::Comm, simgrid::s4u::Io, and simgrid::s4u::Exec.
|
inline |
Retrieve the current state of the activity.
|
pure virtual |
Returns whether this activity is completed.
Implemented in simgrid::s4u::Comm, simgrid::s4u::Io, and simgrid::s4u::Exec.
|
virtual |
Get the remaining amount of work that this Activity entails.
When it's 0, it's done.
Reimplemented in simgrid::s4u::Exec, and simgrid::s4u::Io.
Activity* simgrid::s4u::Activity::set_remaining | ( | double | remains | ) |
|
inline |
Put some user data onto the Activity.
|
inline |
Retrieve the user data of the Activity.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |