CARMA C++
Temperature.h
Go to the documentation of this file.
1 // $Id: Temperature.h,v 1.5 2014/04/02 23:11:12 iws Exp $
2 
14 #ifndef CARMA_SERVICES_TEMPERATURE_H
15 #define CARMA_SERVICES_TEMPERATURE_H
16 
18 #include "carma/services/Units.h"
19 #include <string>
20 
21 namespace carma {
22  namespace services {
40  public:
41 
49  Temperature(double value, const std::string& units);
50 
52  virtual ~Temperature();
53 
61  void reset(double value, const std::string& units);
62 
68  double celsius() const;
69 
75  double fahrenheit() const;
76 
82  double kelvin() const;
83 
89  const Temperature operator+(const Temperature& t) const;
90 
96  const Temperature operator-(const Temperature& t) const;
97 
104  bool operator<(const Temperature &t) const;
105 
112  bool operator>(const Temperature &t) const;
113 
119 
125 
126  };
130 std::ostream& operator<<(std::ostream& os,
132 
133  }
134 }
135 
136 
137 #endif //CARMA_SERVICES_TEMPERATURE_H
The ConformableQuantity class can represent any quantity that can be expressed in many units...
Temperature(double value, const std::string &units)
Construct a Temperature given a value and units.
const Temperature operator-(const Temperature &t) const
Subtract two temperatures.
Temperature & operator+=(const Temperature &t)
Increment temperature.
void reset(double value, const std::string &units)
Override parent method.
const Temperature operator+(const Temperature &t) const
Add two Temperatures.
virtual ~Temperature()
Destructor.
The Temperature class represents a temperature in any unit.
Definition: Temperature.h:39
Temperature & operator-=(const Temperature &t)
Decrement temperature.
double fahrenheit() const
Convenience method that returns the value of this temperature in fahrenheit.
double kelvin() const
Convenience method that returns the value of this temperature in Kelvin.
Parent class for representations of quantities that can have conformable units, e.g.
std::ostream & operator<<(std::ostream &os, const carma::services::Angle &angle)
Define the &lt;&lt; operator to allow, e.g.
double celsius() const
Convenience method that returns the value of this temperature in Celsius.
bool operator<(const Temperature &t) const
Compare two temperatures.
bool operator>(const Temperature &t) const
Compare two temperature.