X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/3a610d4d2775be71fa1297f7f335376b2945984e..802ce8090d999864f8b55f6c2e19ac4fe0805ff3:/messages.cpp?ds=sidebyside diff --git a/messages.cpp b/messages.cpp index 0abf913..f5df396 100644 --- a/messages.cpp +++ b/messages.cpp @@ -4,6 +4,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(comm); #include "misc.h" +#include "options.h" #include "messages.h" @@ -16,6 +17,15 @@ std::string message::to_string() return oss.str(); } +double message::get_size() const +{ + // arbitrary: 8 for type, and 8 for amount + double size = 16; + if (type == LOAD) + size += opt::comm_cost(amount); + return size; +} + void message_queue::push(m_task_t task) { mutex.acquire();