Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
allow to get the number of queued communications in a Mailbox
authorSUTER Frederic <frederic.suter@cc.in2p3.fr>
Tue, 11 May 2021 16:02:54 +0000 (18:02 +0200)
committerSUTER Frederic <frederic.suter@cc.in2p3.fr>
Tue, 11 May 2021 16:02:54 +0000 (18:02 +0200)
include/simgrid/s4u/Mailbox.hpp
src/s4u/s4u_Mailbox.cpp

index 27efd6e..4daf375 100644 (file)
@@ -44,6 +44,9 @@ public:
   /** Returns whether the mailbox contains queued communications */
   bool empty() const;
 
+  /* Returns the number of queued communications */
+  unsigned int size() const;
+
   /** Check if there is a communication going on in a mailbox. */
   bool listen() const;
 
index 67a26c8..7aa76ec 100644 (file)
@@ -39,6 +39,11 @@ bool Mailbox::empty() const
   return pimpl_->comm_queue_.empty();
 }
 
+unsigned int Mailbox::size() const
+{
+  return pimpl_->comm_queue_.size();
+}
+
 bool Mailbox::listen() const
 {
   return not this->empty() || (pimpl_->permanent_receiver_ && not pimpl_->done_comm_queue_.empty());