Include accumulators on statistics engine in order to centralize and ease asXML....
[anna.git] / include / anna / statistics / Accumulator.hpp
index 98d4624..c13bbf1 100644 (file)
@@ -89,14 +89,31 @@ public:
 
   /**
   * Constructor.
+  *
+  * @param name Accumulator name
   */
-  Accumulator();
+  Accumulator(const std::string &name) : a_name(name) {};
 
   /**
   * Destructor.
   */
   ~Accumulator();
 
+  /**
+  * Adds a new statistic concept through the accumulator, to ease the concept name creation,
+  * which will be a string defined by: concept name + ': ' + accumulator name.
+  *
+  * @param description Concept description; e.g.: processing time, messages size, etc.
+  * @param unit Concept unit description
+  * @param integerNatureSample Most of cases we will measure 'time' with the unit which force integer values
+  *                            (is more intuitive 850 msecs than 0,850 secs). Then, it is @em true by default.
+  *                            This is useful to advice better representation for some indicators like minimum/maximum
+  *                             within integer samples.
+  *
+  * @return Assigned concept identification number (sequence)
+  */
+  int addConcept(const std::string & description, const std::string & unit, const bool & integerNatureSample = true) throw();
+
 
   /**
   * Process new value for the sample.
@@ -189,6 +206,8 @@ public:
 
 private:
 
+  std::string a_name;
+
   void initialize(const int & conceptId) throw();
   _concept_data_t * getConcept(const int & conceptId) const throw(anna::RuntimeException);
   // Return NULL if no data is found for the concept Id