]> AND Private Git Repository - loba.git/blobdiff - communicator.cpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Fix comment.
[loba.git] / communicator.cpp
index daf14348393761cded88e166bbdfd4d313e4622e..fd01ac91b585074fa2b891daaf3dec8f0ac8deb6 100644 (file)
@@ -60,7 +60,10 @@ void communicator::send(const char* dest, message* msg)
 
 void communicator::flush(bool wait)
 {
-    sent_comm.remove_if(comm_test_n_destroy);
+    sent_comm_type::iterator bound;
+    bound = std::remove_if(sent_comm.begin(), sent_comm.end(),
+                           comm_test_n_destroy);
+    sent_comm.erase(bound, sent_comm.end());
     if (wait && !sent_comm.empty()) {
         msg_comm_t comms[sent_comm.size()];
         std::copy(sent_comm.begin(), sent_comm.end(), comms);
@@ -72,16 +75,6 @@ void communicator::flush(bool wait)
     }
 }
 
-bool communicator::recv(message*& msg, m_host_t& from, double timeout)
-{
-    XBT_DEBUG("waiting for a message to come");
-    bool recvd = received.pop(msg, from, timeout);
-    if (recvd)
-        XBT_DEBUG("received %s from %s",
-                  msg->to_string().c_str(), MSG_host_get_name(from));
-    return recvd;
-}
-
 void communicator::receiver()
 {
     xbt_dynar_t comms = xbt_dynar_new(sizeof(msg_comm_t), NULL);