SimGrid  3.14.159
Versatile Simulation of Distributed Systems
simgrid::s4u::Activity Class Referenceabstract

Detailed Description

Activities.

This class is the ancestor of every activities that an actor can undertake, that is, of the actions that do take time in the simulated world.

#include <Activity.hpp>

Inheritance diagram for simgrid::s4u::Activity:
simgrid::s4u::Comm

Public Member Functions

 Activity (Activity const &)=delete
 
Activityoperator= (Activity const &)=delete
 
virtual void start ()=0
 Starts a previously created activity. More...
 
virtual void wait ()=0
 Tests whether the given activity is terminated yet. More...
 
virtual void wait (double timeout)=0
 Blocks until the activity is terminated, or until the timeout is elapsed Raises: timeout exception. More...
 
e_s4u_activity_state_t getState ()
 Cancel that activity. More...
 
double getRemains ()
 Get the remaining amount of work that this Activity entails. More...
 
void setRemains (double remains)
 Set the [remaining] amount of work that this Activity will entail. More...
 
void setUserData (void *data)
 Put some user data onto the Activity. More...
 
voidgetUserData ()
 Retrieve the user data of the Activity. More...
 

Protected Member Functions

 Activity ()
 
virtual ~Activity ()
 

Constructor & Destructor Documentation

◆ Activity() [1/2]

simgrid::s4u::Activity::Activity ( )
protected

◆ ~Activity()

simgrid::s4u::Activity::~Activity ( )
protectedvirtual

◆ Activity() [2/2]

simgrid::s4u::Activity::Activity ( Activity const &  )
delete

Member Function Documentation

◆ operator=()

Activity& simgrid::s4u::Activity::operator= ( Activity const &  )
delete

◆ start()

virtual void simgrid::s4u::Activity::start ( )
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.

◆ wait() [1/2]

virtual void simgrid::s4u::Activity::wait ( )
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.

◆ wait() [2/2]

virtual void simgrid::s4u::Activity::wait ( double  timeout)
pure virtual

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

Implemented in simgrid::s4u::Comm.

◆ getState()

e_s4u_activity_state_t simgrid::s4u::Activity::getState ( )
inline

Cancel that activity.

Retrieve the current state of the activity

◆ getRemains()

double simgrid::s4u::Activity::getRemains ( )

Get the remaining amount of work that this Activity entails.

When it's 0, it's done.

◆ setRemains()

void simgrid::s4u::Activity::setRemains ( double  remains)

Set the [remaining] amount of work that this Activity will entail.

It is forbidden to change the amount of work once the Activity is started

◆ setUserData()

void simgrid::s4u::Activity::setUserData ( void data)
inline

Put some user data onto the Activity.

◆ getUserData()

void* simgrid::s4u::Activity::getUserData ( )
inline

Retrieve the user data of the Activity.


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