base
Temperature.hpp
Go to the documentation of this file.
1 #ifndef __BASE_TEMPERATURE_HH__
2 #define __BASE_TEMPERATURE_HH__
3 
4 #include <complex> // std::abs
5 
6 namespace base
7 {
8 
15 {
16 public:
17 
25  double kelvin;
26 
30  Temperature();
31 
32 protected:
33  explicit Temperature( double kelvin );
34 
35 
36 public:
42  static double kelvin2Celsius( double kelvin );
43 
49  static double celsius2Kelvin( double celsius );
50 
51 
57  static Temperature fromKelvin( double kelvin );
58 
59 
65  static Temperature fromCelsius( double celsius );
66 
70  double getKelvin() const ;
71 
75  double getCelsius() const;
76 
80  bool isInRange(const Temperature &left_limit,const Temperature &right_limit) const;
81 
88  bool isApprox( Temperature other, double prec = 1e-5 ) const;
89 
90  void operator=(const Temperature &other);
91 
92  bool operator==(const Temperature &other ) const;
93 
94  bool operator<(const Temperature &other ) const;
95 
96  bool operator>(const Temperature &other ) const;
97 
98 };
99 
101 
103 
104 Temperature operator*( Temperature a, double b );
105 
106 Temperature operator*( double a, Temperature b );
107 
108 std::ostream& operator << (std::ostream& os, Temperature temperature);
109 
110 
111 }
112 
113 #endif
std::ostream & operator<<(std::ostream &os, Angle angle)
Definition: Angle.cpp:25
bool operator>(const Temperature &other) const
Definition: Temperature.cpp:68
bool operator<(const Temperature &other) const
Definition: Temperature.cpp:63
double getCelsius() const
Definition: Temperature.cpp:43
static Temperature fromCelsius(double celsius)
Definition: Temperature.cpp:33
static double kelvin2Celsius(double kelvin)
Definition: Temperature.cpp:18
Temperature operator-(Temperature a, Temperature b)
Definition: Temperature.cpp:78
bool isInRange(const Temperature &left_limit, const Temperature &right_limit) const
Definition: Temperature.cpp:99
bool isApprox(Temperature other, double prec=1e-5) const
Definition: Temperature.cpp:48
Temperature()
Definition: Temperature.cpp:8
Temperature operator*(Temperature a, double b)
Definition: Temperature.cpp:83
bool operator==(const Temperature &other) const
Definition: Temperature.cpp:58
Temperature operator+(Temperature a, Temperature b)
Definition: Temperature.cpp:73
Definition: LinearAngular6DCommand.hpp:8
double kelvin
Definition: Temperature.hpp:25
static double celsius2Kelvin(double celsius)
Definition: Temperature.cpp:23
void operator=(const Temperature &other)
Definition: Temperature.cpp:53
static Temperature fromKelvin(double kelvin)
Definition: Temperature.cpp:28
double getKelvin() const
Definition: Temperature.cpp:38
Definition: Temperature.hpp:14