X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/892e36c1af3105e5f548a4ef8b9f777b95d47fc2..72cb21403f86fbb162c8e4555f27234d337b6b6a:/messages.h diff --git a/messages.h b/messages.h index 34e9248..8de464a 100644 --- a/messages.h +++ b/messages.h @@ -5,6 +5,7 @@ #include #include #include "synchro.h" +#include "sync_queue.h" class message { public: @@ -14,6 +15,7 @@ public: message_type get_type() const { return type; } double get_amount() const { return amount; } + double get_size() const; std::string to_string(); @@ -27,7 +29,7 @@ public: // Push a message on queue void push(m_task_t task); - // Try to get a message. Returns true on success. + // Try to pop a message. Returns true on success. // Parameter "timeout" may be 0 for non-blocking operation, -1 for // infinite waiting, or any positive timeout. bool pop(message*& msg, m_host_t& from, double timeout); @@ -38,7 +40,7 @@ public: private: mutex_t mutex; condition_t cond; - std::queue queue; + sync_queue queue; }; #endif // !MESSAGES_H