ANNA Suite  2020b
Multipurpose development suite for Telco applications
Meter.hpp
Go to the documentation of this file.
1 // ANNA - Anna is Not Nothingness Anymore //
2 // //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
4 // //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7 
8 
9 #ifndef anna_statistics_Meter_hpp
10 #define anna_statistics_Meter_hpp
11 
12 #include <anna/timex/Meter.hpp>
13 
14 // Standard
15 #include <string>
16 
17 // Local
19 
20 
21 namespace anna {
22 namespace xml {
23 class Node;
24 }
25 }
26 
27 
28 namespace anna {
29 
30 namespace statistics {
31 
32 
33 using namespace anna;
34 
35 
36 //------------------------------------------------------------------------------
37 //------------------------------------------------------------------ class Meter
38 //------------------------------------------------------------------------------
45 class Meter {
46 public:
47 
51  Meter(const std::string & name);
52 
56  ~Meter();
57 
58 
62  void setControlPoint(void) { a_meter.setControlPoint(); }
63 
64 
68  void reset(void) { a_accumulator.reset(); }
69 
70 
76  Millisecond process(void) { a_accumulator.process(a_single_accumulator_concept_id, a_meter.getDelay()); return (a_meter.getDelay()); }
77 
78 
86  const Meter & operator = (const Meter & meter);
87 
88 
89 
90  // Gets
91 
92 // /**
93 // * Gets accumulator information in order to extract statistics indicators
94 // */
95 // const Accumulator & getAccumulator(void) const { return (a_accumulator); }
96 
104  double getAccumulatorValue(const Operation::Type &operation) const { return (a_accumulator.getValue(a_single_accumulator_concept_id, operation)); }
105 
106 
114  std::string asString(const int & numberOfDecimals = 2) const ;
115 
116 
124  anna::xml::Node* asXML(anna::xml::Node* parent, const int & numberOfDecimals = 2) const ;
125 
126 
127 
128 private:
129 
130  timex::Meter a_meter;
131  Accumulator a_accumulator;
132  int a_single_accumulator_concept_id;
133 };
134 
135 }
136 }
137 
138 #endif
Millisecond process(void)
Definition: Meter.hpp:76
Definition: Millisecond.hpp:24
Processing time control.
Definition: Meter.hpp:45
void reset(void)
Definition: Meter.hpp:68
Definition: Node.hpp:56
double getAccumulatorValue(const Operation::Type &operation) const
Definition: Meter.hpp:104
void setControlPoint(void)
Definition: Meter.hpp:62
Type
Definition: Accumulator.hpp:33
xml::Node Node
Definition: Node.hpp:21
Definition: app.hpp:12
Contains statistical sample information.
Definition: Accumulator.hpp:87
Definition: Meter.hpp:41