|
|
| FahrenheitUnit (int FExp=0, int scaleExponent=0, const std::string &prettyString="") |
| Default constructor creates an absolute temperature. More...
|
|
| FahrenheitUnit (const std::string &scaleAbbreviation, int FExp=0, const std::string &prettyString="") |
| Alternate constructor creates an absolute temperature. More...
|
|
virtual | ~FahrenheitUnit () |
|
|
FahrenheitUnit & | operator/= (const FahrenheitUnit &rUnit) |
|
virtual | ~TemperatureUnit () |
|
bool | isAbsolute () const |
|
void | setAsAbsolute () |
|
void | setAsRelative () |
|
| Unit (int scaleExponent=0, const std::string &prettyString="") |
| Default constructor. More...
|
|
| Unit (const std::string &scaleAbbreviation, const std::string &prettyString="") |
| Constructor using scale abbreviations registered in ScaleFactory. More...
|
|
virtual | ~Unit () |
|
Unit | clone () const |
| Deep copy constructor. More...
|
|
Unit | cloneToMixed () const |
| Deep copy constructor that discards system designation. More...
|
|
std::vector< std::string > | baseUnits () const |
| Returns base units already available in Unit. More...
|
|
bool | isBaseUnit (const std::string &baseUnit) const |
| Returns true if baseUnit is available in Unit. More...
|
|
int | baseUnitExponent (const std::string &baseUnit) const |
| Base unit exponent getter. Returns 0 if baseUnit not present. */. More...
|
|
void | setBaseUnitExponent (const std::string &baseUnit, int exponent) |
| Sets baseUnit^exponent. If baseUnit not yet present, is added and return value is true. More...
|
|
const Scale & | scale () const |
| Scale getter. More...
|
|
bool | setScale (int scaleExponent) |
| Sets the scale to the one registered in ScaleFactory for 10^scaleExponent. More...
|
|
bool | setScale (const std::string &scaleAbbreviation) |
| Sets the scale to the one registered in ScaleFactory under scaleAbbreviation. More...
|
|
std::string | standardString (bool withScale=true) const |
| Returns the standard output string for this unit. More...
|
|
std::string | prettyString (bool withScale=true) const |
| Returns the preferred output string for this unit. More...
|
|
void | setPrettyString (const std::string &str) |
| Setter for prettyString (do not include scale abbreviation). More...
|
|
std::string | print (bool withScale=true) const |
| Returns prettyString(withScale) if it exists; otherwise returns standardString(withScale). More...
|
|
UnitSystem | system () const |
| Getter for this Unit's system. More...
|
|
bool | operator== (const Unit &rUnit) const |
| Equality for units. More...
|
|
Unit & | operator*= (const Unit &rUnit) |
| Multiply-assign operator. More...
|
|
Unit & | operator/= (const Unit &rUnit) |
| Divide-assign operator. More...
|
|
Unit & | pow (int expNum, int expDenom=1, bool okToCallFactory=true) |
| Raise Unit to a rational power. More...
|
|
template<typename T > |
T | cast () const |
| Cast to type T. More...
|
|
template<typename T > |
boost::optional< T > | optionalCast () const |
| Cast to boost::optional<T>. More...
|
|
FahrenheitUnit is a TemperatureUnit that supports absolute temperatures in degrees Fahrenheit.
Rankine and Fahrenheit are the same in situations of relative temperature, that is, when it is the difference in temperatures that matter, rather than the absolute value. This is normally the case when the temperature base unit shows up in combination with other units, and that is not the situation being addressed here. This class is for reporting actual temperatures in degrees Fahrenheit. Printing out R's as F's in the former situation is a feature that may be added to this library at a later date.