antioch-0.4.0
|
Class to deal with the conversion between units. More...
#include <converter.h>
Public Member Functions | |
Converter () | |
Default constructor, defaults values are (1.,0.) More... | |
Converter (const T &coef, const T &trans) | |
Constructor. More... | |
template<typename P > | |
Converter (const Converter< P > &rhs) | |
Copy constructor, uses Converter & operator=(const Converter&) More... | |
~Converter () | |
Default constructor. More... | |
template<typename P = T> | |
const P | geta () const |
Multiplicative factor getter. More... | |
template<typename P = T> | |
const P | getb () const |
Translationnal factor getter. More... | |
void | clear () |
Set the values to (1.,0.) More... | |
template<typename P > | |
bool | operator== (const Converter< P > &rhs) const |
Comparison operator, equal if the two values are equal. More... | |
template<typename P > | |
bool | operator!= (const Converter< P > &rhs) const |
Comparison operator, not equal is not "equal". More... | |
template<typename P > | |
Converter & | operator= (const Converter< P > &rhs) |
Assignement operator, equalize the two values. More... | |
template<typename P > | |
Converter & | operator*= (const Converter< P > &rhs) |
Multiplying operator. More... | |
template<typename P > | |
Converter & | operator/= (const Converter< P > &rhs) |
Dividing operator. More... | |
template<typename P > | |
Converter & | operator+= (const Converter< P > &rhs) |
Adding operator. More... | |
template<typename P > | |
Converter | operator/ (const Converter< P > &rhs) const |
Dividing operator, same operations as Converter &operator/=(const Converter&) More... | |
template<typename P > | |
Converter | operator* (const Converter< P > &rhs) const |
Multiplying operator, same operations as Converter &operator*=(const Converter&) More... | |
template<typename P > | |
Converter & | operator*= (const P &coef) |
Multiplying operator with a scalar, only multiply the multiplicative value. More... | |
template<typename P > | |
Converter & | operator/= (const P &coef) |
Dividing operator with a double, only divide the multiplicative value. More... | |
template<typename P > | |
Converter | operator* (const P &coef) const |
Multiplying operator with a scalar, only multiply the multiplicative value. More... | |
template<typename P > | |
Converter | operator/ (const P &coef) const |
Dividing operator with a scalar, only divide the multiplicative value. More... | |
template<typename P > | |
Converter< T > & | operator= (const Converter< P > &rhs) |
template<typename P > | |
Converter< T > & | operator*= (const P &coef) |
template<typename P > | |
Converter< T > & | operator/= (const P &coef) |
template<typename P > | |
Converter< T > & | operator*= (const Converter< P > &rhs) |
template<typename P > | |
Converter< T > & | operator/= (const Converter< P > &rhs) |
template<typename P > | |
Converter< T > & | operator+= (const Converter< P > &rhs) |
template<typename P > | |
Converter< T > | operator* (const P &coef) const |
template<typename P > | |
Converter< T > | operator/ (const P &coef) const |
template<typename P > | |
Converter< T > | operator/ (const Converter< P > &rhs) const |
template<typename P > | |
Converter< T > | operator* (const Converter< P > &rhs) const |
Private Attributes | |
T | a |
Two double for a multiplicative and translationnal part of a coefficient. More... | |
T | b |
Friends | |
std::ostream & | operator<< (std::ostream &out, const Converter< T > &rhs) |
<< operator, to show the coef as a complex number (a,b) More... | |
Class to deal with the conversion between units.
This class keeps track of the conversion factor between the unit and the base unit. To be general, this is a couple of double, one for the multiplication part and another one for the translationnal part (mainly for temperature, but it should not be used).
Definition at line 47 of file converter.h.
|
inline |
|
inline |
Constructor.
Definition at line 156 of file converter.h.
References Antioch::constant_clone().
|
inline |
Copy constructor, uses Converter & operator=(const Converter&)
Definition at line 55 of file converter.h.
|
inline |
|
inline |
Set the values to (1.,0.)
Definition at line 66 of file converter.h.
References Antioch::Converter< T >::a, Antioch::Converter< T >::b, and Antioch::set_zero().
|
inline |
Multiplicative factor getter.
Definition at line 61 of file converter.h.
References Antioch::Converter< T >::a.
Referenced by Antioch::Converter< T >::operator*(), Antioch::Converter< T >::operator*=(), Antioch::Converter< T >::operator+=(), Antioch::Converter< T >::operator/(), Antioch::Converter< T >::operator/=(), Antioch::Converter< T >::operator=(), and Antioch::Units< T >::raise().
|
inline |
Translationnal factor getter.
Definition at line 64 of file converter.h.
References Antioch::Converter< T >::b.
Referenced by Antioch::Converter< T >::operator*(), Antioch::Converter< T >::operator*=(), Antioch::Converter< T >::operator+=(), Antioch::Converter< T >::operator/(), Antioch::Converter< T >::operator/=(), Antioch::Converter< T >::operator=(), and Antioch::Units< T >::raise().
|
inline |
Comparison operator, not equal is not "equal".
Definition at line 80 of file converter.h.
Converter Antioch::Converter< T >::operator* | ( | const Converter< P > & | rhs | ) | const |
Multiplying operator, same operations as Converter &operator*=(const Converter&)
Converter Antioch::Converter< T >::operator* | ( | const P & | coef | ) | const |
Multiplying operator with a scalar, only multiply the multiplicative value.
|
inline |
Definition at line 226 of file converter.h.
|
inline |
Definition at line 250 of file converter.h.
References Antioch::Converter< T >::geta(), and Antioch::Converter< T >::getb().
Converter& Antioch::Converter< T >::operator*= | ( | const Converter< P > & | rhs | ) |
Multiplying operator.
The operations performed for the mutiplication of (a,b) and (c,d) are:
Converter& Antioch::Converter< T >::operator*= | ( | const P & | coef | ) |
Multiplying operator with a scalar, only multiply the multiplicative value.
|
inline |
Definition at line 178 of file converter.h.
|
inline |
Definition at line 196 of file converter.h.
References Antioch::Converter< T >::geta(), and Antioch::Converter< T >::getb().
Converter& Antioch::Converter< T >::operator+= | ( | const Converter< P > & | rhs | ) |
Adding operator.
The operations performed for the addition of (a,b) and (c,d) are:
|
inline |
Definition at line 216 of file converter.h.
References Antioch::Converter< T >::geta(), and Antioch::Converter< T >::getb().
Converter Antioch::Converter< T >::operator/ | ( | const Converter< P > & | rhs | ) | const |
Dividing operator, same operations as Converter &operator/=(const Converter&)
Converter Antioch::Converter< T >::operator/ | ( | const P & | coef | ) | const |
Dividing operator with a scalar, only divide the multiplicative value.
|
inline |
Definition at line 234 of file converter.h.
|
inline |
Definition at line 242 of file converter.h.
References Antioch::Converter< T >::geta(), and Antioch::Converter< T >::getb().
Converter& Antioch::Converter< T >::operator/= | ( | const Converter< P > & | rhs | ) |
Dividing operator.
The operations performed for the division of (a,b) and (c,d) are:
Converter& Antioch::Converter< T >::operator/= | ( | const P & | coef | ) |
Dividing operator with a double, only divide the multiplicative value.
|
inline |
Definition at line 187 of file converter.h.
|
inline |
Definition at line 206 of file converter.h.
References Antioch::Converter< T >::geta(), and Antioch::Converter< T >::getb().
Converter& Antioch::Converter< T >::operator= | ( | const Converter< P > & | rhs | ) |
Assignement operator, equalize the two values.
|
inline |
Definition at line 167 of file converter.h.
References Antioch::constant_clone(), Antioch::Converter< T >::geta(), and Antioch::Converter< T >::getb().
bool Antioch::Converter< T >::operator== | ( | const Converter< P > & | rhs | ) | const |
Comparison operator, equal if the two values are equal.
|
friend |
<< operator, to show the coef as a complex number (a,b)
Definition at line 69 of file converter.h.
|
private |
Two double for a multiplicative and translationnal part of a coefficient.
Definition at line 141 of file converter.h.
Referenced by Antioch::Converter< T >::clear(), and Antioch::Converter< T >::geta().
|
private |
Definition at line 142 of file converter.h.
Referenced by Antioch::Converter< T >::clear(), and Antioch::Converter< T >::getb().