From cabfcca7cb25b7aa54d7ee1b0a8b117940b85a8d Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Tue, 26 Jul 2016 11:42:13 +0200 Subject: [PATCH 1/1] rename the S4U method retrieving the internal impl to getImpl --- include/simgrid/s4u/actor.hpp | 5 +++-- include/simgrid/s4u/mailbox.hpp | 2 +- src/s4u/s4u_actor.cpp | 2 +- src/s4u/s4u_comm.cpp | 12 ++++++------ src/s4u/s4u_mailbox.cpp | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/include/simgrid/s4u/actor.hpp b/include/simgrid/s4u/actor.hpp index f5de6051c9..28dbdc4031 100644 --- a/include/simgrid/s4u/actor.hpp +++ b/include/simgrid/s4u/actor.hpp @@ -247,8 +247,9 @@ public: /** Ask kindly to all actors to die. Only the issuer will survive. */ static void killAll(); - - smx_process_t getInferior(); + + /** Returns the internal implementation of this actor */ + smx_process_t getImpl(); }; using ActorPtr = Actor::Ptr; diff --git a/include/simgrid/s4u/mailbox.hpp b/include/simgrid/s4u/mailbox.hpp index c4a022c9d6..88f9b9856d 100644 --- a/include/simgrid/s4u/mailbox.hpp +++ b/include/simgrid/s4u/mailbox.hpp @@ -35,7 +35,7 @@ XBT_PUBLIC_CLASS Mailbox { Mailbox(smx_mailbox_t mbox): pimpl_(mbox) {} protected: - smx_mailbox_t getInferior() { return pimpl_; } + smx_mailbox_t getImpl() { return pimpl_; } public: diff --git a/src/s4u/s4u_actor.cpp b/src/s4u/s4u_actor.cpp index c53f54a211..0b42660f81 100644 --- a/src/s4u/s4u_actor.cpp +++ b/src/s4u/s4u_actor.cpp @@ -83,7 +83,7 @@ void Actor::kill(int pid) { } } -smx_process_t Actor::getInferior() { +smx_process_t Actor::getImpl() { return pimpl_; } diff --git a/src/s4u/s4u_comm.cpp b/src/s4u/s4u_comm.cpp index e10d2b00a7..7873e1d451 100644 --- a/src/s4u/s4u_comm.cpp +++ b/src/s4u/s4u_comm.cpp @@ -76,12 +76,12 @@ void Comm::start() { xbt_assert(state_ == inited); if (srcBuff_ != nullptr) { // Sender side - pimpl_ = simcall_comm_isend(sender_, mailbox_->getInferior(), remains_, rate_, + pimpl_ = simcall_comm_isend(sender_, mailbox_->getImpl(), remains_, rate_, srcBuff_, srcBuffSize_, matchFunction_, cleanFunction_, copyDataFunction_, userData_, detached_); } else if (dstBuff_ != nullptr) { // Receiver side - pimpl_ = simcall_comm_irecv(receiver_, mailbox_->getInferior(), dstBuff_, &dstBuffSize_, + pimpl_ = simcall_comm_irecv(receiver_, mailbox_->getImpl(), dstBuff_, &dstBuffSize_, matchFunction_, copyDataFunction_, userData_, rate_); @@ -97,12 +97,12 @@ void Comm::wait() { simcall_comm_wait(pimpl_, -1/*timeout*/); else {// p_state == inited. Save a simcall and do directly a blocking send/recv if (srcBuff_ != nullptr) { - simcall_comm_send(sender_, mailbox_->getInferior(), remains_, rate_, + simcall_comm_send(sender_, mailbox_->getImpl(), remains_, rate_, srcBuff_, srcBuffSize_, matchFunction_, copyDataFunction_, userData_, -1 /*timeout*/); } else { - simcall_comm_recv(receiver_, mailbox_->getInferior(), dstBuff_, &dstBuffSize_, + simcall_comm_recv(receiver_, mailbox_->getImpl(), dstBuff_, &dstBuffSize_, matchFunction_, copyDataFunction_, userData_, -1/*timeout*/, rate_); } @@ -120,12 +120,12 @@ void Comm::wait(double timeout) { // It's not started yet. Do it in one simcall if (srcBuff_ != nullptr) { - simcall_comm_send(sender_, mailbox_->getInferior(), remains_, rate_, + simcall_comm_send(sender_, mailbox_->getImpl(), remains_, rate_, srcBuff_, srcBuffSize_, matchFunction_, copyDataFunction_, userData_, timeout); } else { // Receiver - simcall_comm_recv(receiver_, mailbox_->getInferior(), dstBuff_, &dstBuffSize_, + simcall_comm_recv(receiver_, mailbox_->getImpl(), dstBuff_, &dstBuffSize_, matchFunction_, copyDataFunction_, userData_, timeout, rate_); } diff --git a/src/s4u/s4u_mailbox.cpp b/src/s4u/s4u_mailbox.cpp index bba9fd2a13..fe40a3f334 100644 --- a/src/s4u/s4u_mailbox.cpp +++ b/src/s4u/s4u_mailbox.cpp @@ -63,5 +63,5 @@ void sg_mbox_setReceiver(sg_mbox_t mbox, smx_process_t process) { mbox->setReceiver(&process->actor()); } smx_process_t sg_mbox_receiver(sg_mbox_t mbox) { - return mbox->receiver()->getInferior(); + return mbox->receiver()->getImpl(); } -- 2.20.1