This is a simple wrapper class around S4U asynchronous communication checking methods. More...

#include <S4U_PendingCommunication.h>

Public Types

enum  OperationType { SENDING, RECEIVING }
 The communication operation's type.
 

Public Member Functions

 S4U_PendingCommunication (std::string mailbox_name, OperationType operation_type)
 Constructor. More...
 
std::unique_ptr< SimulationMessagewait ()
 Wait for the pending communication to complete. More...
 

Static Public Member Functions

static unsigned long waitForSomethingToHappen (std::vector< S4U_PendingCommunication * > pending_comms, double timeout)
 Wait for any pending communication completion. More...
 
static unsigned long waitForSomethingToHappen (std::vector< std::shared_ptr< S4U_PendingCommunication >> pending_comms, double timeout)
 Wait for any pending communication completion. More...
 

Public Attributes

simgrid::s4u::CommPtr comm_ptr
 The SimGrid communication handle.
 
std::string mailbox_name
 The mailbox name.
 
OperationType operation_type
 The operation type.
 
std::unique_ptr< SimulationMessagesimulation_message
 The message.
 

Detailed Description

This is a simple wrapper class around S4U asynchronous communication checking methods.

Constructor & Destructor Documentation

◆ S4U_PendingCommunication()

wrench::S4U_PendingCommunication::S4U_PendingCommunication ( std::string  mailbox_name,
OperationType  operation_type 
)
inline

Constructor.

Parameters
mailbox_namethe mailbox name
operation_typethe operation type

Member Function Documentation

◆ wait()

std::unique_ptr< SimulationMessage > wrench::S4U_PendingCommunication::wait ( )

Wait for the pending communication to complete.

Returns
A (unique pointer to a) simulation message
Exceptions
std::shared_ptr<NetworkError>

◆ waitForSomethingToHappen() [1/2]

unsigned long wrench::S4U_PendingCommunication::waitForSomethingToHappen ( std::vector< S4U_PendingCommunication * >  pending_comms,
double  timeout 
)
static

Wait for any pending communication completion.

Parameters
pending_commsa list of pending communications
timeouttimeout value in seconds (-1 means no timeout)
Returns
the index of the comm to which something happened (success or failure), or ULONG_MAX if nothing happened before the timeout expired
Exceptions
std::invalid_argument

◆ waitForSomethingToHappen() [2/2]

unsigned long wrench::S4U_PendingCommunication::waitForSomethingToHappen ( std::vector< std::shared_ptr< S4U_PendingCommunication >>  pending_comms,
double  timeout 
)
static

Wait for any pending communication completion.

Parameters
pending_commsa list of pending communications
timeouttimeout value in seconds (-1 means no timeout)
Returns
the index of the comm to which something happened (success or failure)
Exceptions
std::invalid_argument

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