BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
ValueGenerator.h
1 #pragma once
2 
3 namespace Poco {
4 
5 class DateTime;
6 class Timestamp;
7 class Timespan;
8 
9 }
10 
11 namespace BeeeOn {
12 
14 public:
16  virtual ~ValueGenerator();
17 
18  virtual bool hasNext() const;
19  virtual double next() = 0;
20 };
21 
23 public:
24  LimitedGenerator(ValueGenerator &impl, unsigned int count);
25 
26  virtual bool hasNext() const;
27  virtual double next();
28 
29 private:
30  ValueGenerator &m_impl;
31  unsigned int m_count;
32 };
33 
35 public:
36  RangeGenerator(ValueGenerator &impl, double min, double max);
37 
38  virtual double next();
39 
40 private:
41  ValueGenerator &m_impl;
42  double m_min;
43  double m_max;
44 };
45 
47 public:
49  const Poco::DateTime &start,
50  const Poco::Timespan step);
52  const Poco::DateTime &start,
53  unsigned int stepSecs);
54 
55  virtual bool hasNext() const;
56  virtual double next();
57  virtual Poco::Timestamp at() const;
58 
59 private:
60  ValueGenerator &m_impl;
61  Poco::Timestamp m_at;
62  Poco::Timespan m_step;
63 };
64 
66 public:
68  const Poco::DateTime &before);
70  const Poco::Timestamp &before);
71 
72  virtual bool hasNext() const;
73  virtual double next();
74  virtual Poco::Timestamp at() const;
75 
76 private:
77  TimestampedGenerator m_impl;
78  Poco::Timestamp m_before;
79 };
80 
82 public:
83  ConstGenerator(double value);
84 
85  double next();
86 
87 private:
88  double m_value;
89 };
90 
91 class SinGenerator : public ValueGenerator {
92 public:
93  SinGenerator(double step = 0.01);
94 
95  double next();
96 
97 private:
98  double m_value;
99  double m_step;
100 };
101 
103 public:
104  RandomGenerator(unsigned int seed = 0);
105 
106  double next();
107 
108 private:
109  unsigned int m_seed;
110 };
111 
112 }
Definition: ValueGenerator.h:22
Definition: ValueGenerator.h:34
Definition: ValueGenerator.h:13
Definition: ValueGenerator.h:91
Definition: ValueGenerator.h:102
Definition: ValueGenerator.h:81
Definition: ValueGenerator.h:65
Definition: ValueGenerator.h:46