X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FUtils%2FStatisticAccumulator.hh;h=08ba3447f0d6c21cbda70a32e85a22809270d621;hb=5b2e9a63a43027c71ac470ac9bdecb72e8974951;hp=388ef99c9ce4f1003cee9427c69829413cf116e7;hpb=7a9d26ea01ae0fb7f3d2a046ae19f8ceb9c4a9b6;p=senf.git diff --git a/senf/Utils/StatisticAccumulator.hh b/senf/Utils/StatisticAccumulator.hh index 388ef99..08ba344 100644 --- a/senf/Utils/StatisticAccumulator.hh +++ b/senf/Utils/StatisticAccumulator.hh @@ -31,21 +31,30 @@ #include ///////////////////////////////hh.p//////////////////////////////////////// namespace senf { - /** \brief Accumulate measurement values - - The accumulator mainly do the prelimenary work for the senf::Statistic class. - It accumulates certain values with in an interval to be used by senf::Statistics - - \li the senf::Statistics class - \li statistics sources - - This class provides the average, standard deviation, min, max values over one - interval, means until clear() is called. It rather directly calculates the results - then collection all single values provided by calling accumulate(). - \see senf::Statistics to process accumulated values - \ingroup senf_statistics - */ + struct StatisticsData + { + float min; + float max; + float avg; + float stddev; + boost::uint32_t count; + }; + + /** \brief Accumulate measurement values + + The accumulator mainly do the prelimenary work for the senf::Statistic class. + It accumulates certain values with in an interval to be used by senf::Statistics + + \li the senf::Statistics class + \li statistics sources + + This class provides the average, standard deviation, min, max values over one + interval, means until clear() is called. It rather directly calculates the results + then collection all single values provided by calling accumulate(). + \see senf::Statistics to process accumulated values + \ingroup senf_statistics + */ template class StatisticAccumulator { @@ -80,6 +89,9 @@ namespace senf { boost::uint32_t count() const; ///< Returns count of accumulated values. /**< This method returns count of accumulated values of the current accumulation.*/ + void data( StatisticsData & data_) const; + ///< Returns the accumulated data as a tuple + /**< This method returns the accumulated information as a tuple.*/ private: T sum_squared_; @@ -96,7 +108,6 @@ namespace senf { typedef StatisticAccumulator StatisticAccumulatorInt; typedef StatisticAccumulator StatisticAccumulatorFloat; - } ///////////////////////////////hh.e//////////////////////////////////////// //#include "StatisticAccumulator.cci"