UOM::CONVERTER Class Reference

#include <mi32/uom.h>

List of all members.

Public Member Functions

 CONVERTER (const MEASURE &measure)
 CONVERTER (const CONVERTER &rhs)
 CONVERTER ()
 ~CONVERTER ()
ERRVALUE ConvertForward (const MISTRING &instr, MISTRING &outstr) const
ERRVALUE ConvertForward (double inval, MISTRING &outstr) const
ERRVALUE ConvertForward (const MISTRING &instr, double &outval) const
double ConvertForward (double value) const
ERRVALUE ConvertInverse (const MISTRING &instr, MISTRING &outstr) const
ERRVALUE ConvertInverse (double inval, MISTRING &outstr) const
ERRVALUE ConvertInverse (const MISTRING &instr, double &outval) const
double ConvertInverse (double value) const
const MEASUREGetMeasure () const
double GetScale () const
const UNITGetSourceUnit () const
const UNITGetTargetUnit () const
void IniReadSource (INIHANDLE IniHandle, const char *IniGroup, const char *IniName, int micode=0)
void IniReadTarget (INIHANDLE IniHandle, const char *IniGroup, const char *IniName, int micode=0)
void IniWriteSource (INIHANDLE IniHandle, const char *IniGroup, const char *IniName) const
void IniWriteTarget (INIHANDLE IniHandle, const char *IniGroup, const char *IniName) const
CONVERTERoperator= (const CONVERTER &rhs)
ERRVALUE SetSourceUnit (const UNIT &SourceUnit)
ERRVALUE SetTargetUnit (const UNIT &TargetUnit)
ERRVALUE SetUnits (const UNIT &SourceUnit, const UNIT &TargetUnit)

Constructor & Destructor Documentation

UOM::CONVERTER::CONVERTER (  ) 

Default constructor.

UOM::CONVERTER::CONVERTER ( const CONVERTER rhs  ) 

Copy constructor.

UOM::CONVERTER::CONVERTER ( const MEASURE measure  ) 

Identity constructor.

UOM::CONVERTER::~CONVERTER (  ) 

Destructor.


Member Function Documentation

ERRVALUE UOM::CONVERTER::ConvertForward ( const MISTRING instr,
MISTRING outstr 
) const

Convert string in source unit to string in target unit.

Parameters:
instr String in source unit to convert
outstr String in target unit returned
ERRVALUE UOM::CONVERTER::ConvertForward ( double  inval,
MISTRING outstr 
) const

Convert numeric value in source unit to string in target unit.

If source unit requires a string representation an error will be returned.

Parameters:
inval Value in source unit to convert
outstr String in target unit returned
ERRVALUE UOM::CONVERTER::ConvertForward ( const MISTRING instr,
double &  outval 
) const

Convert string in source unit to numeric value in target unit.

If target unit requires a string representation an error will be returned.

Parameters:
instr String in source unit to convert
outval Value in target unit returned
double UOM::CONVERTER::ConvertForward ( double  value  )  const

Convert numeric value from source unit to target unit.

If either source or target unit requires a string representation the original value will be returned.

Returns:
Converted value.
Parameters:
value Value in source unit to convert
ERRVALUE UOM::CONVERTER::ConvertInverse ( const MISTRING instr,
MISTRING outstr 
) const

Convert string in target unit to string in source unit.

Parameters:
instr String in target unit to convert
outstr String in source unit returned
ERRVALUE UOM::CONVERTER::ConvertInverse ( double  inval,
MISTRING outstr 
) const

Convert numeric value in target unit to string in source unit.

If target unit requires a string representation an error will be returned.

Parameters:
inval Value in target unit to convert
outstr String in source unit returned
ERRVALUE UOM::CONVERTER::ConvertInverse ( const MISTRING instr,
double &  outval 
) const

Convert string in target unit to numeric value in source unit.

If source unit requires a string representation an error will be returned.

Parameters:
instr String in target unit to convert
outval Value in source unit returned
double UOM::CONVERTER::ConvertInverse ( double  value  )  const

Convert numeric value from target unit to source unit.

If either target or source unit requires a string representation the original value will be returned.

Returns:
Converted value.
Parameters:
value Value in target unit to convert
const MEASURE& UOM::CONVERTER::GetMeasure (  )  const

Get measure associated with converter.

double UOM::CONVERTER::GetScale (  )  const

Get scale multiplication value from source to target.

const UNIT& UOM::CONVERTER::GetSourceUnit (  )  const

Get source unit.

const UNIT& UOM::CONVERTER::GetTargetUnit (  )  const

Get target unit.

void UOM::CONVERTER::IniReadSource ( INIHANDLE  IniHandle,
const char *  IniGroup,
const char *  IniName,
int  micode = 0 
)

Read source unit from INI file.

Target unit will be left unchanged.

Parameters:
micode Default unit code
void UOM::CONVERTER::IniReadTarget ( INIHANDLE  IniHandle,
const char *  IniGroup,
const char *  IniName,
int  micode = 0 
)

Read target unit from INI file.

Source unit will be left unchanged.

Parameters:
micode Default unit code
void UOM::CONVERTER::IniWriteSource ( INIHANDLE  IniHandle,
const char *  IniGroup,
const char *  IniName 
) const

Write source unit code to INI file.

void UOM::CONVERTER::IniWriteTarget ( INIHANDLE  IniHandle,
const char *  IniGroup,
const char *  IniName 
) const

Write target unit code to INI file.

CONVERTER& UOM::CONVERTER::operator= ( const CONVERTER rhs  ) 

Assignment.

ERRVALUE UOM::CONVERTER::SetSourceUnit ( const UNIT SourceUnit  ) 

Set source unit.

If the current measure is of TYPE_None it will be set to the measure of the specified unit. Otherwise, an error will be returned if the unit does not refer to the current measure.

ERRVALUE UOM::CONVERTER::SetTargetUnit ( const UNIT TargetUnit  ) 

Set target unit.

If the current measure is of TYPE_None it will be set to the measure of the specified unit. Otherwise, an error will be returned if the unit does not refer to the current measure.

ERRVALUE UOM::CONVERTER::SetUnits ( const UNIT SourceUnit,
const UNIT TargetUnit 
)

Set both source and target units.

An error will be returned if the specified units do not refer to the same MEASURE.


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

Generated on Sun Oct 7 21:40:31 2012 for TNTsdk 2012 by  doxygen 1.6.1