3 * Copyright (C) 2005-2013 Team XBMC
6 * This Program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
11 * This Program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with XBMC; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
23 #include "utils/Archive.h"
25 class CTemperature : public IArchivable
29 CTemperature(const CTemperature& temperature);
31 static CTemperature CreateFromFahrenheit(double value);
32 static CTemperature CreateFromKelvin(double value);
33 static CTemperature CreateFromCelsius(double value);
34 static CTemperature CreateFromReaumur(double value);
35 static CTemperature CreateFromRankine(double value);
36 static CTemperature CreateFromRomer(double value);
37 static CTemperature CreateFromDelisle(double value);
38 static CTemperature CreateFromNewton(double value);
40 bool operator >(const CTemperature& right) const;
41 bool operator >=(const CTemperature& right) const;
42 bool operator <(const CTemperature& right) const;
43 bool operator <=(const CTemperature& right) const;
44 bool operator ==(const CTemperature& right) const;
45 bool operator !=(const CTemperature& right) const;
47 const CTemperature& operator =(const CTemperature& right);
48 const CTemperature& operator +=(const CTemperature& right);
49 const CTemperature& operator -=(const CTemperature& right);
50 const CTemperature& operator *=(const CTemperature& right);
51 const CTemperature& operator /=(const CTemperature& right);
52 CTemperature operator +(const CTemperature& right) const;
53 CTemperature operator -(const CTemperature& right) const;
54 CTemperature operator *(const CTemperature& right) const;
55 CTemperature operator /(const CTemperature& right) const;
57 bool operator >(double right) const;
58 bool operator >=(double right) const;
59 bool operator <(double right) const;
60 bool operator <=(double right) const;
61 bool operator ==(double right) const;
62 bool operator !=(double right) const;
64 const CTemperature& operator +=(double right);
65 const CTemperature& operator -=(double right);
66 const CTemperature& operator *=(double right);
67 const CTemperature& operator /=(double right);
68 CTemperature operator +(double right) const;
69 CTemperature operator -(double right) const;
70 CTemperature operator *(double right) const;
71 CTemperature operator /(double right) const;
73 CTemperature& operator ++();
74 CTemperature& operator --();
75 CTemperature operator ++(int);
76 CTemperature operator --(int);
78 virtual void Archive(CArchive& ar);
86 void SetState(CTemperature::STATE state);
89 double ToFahrenheit() const;
90 double ToKelvin() const;
91 double ToCelsius() const;
92 double ToReaumur() const;
93 double ToRankine() const;
94 double ToRomer() const;
95 double ToDelisle() const;
96 double ToNewton() const;
98 double ToLocale() const;
99 std::string ToString() const;
102 CTemperature(double value);
105 double m_value; // we store as fahrenheit