From de9d56dddba96f345ba109a8cdb0a2986cd59292 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 15 Feb 2011 11:15:27 +0100 Subject: [PATCH] Cosmetics: move around some code. --- process.cpp | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/process.cpp b/process.cpp index c104ecd..470ad41 100644 --- a/process.cpp +++ b/process.cpp @@ -265,32 +265,6 @@ void process::send(neighbor& nb, double amount) nb.set_load(nb.get_load() + amount); } -#define print_loads_generic(vec, verbose, logp, cat) \ - if (_XBT_LOG_ISENABLEDV((*cat), logp)) { \ - using std::tr1::bind; \ - using std::tr1::placeholders::_1; \ - XBT_XCLOG(cat, logp, "My load: %g (real); %g (expected). " \ - "Neighbor loads:", real_load, expected_load); \ - std::for_each(vec.begin(), vec.end(), \ - bind(&neighbor::print, _1, verbose, logp, cat)); \ - } else ((void)0) - -void process::print_loads(bool verbose, - e_xbt_log_priority_t logp, - xbt_log_category_t cat) const -{ - print_loads_generic(neigh, verbose, logp, cat); -} - -void process::print_loads_p(bool verbose, - e_xbt_log_priority_t logp, - xbt_log_category_t cat) const -{ - print_loads_generic(pneigh, verbose, logp, cat); -} - -#undef print_loads_generic - void process::ctrl_send(neighbor& nb) { double info_to_send = get_load(); @@ -395,6 +369,32 @@ void process::handle_message(message* msg, m_host_t from) delete msg; } +#define print_loads_generic(vec, verbose, logp, cat) \ + if (_XBT_LOG_ISENABLEDV((*cat), logp)) { \ + using std::tr1::bind; \ + using std::tr1::placeholders::_1; \ + XBT_XCLOG(cat, logp, "My load: %g (real); %g (expected). " \ + "Neighbor loads:", real_load, expected_load); \ + std::for_each(vec.begin(), vec.end(), \ + bind(&neighbor::print, _1, verbose, logp, cat)); \ + } else ((void)0) + +void process::print_loads(bool verbose, + e_xbt_log_priority_t logp, + xbt_log_category_t cat) const +{ + print_loads_generic(neigh, verbose, logp, cat); +} + +void process::print_loads_p(bool verbose, + e_xbt_log_priority_t logp, + xbt_log_category_t cat) const +{ + print_loads_generic(pneigh, verbose, logp, cat); +} + +#undef print_loads_generic + // Local variables: // mode: c++ // End: -- 2.39.5