Version: 5.1.6

INTERP_KERNEL.Unit Class Reference

#include <InterpKernelUnit.hxx>

Public Member Functions

 Unit (const char *reprC, bool tryToInterp=true)
 Unit (const char *reprFortran, int sizeOfRepr, bool tryToInterp=true)
void tryToInterprate () const
bool isInterpretationOK () const
bool isCompatibleWith (const Unit &other) const
double convert (const Unit &target, double sourceVal) const
std::string getCoarseRepr () const

Private Attributes

std::string _coarse_repr
bool _is_interpreted
bool _is_interpretation_ok
DecompositionInUnitBase _decomp_in_base

Detailed Description

This class deals with units. This class has two main responsabilities :

All the possible units are represented with a unique tuple with 5 elements representing the unique decomposition of a unit in the following base.

dimension 0 stands for mass in g (NOT kg to simplify parsing). dimension 1 stands for length in m. dimension 2 stands for time in s. dimension 3 stands for elec intensity A. dimension 4 stands for temperature in K.

Constructor & Destructor Documentation

Unit::Unit ( const char *  reprC,
bool  tryToInterp = true 
Unit::Unit ( const char *  reprFortran,
int  sizeOfRepr,
bool  tryToInterp = true 

Member Function Documentation

void Unit::tryToInterprate (  )  const
bool Unit::isInterpretationOK (  )  const
bool Unit::isCompatibleWith ( const Unit other  )  const
double Unit::convert ( const Unit target,
double  sourceVal 
) const
std::string Unit::getCoarseRepr (  )  const

Field Documentation

std::string INTERP_KERNEL.Unit._coarse_repr [private]
bool INTERP_KERNEL.Unit._is_interpreted [mutable, private]