00001
00002
00003 #ifndef STATISTIC_H
00004 #define STATISTIC_H
00005
00006 #include "Analyze.h"
00007
00008 #include "analysis/smplstat.h"
00009
00010 class Statistic : public Analyze {
00011
00012 public:
00013 Statistic(const Tuple& t, const std::string& item_name, std::string title)
00014 : Analyze(t, item_name, title){}
00015
00016 Statistic(const Tuple&t, std::string::const_iterator& it, std::string::iterator end);
00017
00018 virtual void report(std::ostream& out);
00019 void clear() { m_stat.reset(); }
00020 const SampleStatistic& stat() const {return m_stat;}
00021 private:
00022 virtual bool apply ()
00023 {
00024 m_stat += item();
00025 return true;
00026 }
00027 SampleStatistic m_stat;
00028 };
00029
00030 #endif