#include "WhUnit.hpp"
Public Member Functions | |
WhUnit (const WhExpnt &exponents=WhExpnt(), int scaleExponent=0, const std::string &prettyString="") | |
WhUnit (const std::string &scaleAbbreviation, const WhExpnt &exponents=WhExpnt(), const std::string &prettyString="") | |
virtual | ~WhUnit ()=default |
Related Functions | |
using | OptionalWhUnit = boost::optional< WhUnit > |
using | WhUnitVector = std::vector< WhUnit > |
WhUnit | createWhPower () |
WhUnit | createWhTime () |
WhUnit | createWhLength () |
WhUnit | createWhTemperature () |
WhUnit | createWhElectricCurrent () |
WhUnit | createWhLuminousIntensity () |
WhUnit | createWhAmountOfSubstance () |
WhUnit | createWhAngle () |
WhUnit | createWhSolidAngle () |
WhUnit | createWhPeople () |
WhUnit | createWhCycle () |
WhUnit | createWhCurrency () |
WhUnit | createWhEnergy () |
WhUnit | createWhElectricalPotential () |
WhUnit | createWhElectricResistance () |
WhUnit | createWhLuminousFlux () |
WhUnit | createWhIlluminance () |
WhUnit is a Unit with baseUnits W, h, m, K, and people.
setBaseUnitExponent throws and exception if any other string is passed in as a baseUnit. WhUnit.hpp declares related operators and UnitFactory callback functions.
openstudio::WhUnit::WhUnit | ( | const WhExpnt & | exponents = WhExpnt() , |
int | scaleExponent = 0 , |
||
const std::string & | prettyString = "" |
||
) |
Default constructor.
Example:
WhUnit myEnergy(WhExpnt(1,1),3,"Wh"); std::cout << myEnergy; // produces "kWh"
[in] | exponents | holds the exponents for each base unit. |
[in] | scaleExponent | exponent for scale. For instance 3 for kilo. |
[in] | prettyString | optional string to use in place of standardString. |
openstudio::WhUnit::WhUnit | ( | const std::string & | scaleAbbreviation, |
const WhExpnt & | exponents = WhExpnt() , |
||
const std::string & | prettyString = "" |
||
) |
Alternate constructor.
Specify the abbreviation of the scale, rather than its exponent. Example:
WhUnit myEnergy("k",WhExpnt(1,1),"Wh"); std::cout << myEnergy; // produces "kWh"
[in] | scaleAbbreviation | is string equal to a scale abbreviation. For instance "k" for kilo. |
[in] | exponents | holds the exponents for each base unit. |
[in] | prettyString | optional string to use in place of standardString. |
|
virtualdefault |
|
related |
|
related |
|
related |
|
related |
|
related |
Volt (V) = W/A.
|
related |
|
related |
Ohm (ohm) = V/A = W/A^2.
|
related |
|
related |
Lux (lux or lx) = lm/m^2 = cd*sr/m^2.
|
related |
|
related |
Lumen (lm) = cd*sr.
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |
|
related |