X-Git-Url: http://g0dil.de/git?p=senf.git;a=blobdiff_plain;f=senf%2FUtils%2FStatistics.hh;fp=senf%2FUtils%2FStatistics.hh;h=0e7936100428355787d29b06aabc50d205e57384;hp=cdea0da136a8d1c39a30538bd5440e526ea78860;hb=ecbf10f737b7f1305670600ac0f1134625f14f05;hpb=d5b4cca5714c2b44bbc476636a0774b4fcbd9151 diff --git a/senf/Utils/Statistics.hh b/senf/Utils/Statistics.hh index cdea0da..0e79361 100644 --- a/senf/Utils/Statistics.hh +++ b/senf/Utils/Statistics.hh @@ -74,13 +74,10 @@ namespace senf { { typedef std::map Children; - struct Transform { - typedef Children::value_type & first_argument_type; - typedef Collector & result_type; - result_type operator()(first_argument_type i) const; - }; - - typedef boost::transform_iterator ValueIterator; + typedef boost::transform_iterator< ::__gnu_cxx::select2nd, + Children::iterator > collector_iterator; + typedef boost::transform_iterator< ::__gnu_cxx::select2nd, + Children::const_iterator > collector_const_iterator; struct OutputEntry; @@ -88,7 +85,8 @@ namespace senf { //-//////////////////////////////////////////////////////////////////////// // Types - typedef boost::iterator_range CollectorRange; + typedef boost::iterator_range CollectorRange; + typedef boost::iterator_range const_CollectorRange; /** \brief Output connection interface @@ -190,6 +188,10 @@ namespace senf { CollectorRange collectors(); ///< List all child collectors /**< \returns iterator range of child collector references */ + const_CollectorRange collectors() const; + ///< List all child collectors + /**< \returns const iterator range of child collector + references */ Collector & collect(unsigned rank); ///< Register a new collector /**< Adds a collector collecting \a rank values into each @@ -199,6 +201,11 @@ namespace senf { \throws DuplicateRankException if a collector collecting \a rank values already exists. */ + Statistics const & base() const; ///< Get const base statistics object + /**< Returns the base statistics object as const reference. + If this is a child collector, this will return the outermost + statistics object, otherwise it will return + \c *this. */ Statistics & base(); ///< Get base statistics object /**< Returns the base statistics object. If this is a child collector, this will return the outermost @@ -229,10 +236,9 @@ namespace senf { \param[in] n size of sliding average window */ //\} - StatisticsData data(); ///< Get the Statistics data as senf::StatisticsData - /**< Return a Statistic Data object containing values - from this instance. - */ + StatisticsData data() const; ///< Get the Statistics data as senf::StatisticsData + /**< Return a Statistic Data object containing values + from this instance. */ //-////////////////////////////////////////////////////////////////////////