EPANET-RTX
1.1
real-time extension for the EPANET toolkit
|
Keep track of dimensions and units of measure. More...
#include <Units.h>
Public Member Functions | |
Units (double conversion=1., int mass=0, int length=0, int time=0, int current=0, int temperature=0, int amount=0, int intensity=0, double offset=0) | |
Create a new Units object with the specified dimensions and conversion factor. More... | |
Units | operator* (const Units &unit) const |
Units | operator/ (const Units &unit) const |
bool | operator== (const Units &unit) const |
bool | isSameDimensionAs (const Units &unit) const |
bool | isDimensionless () |
double | conversion () const |
std::string | unitString () |
virtual std::ostream & | toStream (std::ostream &stream) |
Static Public Member Functions | |
static double | convertValue (double value, const Units &fromUnits, const Units &toUnits) |
static Units | unitOfType (const std::string &unitString) |
static std::map< std::string, Units > | unitStringMap () |
Keep track of dimensions and units of measure.
In general, any unit can be expressed as a set of mutually independent exponent factors of the quantities listed below. We shall support all of the seven (7) exponents, even though we expect to never use the candela, but why limit the future, right?
RTX::Units::Units | ( | double | conversion = 1. , |
int | mass = 0 , |
||
int | length = 0 , |
||
int | time = 0 , |
||
int | current = 0 , |
||
int | temperature = 0 , |
||
int | amount = 0 , |
||
int | intensity = 0 , |
||
double | offset = 0 |
||
) |