FougTools  0.7.0dev-046fb6a
Handy tools for C++, Qt and OpenCascade
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Related Functions | List of all members
cpp::Quantity< NUMERIC_TRAITS, TRAIT > Class Template Reference

Represents an amount of a certain unit. More...

#include <cpptools/quantity.h>

Public Types

typedef NUMERIC_TRAITS::Type NumericType
 
typedef Quantity
< NUMERIC_TRAITS, TRAIT > 
QuantityType
 

Public Member Functions

 Quantity ()
 
 Quantity (NumericType v)
 
 Quantity (const QuantityType &other)
 
NumericType value () const
 
void setValue (NumericType v)
 
QuantityTypeoperator= (const QuantityType &other)
 
QuantityTypeoperator+= (const QuantityType &other)
 
QuantityTypeoperator-= (const QuantityType &other)
 
QuantityTypeoperator*= (const QuantityType &other)
 
QuantityTypeoperator/= (const QuantityType &other)
 
QuantityTypeoperator+= (NumericType v)
 
QuantityTypeoperator-= (NumericType v)
 
QuantityTypeoperator*= (NumericType v)
 
QuantityTypeoperator/= (NumericType v)
 

Related Functions

(Note that these are not member functions.)

template<typename NUMERIC_TRAITS , typename TRAIT >
bool operator< (const Quantity< NUMERIC_TRAITS, TRAIT > &lhs, const Quantity< NUMERIC_TRAITS, TRAIT > &rhs)
 
template<typename NUMERIC_TRAITS , typename TRAIT >
bool operator> (const Quantity< NUMERIC_TRAITS, TRAIT > &lhs, const Quantity< NUMERIC_TRAITS, TRAIT > &rhs)
 
template<typename NUMERIC_TRAITS , typename TRAIT >
const Quantity< NUMERIC_TRAITS,
TRAIT > 
operator+ (const Quantity< NUMERIC_TRAITS, TRAIT > &lhs, const Quantity< NUMERIC_TRAITS, TRAIT > &rhs)
 
template<typename NUMERIC_TRAITS , typename TRAIT >
const Quantity< NUMERIC_TRAITS,
TRAIT > 
operator+ (const Quantity< NUMERIC_TRAITS, TRAIT > &lhs, typename NUMERIC_TRAITS::Type k)
 
template<typename NUMERIC_TRAITS , typename TRAIT >
const Quantity< NUMERIC_TRAITS,
TRAIT > 
operator+ (typename NUMERIC_TRAITS::Type k, const Quantity< NUMERIC_TRAITS, TRAIT > &rhs)
 
template<typename NUMERIC_TRAITS , typename TRAIT >
const Quantity< NUMERIC_TRAITS,
TRAIT > 
operator- (const Quantity< NUMERIC_TRAITS, TRAIT > &lhs, const Quantity< NUMERIC_TRAITS, TRAIT > &rhs)
 
template<typename NUMERIC_TRAITS , typename TRAIT >
const Quantity< NUMERIC_TRAITS,
TRAIT > 
operator- (const Quantity< NUMERIC_TRAITS, TRAIT > &lhs, typename NUMERIC_TRAITS::Type k)
 
template<typename NUMERIC_TRAITS , typename TRAIT >
const Quantity< NUMERIC_TRAITS,
TRAIT > 
operator- (typename NUMERIC_TRAITS::Type k, const Quantity< NUMERIC_TRAITS, TRAIT > &rhs)
 
template<typename NUMERIC_TRAITS , typename TRAIT >
const Quantity< NUMERIC_TRAITS,
TRAIT > 
operator* (const Quantity< NUMERIC_TRAITS, TRAIT > &lhs, const Quantity< NUMERIC_TRAITS, TRAIT > &rhs)
 
template<typename NUMERIC_TRAITS , typename TRAIT >
const Quantity< NUMERIC_TRAITS,
TRAIT > 
operator* (const Quantity< NUMERIC_TRAITS, TRAIT > &lhs, typename NUMERIC_TRAITS::Type k)
 
template<typename NUMERIC_TRAITS , typename TRAIT >
const Quantity< NUMERIC_TRAITS,
TRAIT > 
operator* (typename NUMERIC_TRAITS::Type k, const Quantity< NUMERIC_TRAITS, TRAIT > &rhs)
 
template<typename NUMERIC_TRAITS , typename TRAIT >
const Quantity< NUMERIC_TRAITS,
TRAIT > 
operator/ (const Quantity< NUMERIC_TRAITS, TRAIT > &lhs, const Quantity< NUMERIC_TRAITS, TRAIT > &rhs)
 
template<typename NUMERIC_TRAITS , typename TRAIT >
const Quantity< NUMERIC_TRAITS,
TRAIT > 
operator/ (const Quantity< NUMERIC_TRAITS, TRAIT > &lhs, typename NUMERIC_TRAITS::Type k)
 
template<typename NUMERIC_TRAITS , typename TRAIT >
const Quantity< NUMERIC_TRAITS,
TRAIT > 
operator/ (typename NUMERIC_TRAITS::Type k, const Quantity< NUMERIC_TRAITS, TRAIT > &rhs)
 

Detailed Description

template<typename NUMERIC_TRAITS, typename TRAIT = void>
class cpp::Quantity< NUMERIC_TRAITS, TRAIT >

Represents an amount of a certain unit.

Member Typedef Documentation

template<typename NUMERIC_TRAITS, typename TRAIT = void>
typedef NUMERIC_TRAITS::Type cpp::Quantity< NUMERIC_TRAITS, TRAIT >::NumericType
template<typename NUMERIC_TRAITS, typename TRAIT = void>
typedef Quantity<NUMERIC_TRAITS, TRAIT> cpp::Quantity< NUMERIC_TRAITS, TRAIT >::QuantityType

Constructor & Destructor Documentation

template<typename NUMERIC_TRAITS , typename TRAIT >
cpp::Quantity< NUMERIC_TRAITS, TRAIT >::Quantity ( )
template<typename NUMERIC_TRAITS , typename TRAIT >
cpp::Quantity< NUMERIC_TRAITS, TRAIT >::Quantity ( NumericType  v)
explicit
template<typename NUMERIC_TRAITS , typename TRAIT >
cpp::Quantity< NUMERIC_TRAITS, TRAIT >::Quantity ( const QuantityType other)

Member Function Documentation

template<typename NUMERIC_TRAITS , typename TRAIT >
Quantity< NUMERIC_TRAITS, TRAIT > & cpp::Quantity< NUMERIC_TRAITS, TRAIT >::operator*= ( const QuantityType other)
template<typename NUMERIC_TRAITS , typename TRAIT >
Quantity< NUMERIC_TRAITS, TRAIT > & cpp::Quantity< NUMERIC_TRAITS, TRAIT >::operator*= ( NumericType  v)
template<typename NUMERIC_TRAITS , typename TRAIT >
Quantity< NUMERIC_TRAITS, TRAIT > & cpp::Quantity< NUMERIC_TRAITS, TRAIT >::operator+= ( const QuantityType other)
template<typename NUMERIC_TRAITS , typename TRAIT >
Quantity< NUMERIC_TRAITS, TRAIT > & cpp::Quantity< NUMERIC_TRAITS, TRAIT >::operator+= ( NumericType  v)
template<typename NUMERIC_TRAITS , typename TRAIT >
Quantity< NUMERIC_TRAITS, TRAIT > & cpp::Quantity< NUMERIC_TRAITS, TRAIT >::operator-= ( const QuantityType other)
template<typename NUMERIC_TRAITS , typename TRAIT >
Quantity< NUMERIC_TRAITS, TRAIT > & cpp::Quantity< NUMERIC_TRAITS, TRAIT >::operator-= ( NumericType  v)
template<typename NUMERIC_TRAITS , typename TRAIT >
Quantity< NUMERIC_TRAITS, TRAIT > & cpp::Quantity< NUMERIC_TRAITS, TRAIT >::operator/= ( const QuantityType other)
template<typename NUMERIC_TRAITS , typename TRAIT >
Quantity< NUMERIC_TRAITS, TRAIT > & cpp::Quantity< NUMERIC_TRAITS, TRAIT >::operator/= ( NumericType  v)
template<typename NUMERIC_TRAITS , typename TRAIT >
Quantity< NUMERIC_TRAITS, TRAIT > & cpp::Quantity< NUMERIC_TRAITS, TRAIT >::operator= ( const QuantityType other)
template<typename NUMERIC_TRAITS , typename TRAIT >
void cpp::Quantity< NUMERIC_TRAITS, TRAIT >::setValue ( NumericType  v)
template<typename NUMERIC_TRAITS , typename TRAIT >
NUMERIC_TRAITS::Type cpp::Quantity< NUMERIC_TRAITS, TRAIT >::value ( ) const

Friends And Related Function Documentation

template<typename NUMERIC_TRAITS , typename TRAIT >
const Quantity< NUMERIC_TRAITS, TRAIT > operator* ( const Quantity< NUMERIC_TRAITS, TRAIT > &  lhs,
const Quantity< NUMERIC_TRAITS, TRAIT > &  rhs 
)
related
template<typename NUMERIC_TRAITS , typename TRAIT >
const Quantity< NUMERIC_TRAITS, TRAIT > operator* ( const Quantity< NUMERIC_TRAITS, TRAIT > &  lhs,
typename NUMERIC_TRAITS::Type  k 
)
related
template<typename NUMERIC_TRAITS , typename TRAIT >
const Quantity< NUMERIC_TRAITS, TRAIT > operator* ( typename NUMERIC_TRAITS::Type  k,
const Quantity< NUMERIC_TRAITS, TRAIT > &  rhs 
)
related
template<typename NUMERIC_TRAITS , typename TRAIT >
const Quantity< NUMERIC_TRAITS, TRAIT > operator+ ( const Quantity< NUMERIC_TRAITS, TRAIT > &  lhs,
const Quantity< NUMERIC_TRAITS, TRAIT > &  rhs 
)
related
template<typename NUMERIC_TRAITS , typename TRAIT >
const Quantity< NUMERIC_TRAITS, TRAIT > operator+ ( const Quantity< NUMERIC_TRAITS, TRAIT > &  lhs,
typename NUMERIC_TRAITS::Type  k 
)
related
template<typename NUMERIC_TRAITS , typename TRAIT >
const Quantity< NUMERIC_TRAITS, TRAIT > operator+ ( typename NUMERIC_TRAITS::Type  k,
const Quantity< NUMERIC_TRAITS, TRAIT > &  rhs 
)
related
template<typename NUMERIC_TRAITS , typename TRAIT >
const Quantity< NUMERIC_TRAITS, TRAIT > operator- ( const Quantity< NUMERIC_TRAITS, TRAIT > &  lhs,
const Quantity< NUMERIC_TRAITS, TRAIT > &  rhs 
)
related
template<typename NUMERIC_TRAITS , typename TRAIT >
const Quantity< NUMERIC_TRAITS, TRAIT > operator- ( const Quantity< NUMERIC_TRAITS, TRAIT > &  lhs,
typename NUMERIC_TRAITS::Type  k 
)
related
template<typename NUMERIC_TRAITS , typename TRAIT >
const Quantity< NUMERIC_TRAITS, TRAIT > operator- ( typename NUMERIC_TRAITS::Type  k,
const Quantity< NUMERIC_TRAITS, TRAIT > &  rhs 
)
related
template<typename NUMERIC_TRAITS , typename TRAIT >
const Quantity< NUMERIC_TRAITS, TRAIT > operator/ ( const Quantity< NUMERIC_TRAITS, TRAIT > &  lhs,
const Quantity< NUMERIC_TRAITS, TRAIT > &  rhs 
)
related
template<typename NUMERIC_TRAITS , typename TRAIT >
const Quantity< NUMERIC_TRAITS, TRAIT > operator/ ( const Quantity< NUMERIC_TRAITS, TRAIT > &  lhs,
typename NUMERIC_TRAITS::Type  k 
)
related
template<typename NUMERIC_TRAITS , typename TRAIT >
const Quantity< NUMERIC_TRAITS, TRAIT > operator/ ( typename NUMERIC_TRAITS::Type  k,
const Quantity< NUMERIC_TRAITS, TRAIT > &  rhs 
)
related
template<typename NUMERIC_TRAITS , typename TRAIT >
bool operator< ( const Quantity< NUMERIC_TRAITS, TRAIT > &  lhs,
const Quantity< NUMERIC_TRAITS, TRAIT > &  rhs 
)
related
template<typename NUMERIC_TRAITS , typename TRAIT >
bool operator> ( const Quantity< NUMERIC_TRAITS, TRAIT > &  lhs,
const Quantity< NUMERIC_TRAITS, TRAIT > &  rhs 
)
related

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