From 1177e7a3c861d77360074e97661952d427cd8640 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Thu, 12 May 2011 11:19:35 -0700 Subject: stats: move code that loops over all stats into python --- src/base/stats/text.cc | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'src/base/stats/text.cc') diff --git a/src/base/stats/text.cc b/src/base/stats/text.cc index f1ba59f0e..45d59ff29 100644 --- a/src/base/stats/text.cc +++ b/src/base/stats/text.cc @@ -48,7 +48,6 @@ #include "base/stats/info.hh" #include "base/stats/text.hh" -#include "base/stats/visit.hh" #include "base/cast.hh" #include "base/misc.hh" #include "base/str.hh" @@ -138,12 +137,14 @@ Text::valid() const } void -Text::output() +Text::begin() { ccprintf(*stream, "\n---------- Begin Simulation Statistics ----------\n"); - list::const_iterator i, end = statsList().end(); - for (i = statsList().begin(); i != end; ++i) - (*i)->visit(*this); +} + +void +Text::end() +{ ccprintf(*stream, "\n---------- End Simulation Statistics ----------\n"); stream->flush(); } @@ -580,23 +581,19 @@ Text::visit(const FormulaInfo &info) visit((const VectorInfo &)info); } -bool +Output * initText(const string &filename, bool desc) { static Text text; static bool connected = false; - if (connected) - return false; - - extern list OutputList; - - text.open(*simout.find(filename)); - text.descriptions = desc; - OutputList.push_back(&text); - connected = true; + if (!connected) { + text.open(*simout.find(filename)); + text.descriptions = desc; + connected = true; + } - return true; + return &text; } } // namespace Stats -- cgit v1.2.3