SignalStats.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014-2015 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 #ifndef _GAZEBO_SIGNAL_STATS_HH_
18 #define _GAZEBO_SIGNAL_STATS_HH_
19 
20 #include <map>
21 #include <string>
22 #include "gazebo/util/system.hh"
23 
24 namespace gazebo
25 {
26  namespace math
27  {
30 
32  class SignalStatisticPrivate;
33 
37  {
39  public: SignalStatistic();
40 
42  public: virtual ~SignalStatistic();
43 
46  public: virtual double Value() const = 0;
47 
50  public: virtual std::string ShortName() const = 0;
51 
54  public: virtual size_t Count() const;
55 
58  public: virtual void InsertData(const double _data) = 0;
59 
61  public: virtual void Reset();
62 
65  };
67 
71  {
72  // Documentation inherited.
73  public: virtual double Value() const;
74 
77  public: virtual std::string ShortName() const;
78 
79  // Documentation inherited.
80  public: virtual void InsertData(const double _data);
81  };
83 
88  {
89  // Documentation inherited.
90  public: virtual double Value() const;
91 
94  public: virtual std::string ShortName() const;
95 
96  // Documentation inherited.
97  public: virtual void InsertData(const double _data);
98  };
100 
106  {
107  // Documentation inherited.
108  public: virtual double Value() const;
109 
112  public: virtual std::string ShortName() const;
113 
114  // Documentation inherited.
115  public: virtual void InsertData(const double _data);
116  };
118 
120  class SignalStatsPrivate;
121 
125  {
127  public: SignalStats();
128 
130  public: ~SignalStats();
131 
137  public: size_t Count() const;
138 
143  public: std::map<std::string, double> Map() const;
144 
147  public: void InsertData(const double _data);
148 
158  public: bool InsertStatistic(const std::string &_name);
159 
167  public: bool InsertStatistics(const std::string &_names);
168 
170  public: void Reset();
171 
174  };
176  }
177 }
178 #endif
179 
SignalStatsPrivate * dataPtr
Pointer to private data.
Definition: SignalStats.hh:173
Computing the mean value of a discretely sampled signal.
Definition: SignalStats.hh:70
Collection of statistics for a scalar signal.
Definition: SignalStats.hh:124
Computing the square root of the mean squared value of a discretely sampled signal.
Definition: SignalStats.hh:87
Private data class for the SignalStatistic class.
Definition: SignalStatsPrivate.hh:28
Computing the maximum of the absolute value of a discretely sampled signal.
Definition: SignalStats.hh:105
Statistical properties of a discrete time scalar signal.
Definition: SignalStats.hh:36
Private data class for the SignalStats class.
Definition: SignalStatsPrivate.hh:48
SignalStatisticPrivate * dataPtr
Pointer to private data.
Definition: SignalStats.hh:64
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48