ConversionFamily

The ConversionFamily class is an internal class that provides a conversion by holding all of the conversion rules for a single family

Constructors

this
this()

Constructs a family with empty base unit and family name

this
this(string baseUnit, string family)

Constructs a family with the given base unit and family name

Members

Functions

addConversionRule
void addConversionRule(ConversionRule rule)

Adds a conversion rule to convertor

convert
LinearFunction convert(string inUnit, string outUnit)

Converts from in unit to out unit

convert
double convert(double value, string inUnit, string outUnit)

Converts a given value from in unit to out unit

Variables

m_baseUnit
string m_baseUnit;

Base unit for this family

m_family
string m_family;

Family name

m_rules
ConversionRule[string] m_rules;

Key is a unit, it's assumed that all rules have the same base unit

Meta