20 #define thisTTClass CelsiusUnit
21 #define thisTTClassName "unit.celsius"
22 #define thisTTClassTags "dataspace.unit, temperature"
28 CelsiusUnit::~CelsiusUnit(){;}
47 #undef thisTTClassName
48 #undef thisTTClassTags
52 #define thisTTClass FahrenheitUnit
53 #define thisTTClassName "unit.fahrenheit"
54 #define thisTTClassTags "dataspace.unit, temperature"
60 FahrenheitUnit::~FahrenheitUnit(){;}
66 output = (
TTFloat64(input) + 459.67) / 1.8;
79 #undef thisTTClassName
80 #undef thisTTClassTags
84 #define thisTTClass KelvinUnit
85 #define thisTTClassName "unit.kelvin"
86 #define thisTTClassTags "dataspace.unit, temperature"
92 KelvinUnit::~KelvinUnit(){;}
107 #undef thisTTClassName
108 #undef thisTTClassTags
112 #define thisTTClass TemperatureDataspace
113 #define thisTTClassName "dataspace.temperature"
114 #define thisTTClassTags "foundationDataspaceLib, dataspace, temperature"
119 registerUnit(
TT(
"unit.celsius"),
TT(
"C"));
120 registerUnit(
TT(
"unit.celsius"),
TT(
"Celsius"));
121 registerUnit(
TT(
"unit.fahrenheit"),
TT(
"F"));
122 registerUnit(
TT(
"unit.fahrenheit"),
TT(
"Fahrenheit"));
123 registerUnit(
TT(
"unit.kelvin"),
TT(
"K"));
124 registerUnit(
TT(
"unit.kelvin"),
TT(
"Kelvin"));
127 neutralUnit =
TT(
"Kelvin");
130 setInputUnit(neutralUnit);
131 setOutputUnit(neutralUnit);
135 TemperatureDataspace::~TemperatureDataspace()
141 #undef thisTTClassName
142 #undef thisTTClassTags
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.
double TTFloat64
64 bit floating point number
#define TT
This macro is defined as a shortcut for doing a lookup in the symbol table.
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.
void convertFromNeutral(const TTValue &input, TTValue &output)
Convert from neutral unit to Kelvin.
TT_OBJECT_CONSTRUCTOR
Constructor macro.
[doxygenAppendixC_copyExample]
void convertToNeutral(const TTValue &input, TTValue &output)
Convert from Fahrenheit to neutral unit.
The TemperatureDataspace converts between different measurement untis describing temperature.