34 #include <boost/algorithm/string/case_conv.hpp>
41 m_description(description),
48 m_name = boost::to_upper_copy(name);
53 double A,
double B,
double C ,
double D,
54 const std::string& description)
58 m_description(description),
59 m_baseUnitId(baseUnitId),
67 m_name = boost::to_upper_copy(name);
86 m_description = description;
106 return (m_id == m_baseUnitId);
126 return ((m_a + m_b) / (m_c + m_d));
131 double convf = (m_a + m_b) / (m_c + m_d);
134 wkt += this->getName();
136 std::ostringstream sstr;
~UnitOfMeasure()
Destructor.
MeasureType getType() const
Returns the unit of measure type.
UnitOfMeasure(unsigned int id, const std::string &name, const std::string &symbol, MeasureType type, const std::string &description="")
Creates a new base unit of measure.
void getConversionFactors(double &A, double &B, double &C, double &D) const
Returns the conversion factors to convert the unit to its base unit.
unsigned int getId() const
Returns the unit of measure identification.
const std::string & getDescription() const
Returns the unit of measure description.
const std::string & getName() const
Returns the unit of measure oficial name.
A class for representing a unit of measure.
void setDescription(const std::string &description)
Sets the unit of measure description.
const std::string & getSymbol() const
Returns the unit of measure symbol.
MeasureType
Defines the possible types of unit of measurements.
std::string m_name
unit of measure name according to SI.
double getConversionValue() const
Returns a multiplicative value to convert the unit to its base unit.
const unsigned int getBaseUnitId() const
Returns the base unit id from which this unit derives of.
bool isBaseUnit() const
Returns true if this is a base unit; otherwise returns false.
std::string getWKT() const
Returns the WKT description of a unit of measure.