Jamoma API  0.6.0.a19
TemperatureDataspace.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup foundationDataspaceLib
4  *
5  * @brief The #TemperatureDataspace converts between different measurement untis describing temperature.
6  *
7  * @details The neutral unit of the temperature dataspace is _Kelvin (K)_.
8  *
9  * @authors Nils Peters, Trond Lossius, Tim Peters, ...
10  *
11  * @copyright Copyright © 2007 by Tim Place @n
12  * This code is licensed under the terms of the "New BSD License" @n
13  * http://creativecommons.org/licenses/BSD/
14  */
15 
16 
17 #ifndef __TEMPERATUREDATASPACE_H__
18 #define __TEMPERATUREDATASPACE_H__
19 
20 #include "TTDataspace.h"
21 
22 
23 /** Base class for the temperature dataspace, provides dataspace support for converting temperatures between Celsius, Fahrenheit and Kelvin.
24  *
25  * @details: Kelvin is the neutral data unit of this dataspace.
26  */
29 
30  /** Unit test for the temperature dataspace.
31  @param returnedTestInfo The outcome from the performed unit test.
32  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
33  */
34  virtual TTErr test(TTValue& returnedTestInfo);
35 };
36 
37 
38 /** Converts temperatures to and from Celsius.
39  *
40  * @details This unit is denoted as "C" or "Celsius".
41  */
44 
45 public:
46 
47  /** Convert from Celsius to neutral unit.
48  @param input Input temperature described using Celsius .
49  @param output Returned temperature, converted to neutral unit.
50  */
51  void convertToNeutral(const TTValue& input, TTValue& output);
52 
53  /** Convert from neutral unit to Celsius.
54  @param input Input temperature described using the neutral unit.
55  @param output Returned temperature, described using Celsius.
56  */
57  void convertFromNeutral(const TTValue& input, TTValue& output);
58 };
59 
60 
61 /** Converts temperatures to and from Fahrenheit.
62  *
63  * @details This unit is denoted as "F" or "Fahrenheit".
64  */
67 
68 public:
69 
70  /** Convert from Fahrenheit to neutral unit.
71  @param input Input temperature described using Fahrenheit .
72  @param output Returned temperature, converted to neutral unit.
73  */
74  void convertToNeutral(const TTValue& input, TTValue& output);
75 
76  /** Convert from neutral unit to Fahrenheit.
77  @param input Input temperature described using the Fahrenheit unit.
78  @param output Returned temperature, described using radians.
79  */
80  void convertFromNeutral(const TTValue& input, TTValue& output);
81 };
82 
83 
84 /** Converts temperatures to and from Kelvin.
85  *
86  * @details This unit is denoted as "K" or "Kelvin".
87  */
90 
91 public:
92 
93  /** Convert from Kelvin to neutral unit.
94  @param input Input temperature described using Kelvin .
95  @param output Returned temperature, converted to neutral unit.
96  */
97  void convertToNeutral(const TTValue& input, TTValue& output);
98 
99  /** Convert from neutral unit to Kelvin.
100  @param input Input temperature described using the neutral unit.
101  @param output Returned temperature, described using Kelvin.
102  */
103  void convertFromNeutral(const TTValue& input, TTValue& output);
104 };
105 
106 
107 #endif // __TEMPERATUREDATASPACE_H__
Converts temperatures to and from Kelvin.
void convertFromNeutral(const TTValue &input, TTValue &output)
Convert from neutral unit to Celsius.
void convertToNeutral(const TTValue &input, TTValue &output)
Convert from Celsius to neutral unit.
Converts temperatures to and from Celsius.
TTDataObjectBase is the base class for all data generating and processing objects.
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
Definition: TTFoundation.h:54
void convertToNeutral(const TTValue &input, TTValue &output)
Convert from Kelvin to neutral unit.
Specification for the base class of each DataspaceUnit.
void convertFromNeutral(const TTValue &input, TTValue &output)
Convert from neutral unit to Fahrenheit.
Specification for TTDataspace, the base class of each dataspace.
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
Base class for the temperature dataspace, provides dataspace support for converting temperatures betw...
Base class for each dataspace.
Definition: TTDataspace.h:30
Converts temperatures to and from Fahrenheit.
void convertFromNeutral(const TTValue &input, TTValue &output)
Convert from neutral unit to Kelvin.
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34
void convertToNeutral(const TTValue &input, TTValue &output)
Convert from Fahrenheit to neutral unit.