SignalStats.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 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 IGNITION_MATH_SIGNALSTATS_HH_
18 #define IGNITION_MATH_SIGNALSTATS_HH_
19 
20 #include <map>
21 #include <memory>
22 #include <string>
23 #include <ignition/math/Helpers.hh>
24 
25 namespace ignition
26 {
27  namespace math
28  {
30  class SignalStatisticPrivate;
31 
35  {
37  public: SignalStatistic();
38 
40  public: virtual ~SignalStatistic();
41 
44  public: SignalStatistic(const SignalStatistic &_ss);
45 
48  public: virtual double Value() const = 0;
49 
52  public: virtual std::string ShortName() const = 0;
53 
56  public: virtual size_t Count() const;
57 
60  public: virtual void InsertData(const double _data) = 0;
61 
63  public: virtual void Reset();
64 
65 #ifdef _WIN32
66 // Disable warning C4251 which is triggered by
67 // std::unique_ptr
68 #pragma warning(push)
69 #pragma warning(disable: 4251)
70 #endif
71  protected: std::unique_ptr<SignalStatisticPrivate> dataPtr;
73 #ifdef _WIN32
74 #pragma warning(pop)
75 #endif
76  };
78 
82  {
83  // Documentation inherited.
84  public: virtual double Value() const;
85 
88  public: virtual std::string ShortName() const;
89 
90  // Documentation inherited.
91  public: virtual void InsertData(const double _data);
92  };
94 
98  {
99  // Documentation inherited.
100  public: virtual double Value() const;
101 
104  public: virtual std::string ShortName() const;
105 
106  // Documentation inherited.
107  public: virtual void InsertData(const double _data);
108  };
110 
114  {
115  // Documentation inherited.
116  public: virtual double Value() const;
117 
120  public: virtual std::string ShortName() const;
121 
122  // Documentation inherited.
123  public: virtual void InsertData(const double _data);
124  };
126 
131  {
132  // Documentation inherited.
133  public: virtual double Value() const;
134 
137  public: virtual std::string ShortName() const;
138 
139  // Documentation inherited.
140  public: virtual void InsertData(const double _data);
141  };
143 
150  {
151  // Documentation inherited.
152  public: virtual double Value() const;
153 
156  public: virtual std::string ShortName() const;
157 
158  // Documentation inherited.
159  public: virtual void InsertData(const double _data);
160  };
162 
167  {
168  // Documentation inherited.
169  public: virtual double Value() const;
170 
173  public: virtual std::string ShortName() const;
174 
175  // Documentation inherited.
176  public: virtual void InsertData(const double _data);
177  };
179 
181  class SignalStatsPrivate;
182 
186  {
188  public: SignalStats();
189 
191  public: ~SignalStats();
192 
195  public: SignalStats(const SignalStats &_ss);
196 
202  public: size_t Count() const;
203 
208  public: std::map<std::string, double> Map() const;
209 
212  public: void InsertData(const double _data);
213 
223  public: bool InsertStatistic(const std::string &_name);
224 
232  public: bool InsertStatistics(const std::string &_names);
233 
235  public: void Reset();
236 
240  public: SignalStats &operator=(const SignalStats &_s);
241 
242 #ifdef _WIN32
243 // Disable warning C4251 which is triggered by
244 // std::unique_ptr
245 #pragma warning(push)
246 #pragma warning(disable: 4251)
247 #endif
248  private: std::unique_ptr<SignalStatsPrivate> dataPtr;
250 #ifdef _WIN32
251 #pragma warning(pop)
252 #endif
253  };
255  }
256 }
257 #endif
258 
Statistical properties of a discrete time scalar signal.
Definition: SignalStats.hh:34
Computing the incremental variance of a discretely sampled signal.
Definition: SignalStats.hh:166
Private data class for the SignalStats class.
Definition: SignalStatsPrivate.hh:61
Computing the minimum value of a discretely sampled signal.
Definition: SignalStats.hh:113
ignition/math/SignalStats.hh
Definition: SignalStats.hh:149
Computing the maximum value of a discretely sampled signal.
Definition: SignalStats.hh:81
Computing the mean value of a discretely sampled signal.
Definition: SignalStats.hh:97
#define IGNITION_VISIBLE
Use to represent "symbol visible" if supported.
Definition: System.hh:59
Collection of statistics for a scalar signal.
Definition: SignalStats.hh:185
Computing the square root of the mean squared value of a discretely sampled signal.
Definition: SignalStats.hh:130
Definition: Angle.hh:38