11 #ifndef WRENCH_S4U_MAILBOX_H
12 #define WRENCH_S4U_MAILBOX_H
19 #include <simgrid/s4u.hpp>
27 class SimulationMessage;
28 class S4U_PendingCommunication;
36 static std::unique_ptr<SimulationMessage>
getMessage(simgrid::s4u::Mailbox *mailbox);
37 static std::unique_ptr<SimulationMessage>
getMessage(simgrid::s4u::Mailbox *mailbox,
double timeout);
41 static std::shared_ptr<S4U_PendingCommunication>
igetMessage(simgrid::s4u::Mailbox *mailbox);
52 static unsigned long mailbox_pool_size;
55 static std::deque<simgrid::s4u::Mailbox *> free_mailboxes;
56 static std::set<simgrid::s4u::Mailbox *> used_mailboxes;
57 static std::deque<simgrid::s4u::Mailbox *> mailboxes_to_drain;
69 #endif //WRENCH_S4U_MAILBOX_H
static std::shared_ptr< S4U_PendingCommunication > iputMessage(simgrid::s4u::Mailbox *mailbox, SimulationMessage *msg)
Asynchronously send a message to a mailbox.
Definition: S4U_Mailbox.cpp:182
Wrappers around S4U's communication methods.
Definition: S4U_Mailbox.h:33
Top-level class to describe a message communicated by processes in the simulation.
Definition: SimulationMessage.h:28
Definition: Action.cpp:28
static unsigned long generateUniqueSequenceNumber()
Generate a unique sequence number.
Definition: S4U_Mailbox.cpp:244
static void putMessage(simgrid::s4u::Mailbox *mailbox, SimulationMessage *m)
Synchronously send a message to a mailbox.
Definition: S4U_Mailbox.cpp:120
static simgrid::s4u::Mailbox * getTemporaryMailbox()
Get a temporary mailbox.
Definition: S4U_Mailbox.cpp:255
static void retireTemporaryMailbox(simgrid::s4u::Mailbox *mailbox)
Retire a temporary mailbox.
Definition: S4U_Mailbox.cpp:295
static std::shared_ptr< S4U_PendingCommunication > igetMessage(simgrid::s4u::Mailbox *mailbox)
Asynchronously receive a message from a mailbox.
Definition: S4U_Mailbox.cpp:217
static void dputMessage(simgrid::s4u::Mailbox *mailbox, SimulationMessage *msg)
Asynchronously send a message to a mailbox in a "fire and forget" fashion.
Definition: S4U_Mailbox.cpp:147
static void createMailboxPool(unsigned long num_mailboxes)
Create the pool of mailboxes to use.
Definition: S4U_Mailbox.cpp:310
static std::unique_ptr< SimulationMessage > getMessage(simgrid::s4u::Mailbox *mailbox)
Synchronously receive a message from a mailbox.
Definition: S4U_Mailbox.cpp:48
static simgrid::s4u::Mailbox * generateUniqueMailbox(std::string prefix)
Generate a unique (non-temporary) mailbox.
Definition: S4U_Mailbox.cpp:321