Packets/DefaultBundle: added EUI64Parser
[senf.git] / senf / Utils / Statistics.hh
index 4a29c8c..3093b1c 100644 (file)
 #include "Exception.hh"
 #include <senf/Utils/Logger/Logger.hh>
 #include <senf/Utils/Console/Console.hh>
+#include "StatisticAccumulator.hh"
 
 //#include "Statistics.mpp"
-///////////////////////////////hh.p////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
 
 namespace senf {
 
@@ -49,6 +50,7 @@ namespace senf {
         The statistics functionality has two parts:
 
         \li the senf::Statistics class
+        \li the senf::StatisticsAccumulator class
         \li statistics sources
 
         Each senf::Statistics instance collects information about a single parameter. Which
@@ -78,7 +80,7 @@ namespace senf {
         struct OutputEntry;
 
     public:
-        ///////////////////////////////////////////////////////////////////////////
+        //-////////////////////////////////////////////////////////////////////////
         // Types
 
         typedef boost::iterator_range<ValueIterator> CollectorRange;
@@ -146,9 +148,9 @@ namespace senf {
             template <class OtherOwner> friend class OutputProxy;
         };
 
-        ///////////////////////////////////////////////////////////////////////////
+        //-////////////////////////////////////////////////////////////////////////
         ///\name Accessing the current value
-        ///\{
+        //\{
 
         float min() const;              ///< Last min value entered
         float avg() const;              ///< Last avg value entered
@@ -159,10 +161,10 @@ namespace senf {
                                         /**< \returns number of basic values collected into each new
                                              value by this collector. */
 
-        ///\}
-        ///////////////////////////////////////////////////////////////////////////
+        //\}
+        //-////////////////////////////////////////////////////////////////////////
         ///\name Child collectors
-        ///\{
+        //\{
 
         Collector & operator[](unsigned rank);
                                         ///< Get child collector
@@ -204,8 +206,8 @@ namespace senf {
                                              is empty, otherwise it is built by joining the
                                              collector ranks. */
 
-        ///\}
-        ///////////////////////////////////////////////////////////////////////////
+        //\}
+        //-////////////////////////////////////////////////////////////////////////
         ///\name Result generation
 
         OutputProxy<StatisticsBase> output(unsigned n = 1u);
@@ -221,8 +223,8 @@ namespace senf {
                                              \endcode
                                              \param[in] n size of sliding average window */
 
-        ///\}
-        ///////////////////////////////////////////////////////////////////////////
+        //\}
+        //-////////////////////////////////////////////////////////////////////////
         // Exceptions
 
         struct InvalidRankException : public senf::Exception
@@ -463,6 +465,14 @@ namespace senf {
                                         ///< Same as operator() with \a min == \a avg == \a max
                                         /**< Provided so a Statistics instance can be directly used
                                              as a signal target. */
+        template <class Value>
+        void operator()(unsigned n, StatisticAccumulator<Value> & sa);
+                                        ///< Same as operator() gathers values from StatisticAccumulator
+                                        /**< Provided so a Statistics instance can be directly used
+                                             as a signal target. Caution: Clears values in
+                                             StatisticAccumulator afterwards
+                                             \param[in] n number of time-slices
+                                             \param[in] sa StatisticAccumulator*/
 
         StatisticsBase::OutputProxy<Statistics> output(unsigned n = 1u);
 
@@ -509,7 +519,7 @@ namespace senf {
 
 }
 
-///////////////////////////////hh.e////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
 #include "Statistics.cci"
 //#include "Statistics.ct"
 #include "Statistics.cti"