made some members non-inline to decrease size
[senf.git] / senf / Utils / Statistics.cc
index 2fe9334..f2b9c9d 100644 (file)
 #include <cmath>
 #include <cstdlib>
 #include <sstream>
-#include <senf/Utils/Console/Console.hh>
 #include <senf/Utils/Format.hh>
 #include "StatisticsTargets.hh"
 
 //#include "Statistics.mpp"
 #define prefix_
-///////////////////////////////cc.p////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
 
-///////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
 // senf::StatisticsBase
 
 prefix_ void senf::StatisticsBase::enter(unsigned n, float min, float avg, float max, float dev)
@@ -63,6 +62,15 @@ prefix_ senf::Collector & senf::StatisticsBase::operator[](unsigned rank)
     return i->second;
 }
 
+prefix_ senf::Collector const & senf::StatisticsBase::operator[](unsigned rank)
+    const
+{
+    Children::const_iterator i (children_.find(rank));
+    if (i == children_.end())
+        throw InvalidRankException();
+    return i->second;
+}
+
 prefix_ senf::Collector & senf::StatisticsBase::collect(unsigned rank)
 {
     std::pair<Children::iterator, bool> state (
@@ -141,7 +149,18 @@ prefix_ void senf::StatisticsBase::generateOutput()
     }
 }
 
-///////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
+// senf::StatisticsBase::OutputEntry
+
+prefix_ void senf::StatisticsBase::OutputEntry::consoleList(std::ostream & os)
+{
+    for (boost::ptr_vector<TargetBase>::iterator i (targets_.begin());
+         i != targets_.end(); ++i)
+        if (! i->label.empty())
+            os << i->label << "\n";
+}
+
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
 // senf::Statistics
 
 prefix_ senf::Statistics::Statistics()
@@ -260,7 +279,7 @@ prefix_ std::string senf::Statistics::v_path()
     return "";
 }
 
-///////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
 // senf::Collector
 
 prefix_ void senf::Collector::enter(unsigned n, float min, float avg, float max, float dev)
@@ -308,7 +327,7 @@ prefix_ std::string senf::Collector::v_path()
     return owner_->path() + "-" + senf::str(rank_);
 }
 
-///////////////////////////////cc.e////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
 #undef prefix_
 //#include "Statistics.mpp"