X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/544e6fac3fc91ae81d5daa4481562240c2cb2467..4b8be43e2c03939bc780b6112d841d8b839a79bb:/src/s4u/s4u_mailbox.cpp diff --git a/src/s4u/s4u_mailbox.cpp b/src/s4u/s4u_mailbox.cpp index cff1a5f452..ea2a10893e 100644 --- a/src/s4u/s4u_mailbox.cpp +++ b/src/s4u/s4u_mailbox.cpp @@ -8,7 +8,7 @@ #include "src/msg/msg_private.h" #include "src/simix/ActorImpl.hpp" #include "src/simix/smx_network_private.h" -#include "simgrid/s4u/mailbox.hpp" +#include "simgrid/s4u/Mailbox.hpp" XBT_LOG_EXTERNAL_CATEGORY(s4u); XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_channel,s4u,"S4U Communication Mailboxes"); @@ -16,7 +16,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_channel,s4u,"S4U Communication Mailboxes"); namespace simgrid { namespace s4u { -const char *Mailbox::getName() { +const char *Mailbox::name() { return pimpl_->name; } @@ -34,6 +34,11 @@ MailboxPtr Mailbox::byName(const char*name) return MailboxPtr(&mbox->piface_, true); } +MailboxPtr Mailbox::byName(std::string name) +{ + return byName(name.c_str()); +} + bool Mailbox::empty() { return pimpl_->comm_queue.empty(); @@ -57,15 +62,3 @@ ActorPtr Mailbox::receiver() { } } - -/*------- C functions -------*/ - -sg_mbox_t sg_mbox_by_name(const char*name){ - return simgrid::s4u::Mailbox::byName(name).get(); -} -int sg_mbox_is_empty(sg_mbox_t mbox) { - return mbox->empty(); -} -void sg_mbox_setReceiver(sg_mbox_t mbox, smx_process_t process) { - mbox->setReceiver(&process->getIface()); -}