wrench::S4U_Mailbox Class Reference

Wrappers around S4U's communication methods. More...

#include <S4U_Mailbox.h>

Static Public Member Functions

static void dputMessage (std::string mailbox_name, SimulationMessage *msg)
 Asynchronously send a message to a mailbox in a "fire and forget" fashion. More...
 
static std::string generateUniqueMailboxName (std::string)
 Generate a unique mailbox name given a prefix (this method simply appends an increasing sequence number to the prefix) More...
 
static unsigned long generateUniqueSequenceNumber ()
 Generate a unique sequence number. More...
 
static std::unique_ptr< SimulationMessagegetMessage (std::string mailbox)
 Synchronously receive a message from a mailbox. More...
 
static std::unique_ptr< SimulationMessagegetMessage (std::string mailbox, double timeout)
 Synchronously receive a message from a mailbox, with a timeout. More...
 
static std::shared_ptr< S4U_PendingCommunicationigetMessage (std::string mailbox_name)
 Asynchronously receive a message from a mailbox. More...
 
static std::shared_ptr< S4U_PendingCommunicationiputMessage (std::string mailbox_name, SimulationMessage *msg)
 Asynchronously send a message to a mailbox. More...
 
static void putMessage (std::string mailbox, SimulationMessage *m)
 Synchronously send a message to a mailbox. More...
 

Detailed Description

Wrappers around S4U's communication methods.

Member Function Documentation

◆ dputMessage()

void wrench::S4U_Mailbox::dputMessage ( std::string  mailbox_name,
SimulationMessage msg 
)
static

Asynchronously send a message to a mailbox in a "fire and forget" fashion.

Parameters
mailbox_namethe mailbox name
msgthe SimulationMessage

◆ generateUniqueMailboxName()

std::string wrench::S4U_Mailbox::generateUniqueMailboxName ( std::string  prefix)
static

Generate a unique mailbox name given a prefix (this method simply appends an increasing sequence number to the prefix)

Parameters
prefixa prefix for the mailbox name
Returns
a unique mailbox name as a string

◆ generateUniqueSequenceNumber()

unsigned long wrench::S4U_Mailbox::generateUniqueSequenceNumber ( )
static

Generate a unique sequence number.

Returns
a unique sequence number

◆ getMessage() [1/2]

std::unique_ptr< SimulationMessage > wrench::S4U_Mailbox::getMessage ( std::string  mailbox_name)
static

Synchronously receive a message from a mailbox.

Parameters
mailbox_namethe mailbox name
Returns
the message, or nullptr (in which case it's likely a brutal termination)
Exceptions
std::shared_ptr<NetworkError>

◆ getMessage() [2/2]

std::unique_ptr< SimulationMessage > wrench::S4U_Mailbox::getMessage ( std::string  mailbox_name,
double  timeout 
)
static

Synchronously receive a message from a mailbox, with a timeout.

Parameters
mailbox_namethe mailbox name
timeouta timeout value in seconds (<0 means never timeout)
Returns
the message, or nullptr (in which case it's likely a brutal termination)
Exceptions
std::shared_ptr<NetworkError>

◆ igetMessage()

std::shared_ptr< S4U_PendingCommunication > wrench::S4U_Mailbox::igetMessage ( std::string  mailbox_name)
static

Asynchronously receive a message from a mailbox.

Parameters
mailbox_namethe mailbox name
Returns
a pending communication handle
Exceptions
std::shared_ptr<NetworkError>

◆ iputMessage()

std::shared_ptr< S4U_PendingCommunication > wrench::S4U_Mailbox::iputMessage ( std::string  mailbox_name,
SimulationMessage msg 
)
static

Asynchronously send a message to a mailbox.

Parameters
mailbox_namethe mailbox name
msgthe SimulationMessage
Returns
a pending communication handle
Exceptions
std::shared_ptr<NetworkError>

◆ putMessage()

void wrench::S4U_Mailbox::putMessage ( std::string  mailbox_name,
SimulationMessage msg 
)
static

Synchronously send a message to a mailbox.

Parameters
mailbox_namethe mailbox name
msgthe SimulationMessage
Exceptions
std::shared_ptr<NetworkError>

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