47 #ifndef OME_COMMON_UNITS_TEMPERATURE_H
48 #define OME_COMMON_UNITS_TEMPERATURE_H
50 #include <ome/common/config.h>
51 #include <ome/common/units/types.h>
53 #include <boost/units/base_units/si/kelvin.hpp>
54 #include <boost/units/base_units/temperature/celsius.hpp>
55 #include <boost/units/base_units/temperature/fahrenheit.hpp>
56 #include <boost/units/unit.hpp>
57 #include <boost/units/quantity.hpp>
58 #include <boost/units/systems/si.hpp>
70 typedef si::temperature temperature_unit;
72 typedef quantity<si::temperature> temperature_quantity;
75 typedef boost::units::si::kelvin_base_unit::unit_type kelvin_unit;
77 BOOST_UNITS_STATIC_CONSTANT(kelvin, kelvin_unit);
79 BOOST_UNITS_STATIC_CONSTANT(kelvins, kelvin_unit);
81 typedef quantity<kelvin_unit> kelvin_quantity;
84 typedef boost::units::temperature::celsius_base_unit::unit_type celsius_unit;
86 BOOST_UNITS_STATIC_CONSTANT(celsius, celsius_unit);
88 typedef quantity<celsius_unit> celsius_quantity;
91 typedef boost::units::temperature::fahrenheit_base_unit::unit_type fahrenheit_unit;
93 BOOST_UNITS_STATIC_CONSTANT(fahrenheit, fahrenheit_unit);
95 typedef quantity<fahrenheit_unit> fahrenheit_quantity;
99 boost::units::temperature_dimension, 4> { };
101 typedef rankine_base_unit::unit_type rankine_unit;
103 BOOST_UNITS_STATIC_CONSTANT(rankine, rankine_unit);
105 typedef quantity<rankine_unit> rankine_quantity;
108 typedef boost::units::absolute<kelvin_unit> kelvin_absolute_unit;
110 BOOST_UNITS_STATIC_CONSTANT(kelvin_absolute, kelvin_absolute_unit);
112 BOOST_UNITS_STATIC_CONSTANT(kelvins_absolute, kelvin_absolute_unit);
114 typedef quantity<kelvin_absolute_unit> kelvin_absolute_quantity;
117 typedef boost::units::absolute<celsius_unit> celsius_absolute_unit;
119 BOOST_UNITS_STATIC_CONSTANT(celsius_absolute, celsius_absolute_unit);
121 typedef quantity<celsius_absolute_unit> celsius_absolute_quantity;
124 typedef boost::units::absolute<fahrenheit_unit> fahrenheit_absolute_unit;
126 BOOST_UNITS_STATIC_CONSTANT(fahrenheit_absolute, fahrenheit_absolute_unit);
128 typedef quantity<fahrenheit_absolute_unit> fahrenheit_absolute_quantity;
131 typedef boost::units::absolute<rankine_unit> rankine_absolute_unit;
133 BOOST_UNITS_STATIC_CONSTANT(rankine_absolute, rankine_absolute_unit);
135 typedef quantity<rankine_absolute_unit> rankine_absolute_quantity;
154 template<>
struct base_unit_info<
ome::common::units::rankine_base_unit>
157 static std::string
name() {
return "rankine"; }
159 static std::string
symbol() {
return "R"; }
165 #endif // OME_COMMON_UNITS_TEMPERATURE_H
static std::string symbol()
Unit symbol.
Definition: temperature.h:159
Base unit for temperature in Rankine.
Definition: temperature.h:98
Open Microscopy Environment C++ implementation.
Definition: CoreMetadata.cpp:40
BOOST_UNITS_DEFINE_CONVERSION_OFFSET(ome::common::units::rankine_base_unit, boost::units::si::kelvin_base_unit, double, 0.0)
Conversion offset for Rankine to kelvin.
BOOST_UNITS_DEFINE_CONVERSION_FACTOR(ome::common::units::rankine_base_unit, boost::units::si::kelvin_base_unit, double, 5.0/9.0)
Conversion factor for Rankine to kelvin.
BOOST_UNITS_DEFAULT_CONVERSION(ome::common::units::rankine_base_unit, boost::units::si::kelvin_base_unit)
Default conversion for Rankine is to SI temperature units (kelvin).
static std::string name()
Unit name.
Definition: temperature.h:157