X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/0872290a992e2f6db574c18ac36d1987318d477d..0e9987fcef822119e3218d14328eb39977525662:/communicator.cpp diff --git a/communicator.cpp b/communicator.cpp index daf1434..fd01ac9 100644 --- a/communicator.cpp +++ b/communicator.cpp @@ -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);