Main Page | Class Hierarchy | Class List | File List | Class Members | Related Pages

Units< M, L, T, K, I > Class Template Reference

Unit Checking/tracking Class. More...

#include <units.h>

List of all members.

Public Member Functions

 Units (const Units &u)
const Unitsoperator= (const Units &u)
Units operator * (double d) const
Units operator/ (double d) const
const Unitsoperator *= (double d)
const Unitsoperator/= (double d)
Units operator+ (const Units &u) const
Units operator- (const Units &u) const
Unitsoperator+= (const Units &u)
Unitsoperator-= (const Units &u)
Units operator- () const
bool operator== (const Units &u) const
 Equality.
bool operator!= (const Units &u) const
 Inequality.
bool operator< (const Units &u) const
 Less-than.
bool operator<= (const Units &u) const
 Less-or-equal.
bool operator> (const Units &u) const
 Greater-than.
bool operator>= (const Units &u) const
 Greater-or-equal.
 operator double () const
 Cast to double.
template<int m, int l, int t, int k, int i> Units< M-m, L-l, T-t, K-k,
I-i > 
operator/ (const Units< m, l, t, k, i > &u2) const
 Division.


Detailed Description

template<int M, int L = 0, int T = 0, int K = 0, int I = 0>
class Units< M, L, T, K, I >

Unit Checking/tracking Class.

Purpose: Template class to create a 'Units' data type.

Original Author: Christopher Rettig ( rettigcd@bigfoot.com )
(This is not the original version)

Dev platform: . Win2k -- gcc version 3.3.1 (cygming special)

Tested on: . NT4.0 -- VC++ 6.0 . Win2k -- gcc version 3.2.3 (mingw special 20030504-1) . Linux -- gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)

Todo:
Get the units stuff working with a specific units-tracking flag. Should be possible to say that all pressures get output in MPa, all temperatures in °C, etc etc.
See also:
http://www.embedded.com/shared/printableArticle.jhtml?articleID=9900094
http://www.embedded.com/code/2001code.htm
http://www.experts-exchange.com/Programming/Programming_Languages/Cplusplus/Q_21215508.html
http://www.experts-exchange.com/Programming/Programming_Languages/Cplusplus/Q_21199495.html


Member Function Documentation

template<int M, int L = 0, int T = 0, int K = 0, int I = 0>
Units< M, L, T, K, I >::operator double  )  const [inline]
 

Cast to double.

Only defined for dimensionless values!


The documentation for this class was generated from the following file:
Generated on Tue Mar 22 19:07:07 2005 for freesteam by doxygen 1.3.8