-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemperature.hpp
58 lines (49 loc) · 1.65 KB
/
temperature.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef TEMPERATURE_HPP
#define TEMPERATURE_HPP
#include "sensor.hpp"
/**
* @brief Temperature sensor class
* @details This class is used to simulate a temperature sensor
*/
class Temperature : public Sensor<float> {
public:
/**
* @brief Construct a new Temperature object
* @details This constructor is used to build a temperature sensor
* with random values
*/
Temperature() {
std::cout << "Building temperature sensor..." << std::endl;
aleaGenVal();
};
/**
* @brief Construct a new Temperature object
* @details This constructor is used to build a temperature sensor
* with given values
* @param valSense the value of the sensor
*/
Temperature(float valSense) : Sensor<float>(valSense) {};
/**
* @brief Construct a new Temperature object
* @details This constructor is used to build a temperature sensor
* with another temperature sensor
* @param temperature a temperature sensor
*/
Temperature(const Temperature &temperature) : Sensor<float>(temperature) {};
/**
* @brief Destroy the Temperature object
* @details This destructor is used to destroy a temperature sensor
*/
~Temperature() {};
/**
* @brief Get the value of the sensor
* @return valSense
*/
float getValue() const;
/**
* @brief Generate a random value for the sensor
* @return the random value
*/
void aleaGenVal();
};
#endif // TEMPERATURE_HPP