EPANET-RTX  1.1
real-time extension for the EPANET toolkit
Public Member Functions | Static Public Member Functions | List of all members
RTX::Units Class Reference

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 ()
 

Detailed Description

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?

Constructor & Destructor Documentation

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 
)

Create a new Units object with the specified dimensions and conversion factor.

The default dimensional exponents are all zero (0), which means dimensionless. See Units.h for some predefined units of measure.


The documentation for this class was generated from the following files: