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);
38 static void putMessage(simgrid::s4u::Mailbox *mailbox, SimulationMessage *m);
39 static void dputMessage(simgrid::s4u::Mailbox *mailbox, SimulationMessage *msg);
40 static std::shared_ptr<S4U_PendingCommunication> iputMessage(simgrid::s4u::Mailbox *mailbox, SimulationMessage *msg);
41 static std::shared_ptr<S4U_PendingCommunication> igetMessage(simgrid::s4u::Mailbox *mailbox);
43 static unsigned long generateUniqueSequenceNumber();
45 static simgrid::s4u::Mailbox *getTemporaryMailbox();
46 static void retireTemporaryMailbox(simgrid::s4u::Mailbox *mailbox);
48 static void createMailboxPool(
unsigned long num_mailboxes);
50 static simgrid::s4u::Mailbox *generateUniqueMailbox(std::string prefix);
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