From 236dd026088d572022729a7ca103ca74f9072ba4 Mon Sep 17 00:00:00 2001 From: Johann Dreo Date: Mon, 6 Sep 2010 00:04:37 +0200 Subject: [PATCH] indent clean, more comments --- eo/src/utils/eoStdoutMonitor.cpp | 70 ++++++++++++++++---------------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/eo/src/utils/eoStdoutMonitor.cpp b/eo/src/utils/eoStdoutMonitor.cpp index 95754de4..622a2743 100644 --- a/eo/src/utils/eoStdoutMonitor.cpp +++ b/eo/src/utils/eoStdoutMonitor.cpp @@ -16,41 +16,43 @@ using namespace std; eoMonitor& eoStdoutMonitor::operator()(void) { - if (!cout) - { - string str = "eoStdoutMonitor: Could not write to cout"; - throw runtime_error(str); + if (!cout) { + string str = "eoStdoutMonitor: Could not write to cout"; + throw runtime_error (str); } - if (firsttime) - { - if (verbose) + + if (firsttime) { + + if (verbose) { eo::log << eo::progress << "First Generation" << endl; - else - { - for(iterator it = vec.begin(); it != vec.end(); ++it) - { - cout << (*it)->longName() << delim; - } - cout << endl; - } - firsttime = false; - } + + } else { // else verbose + for (iterator it = vec.begin (); it != vec.end (); ++it) { + cout << (*it)->longName () << delim; + } + cout << endl; + } // else verbose + + firsttime = false; + } // if firstime + // ok, now the real saving. write out - if (verbose) - { - for(iterator it = vec.begin(); it != vec.end(); ++it) - { - cout << (*it)->longName() << ": " << (*it)->getValue() << endl; - } - eo::log << eo::progress << "End of Generation" << endl; - } - else // a one-liner - { - for(iterator it = vec.begin(); it != vec.end(); ++it) - { - cout << (*it)->getValue() << delim; - } - cout << endl; - } - return *this; + if (verbose) { + for (iterator it = vec.begin (); it != vec.end (); ++it) { + // name: value + cout << (*it)->longName () << ": " << (*it)->getValue () << endl; + } // for it in vec + + eo::log << eo::progress << "End of Generation" << endl; + + } else { // else verbose + for (iterator it = vec.begin (); it != vec.end (); ++it) { + // value only + cout << (*it)->getValue () << delim; + } // for it in vec + + cout << endl; + } // if verbose + + return *this; }