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

Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > Class Template Reference

constant quantities, specialization More...

#include <Constant.h>

List of all members.

Public Types

typedef SU Unit
 the unit of the Constant;


Public Member Functions

 Constant (void)
 default constructor

 Constant (const ST new_value)
 constructor

 Constant (const ST new_value, const SU &)
 constructor from same unit

 Constant (const Constant &new_constant)
 copy constructor

template<class NU>  Constant (const ST new_value, const NU &)
 constructor from different unit

 Constant (const ST new_value, const std::string &unitsymbol)
 constructor from different unit given by std::string

 Constant (const ST new_value, const char *unitsymbol)
 constructor from different unit given by string constant

template<template< class, class > class Q1, class SU1>  Constant (const Q1< PQ, SU1 > &source_quantity)
 copy constructor from quantity with different unit (conversion)

template<template< class, class > class Q1, class GT1, class DU1, class SU1>  Constant (const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &source_quantity)
 copy constructor from quantity with different unit (conversion)

ST standard_value (void) const
 return the value in the standard unit;

ST value (void) const
 return the value in the storage unit;

template<class NU> ST value (const Units::NonPrefixable< GT, NU, ST > &) const
 return the value in a NonPrefixable unit NonPrefixable<GT, NU, ST>;

template<class NU, class P> ST value (const Units::Prefixed< Units::Prefixable< GT, NU, ST >, P > &) const
 return the value in a Prefixed unit;

template<class CUL, class EL> ST value (const Units::Composed< Units::Compound< GT, CUL, ST >, EL > &) const
 return the value in a Composed unit;

ST value (const std::string &symbol)
 return the value in a unit with symbol string symbolstring;

template<class NU> Constant< PQ, NU > operator() (const NU &) const
 return the value in a Constant object with unit NU;

const std::string unitsymbol (void) const
 return the storage unit symbol;

const std::string unitname (void) const
 return the storage unit name;

Variable< PQ, SU > operator+ (void) const
 unary + operator

Variable< PQ, SU > operator- (void) const
 unary - operator

template<class Q> Variable< PQ, SU > operator+ (const Q &new_variable) const
 + operator

template<class Q> Variable< PQ, SU > operator- (const Q &new_variable) const
 
  • operator


Variable< PQ, SU > operator * (const ST factor) const
 * operator for multiplication with ST

Variable< PQ, SU > operator/ (const ST factor) const
 / operator for division by ST

bool operator== (const Constant &rhs_variable) const
 equality

template<template< class, class > class Q1, class SU1> bool operator== (const Q1< PQ, SU1 > &rhs_variable) const
 equality

template<template< class, class > class Q1, class GT1, class DU1, class SU1> bool operator== (const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &rhs_variable) const
 equality

template<template< class, class > class Q1, class GT1, class Head1, class Tail1, class DU1, class SU1> bool operator== (const Q1< Quantity< GT1, Loki::Typelist< Head1, Tail1 >, DU1, ST >, SU1 > &rhs_variable) const
 equality

bool operator!= (const Constant &rhs_variable) const
 !equality

template<template< class, class > class Q1, class SU1> bool operator!= (const Q1< PQ, SU1 > &rhs_variable) const
 !equality

template<template< class, class > class Q1, class GT1, class DU1, class SU1> bool operator!= (const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &rhs_variable) const
 !equality

template<template< class, class > class Q1, class GT1, class Head1, class Tail1, class DU1, class SU1> bool operator!= (const Q1< Quantity< GT1, Loki::Typelist< Head1, Tail1 >, DU1, ST >, SU1 > &rhs_variable) const
 !equality

bool operator> (const Constant &rhs_variable) const
 greater than

template<template< class, class > class Q1, class SU1> bool operator> (const Q1< PQ, SU1 > &rhs_variable) const
 greater than

template<template< class, class > class Q1, class GT1, class DU1, class SU1> bool operator> (const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &rhs_variable) const
 greater than

template<template< class, class > class Q1, class GT1, class Head1, class Tail1, class DU1, class SU1> bool operator> (const Q1< Quantity< GT1, Loki::Typelist< Head1, Tail1 >, DU1, ST >, SU1 > &rhs_variable) const
 greater than

bool operator< (const Constant &rhs_variable) const
 less than

template<template< class, class > class Q1, class SU1> bool operator< (const Q1< PQ, SU1 > &rhs_variable) const
 less than

template<template< class, class > class Q1, class GT1, class DU1, class SU1> bool operator< (const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &rhs_variable) const
 less than

template<template< class, class > class Q1, class GT1, class Head1, class Tail1, class DU1, class SU1> bool operator< (const Q1< Quantity< GT1, Loki::Typelist< Head1, Tail1 >, DU1, ST >, SU1 > &rhs_variable) const
 less than

bool operator>= (const Constant &rhs_variable) const
 greater equal

template<template< class, class > class Q1, class SU1> bool operator>= (const Q1< PQ, SU1 > &rhs_variable) const
 greater equal

template<template< class, class > class Q1, class GT1, class DU1, class SU1> bool operator>= (const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &rhs_variable) const
 greater equal

template<template< class, class > class Q1, class GT1, class Head1, class Tail1, class DU1, class SU1> bool operator>= (const Q1< Quantity< GT1, Loki::Typelist< Head1, Tail1 >, DU1, ST >, SU1 > &rhs_variable) const
 greater equal

bool operator<= (const Constant &rhs_variable) const
 less equal

template<template< class, class > class Q1, class SU1> bool operator<= (const Q1< PQ, SU1 > &rhs_variable) const
 less equal

template<template< class, class > class Q1, class GT1, class DU1, class SU1> bool operator<= (const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &rhs_variable) const
 less equal

template<template< class, class > class Q1, class GT1, class Head1, class Tail1, class DU1, class SU1> bool operator<= (const Q1< Quantity< GT1, Loki::Typelist< Head1, Tail1 >, DU1, ST >, SU1 > &rhs_variable) const
 less equal

template<class Q> GenerateVariable< Constant,
Q >::Add 
operator * (const Q &factor)
 multiplication of constant with a quantity

template<class Q> GenerateVariable< Constant,
Q >::Sub 
operator/ (const Q &factor)
 division of a constant by a quantity

template<long N, long D> GenerateVariable< Constant,
BSUtilities::Rational< N,
D > >::Mult 
pow (const BSUtilities::Rational< N, D > &)
 the alternative pow function with rational exponent

GenerateVariable< Constant,
BSUtilities::Rational<
1, 2 > >::Mult 
sqrt (void)
 the alternative sqrt function

std::ostream & print_value (std::ostream &os) const
 print the value and the unit of the constant

void operator>> (std::string &str) const
 store the value and unit of the variable in a std::string

std::ostream & operator>> (std::ostream &os) const
 print the variable


Static Public Member Functions

std::string Unitsymbol (void)
 return the storage unit symbol;

std::string Unitname (void)
 return the storage unit name;


Private Types

typedef Units::CheckUnit<
Units::Unit< GT, ST >, SU
>::Check 
Checked
 check SU

typedef Quantity< GT, Loki::Typelist<
Head, Tail >, DU, ST > 
PQ
 the parent quantity;


Private Member Functions

Constant & operator= (const Constant &)
 assignment

template<class TQ> Constant & operator= (const TQ &)
 assignment from other type


Private Attributes

ST constant_value
 the value of the Constant in the unit SU;


Friends

Variable< PQ, SU > operator * (const ST factor, const Constant &constant)
 * operator for factor arranged BEFORE Variable

Variable< PQ, SU > abs (const Constant &constant)
 abs function

Variable< PQ, SU > ceil (const Constant &constant)
 ceil function

Variable< PQ, SU > floor (const Constant &constant)
 floor function

Variable< PQ, SU > modf (const Constant &constant, Variable< PQ, SU > *integral)
 modf function

Variable< PQ, SU > frexp (const Constant &constant, int *exponent)
 frexp function

Variable< PQ, SU > ldexp (const Constant &constant, int *exponent)
 ldexp function

template<template< class, class > class Q1, class SU1> Variable< PQ, SU > fmod (const Constant &constant, const Q1< PQ, SU1 > &quantity)
 fmod function

template<template< class, class > class Q1, class GT1, class DU1, class SU1> Variable< PQ, SU > fmod (const Constant &constant, const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &quantity)
 fmod function

template<template< class, class > class Q1, class GT1, class DU1, class SU1> Q1< Quantity< GT1, Loki::Typelist<
Units::NonPrefixable< GT1,
Units::GenericUnit, ST >,
Loki::NullType >, DU1, ST >,
SU1 > 
fmod (const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &variable1, const Constant &constant)
 fmod function

GenerateVariable< Constant,
Loki::NullType >::Neg 
operator/ (const ST numerator, const Constant &factor)
 division of a number by a constant

template<long N, long D> GenerateVariable< Constant,
BSUtilities::Rational< N,
D > >::Mult 
pow (const Constant &variable, const BSUtilities::Rational< N, D > &)
 the pow function with rational exponent

GenerateVariable< Constant,
BSUtilities::Rational<
1, 2 > >::Mult 
sqrt (const Constant &constant)
 the sqrt function


Detailed Description

template<class GT, class Head, class Tail, class DU, class SU, class ST>
class Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >

constant quantities, specialization

the parent quantity is required to be a Quantity, while there is no requirement on SU; the constant is derived from the parent quantity.

Definition at line 52 of file Constant.h.


Member Typedef Documentation

template<class GT, class Head, class Tail, class DU, class SU, class ST>
typedef Units::CheckUnit<Units::Unit<GT, ST>, SU>::Check Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::Checked [private]
 

check SU

parameter SU is checked to be subclassed from Unit<GT, ST>; this ensures that SU (a) is a unit, and (b) is connected to PQ through the group type GT.

Definition at line 62 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
typedef Quantity<GT, Loki::Typelist<Head, Tail>, DU, ST> Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::PQ [private]
 

the parent quantity;

make the parent quantity known as PQ.

Definition at line 67 of file Constant.h.

Referenced by Constant().

template<class GT, class Head, class Tail, class DU, class SU, class ST>
typedef SU Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::Unit
 

the unit of the Constant;

make SU known as the Unit of the Constant

Definition at line 73 of file Constant.h.

Referenced by Constant().


Member Function Documentation

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class GT1, class DU1, class SU1>
Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::Constant const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &  source_quantity  )  [inline]
 

copy constructor from quantity with different unit (conversion)

specialized version for a quantity derived from Quantity with a unit list typical for a generated quantity using a GenericUnit; this special case is the only exception when a quantity of different group type can be converted into the target Constant, provided the dimensions of the two objects are equal. This is tested with CheckSecondDimension.

Definition at line 199 of file Constant.h.

References PQ, and Unit.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class SU1>
Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::Constant const Q1< PQ, SU1 > &  source_quantity  )  [inline]
 

copy constructor from quantity with different unit (conversion)

specialized version for same parent quantity PQ; used if PQ of the target Constant to be constructed and that of the source quantity are identical; then we can be sure that the value of the source quantity can be recalculated into the unit of the target Constant; the result of this calculation is used in an initializer. The name and the symbol of the quantity are copied in the body of the function. The form of Q1<> must satisfy the template parameter sequence for a Constant or other classes similarly derived fom Quantity; this prohibits the conversion from general objects (string etc.).

Definition at line 179 of file Constant.h.

References PQ, and Unit.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::Constant const ST  new_value,
const char *  unitsymbol
[inline]
 

constructor from different unit given by string constant

takes a std:string to define the symbol of the unit as the second parameter and recalculates the value into the storage unit Unit; first initializes base class; findBySymbol may throw a UnitMismatch exception.

Definition at line 157 of file Constant.h.

References PQ.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::Constant const ST  new_value,
const std::string &  unitsymbol
[inline]
 

constructor from different unit given by std::string

takes a std:string to define the symbol of the unit as the second parameter and recalculates the value into the storage unit SU; first initializes base class; findBySymbol may throw a UnitMismatch exception.

Definition at line 142 of file Constant.h.

References PQ.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<class NU>
Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::Constant const ST  new_value,
const NU & 
[inline]
 

constructor from different unit

takes an instance of a unit of parameter type NU as the second parameter and recalculates the value into the storage unit SU; check that NU is listed in AllUnits; only the type NU is used; first initializes base class; Note: use only if NU is a concrete, not an abstract type.

Definition at line 130 of file Constant.h.

References PQ.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::Constant const Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  new_constant  )  [inline]
 

copy constructor

initialize the parent quantity PQ; then copy the value, the name and symbol string of new_constant;

Definition at line 115 of file Constant.h.

References PQ.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::Constant const ST  new_value,
const SU & 
[inline]
 

constructor from same unit

takes an instance of the storage unit as the second parameter and uses value directly.

Definition at line 108 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::Constant const ST  new_value  )  [inline]
 

constructor

Set the value to new_value and assume this to be in storage unit SU.

Definition at line 102 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::Constant void   )  [inline]
 

default constructor

Set the value to 0.0 and assume this to be in storage unit SU.

Definition at line 97 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<class Q>
GenerateVariable<Constant, Q>::Add Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator * const Q &  factor  )  [inline]
 

multiplication of constant with a quantity

the type of the result is generated through GenerateVariable by adding the dimensions of the two quantities; only GenerateVariable with two quantities as parameters does have an Add typedef, thus, Q does not need to be specified.

Definition at line 928 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Variable<PQ, SU> Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator * const ST  factor  )  const [inline]
 

* operator for multiplication with ST

generates new object; can be chained as in a * b * c;

Definition at line 363 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class GT1, class Head1, class Tail1, class DU1, class SU1>
bool Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator!= const Q1< Quantity< GT1, Loki::Typelist< Head1, Tail1 >, DU1, ST >, SU1 > &  rhs_variable  )  const [inline]
 

!equality

special case for lhs operand being a generated quantity with a generic unit and the same dimension as the rhs operand; compares the values in the standard unit; to check that we have a generated quantity as lhs operator, it is checked that its unit is of the type typical for such a quantity; to check dimension, the standardization call is generated through a compile time check;

Definition at line 636 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class GT1, class DU1, class SU1>
bool Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator!= const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &  rhs_variable  )  const [inline]
 

!equality

special case for rhs operand being a generated quantity with a generic unit and the same dimension as the lhs operand; compares the values in the standard unit; to check dimension, the standardization call is generated through a compile time check;

Definition at line 612 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class SU1>
bool Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator!= const Q1< PQ, SU1 > &  rhs_variable  )  const [inline]
 

!equality

special case for types from the same parent quantity PQ, but possibly different storage units SU and SU1; compares the values in the standard unit; we can be sure that values can be recalculated between SU and SU1;

Definition at line 600 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
bool Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator!= const Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  rhs_variable  )  const [inline]
 

!equality

special case for identical types; use value to retrieve the constant_value of the right hand side Constant.

Definition at line 590 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<class NU>
Constant<PQ, NU> Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator() const NU &   )  const [inline]
 

return the value in a Constant object with unit NU;

Generates an object of the desired type and stores constant_value (which is in unit SU); recalculation occurs within the constructor of the new object. This is a conversion into another object with the new unit NU.

Definition at line 300 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<class Q>
Variable<PQ, SU> Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator+ const Q &  new_variable  )  const [inline]
 

+ operator

can be chained as in a + b + c;

Definition at line 346 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Variable<PQ, SU> Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator+ void   )  const [inline]
 

unary + operator

returns a Variable object with the same dimension and other characteristics and same value.

Definition at line 328 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<class Q>
Variable<PQ, SU> Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator- const Q &  new_variable  )  const [inline]
 

  • operator

can be chained as in a + b - c;

Definition at line 355 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Variable<PQ, SU> Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator- void   )  const [inline]
 

unary - operator

returns a Variable object with the same dimension and other characteristics and same value with changed sign.

Definition at line 337 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<class Q>
GenerateVariable<Constant, Q>::Sub Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator/ const Q &  factor  )  [inline]
 

division of a constant by a quantity

the type of the result is generated through GenerateVariable by subtracting the dimensions of the two quantities; only GenerateVariable with two quantities as parameters does have an Sub typedef, thus, Q does not need to be specified.

Definition at line 942 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Variable<PQ, SU> Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator/ const ST  factor  )  const [inline]
 

/ operator for division by ST

generates new object; can be chained as in a * b / c;

Definition at line 371 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class GT1, class Head1, class Tail1, class DU1, class SU1>
bool Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator< const Q1< Quantity< GT1, Loki::Typelist< Head1, Tail1 >, DU1, ST >, SU1 > &  rhs_variable  )  const [inline]
 

less than

special case for lhs operand being a generated quantity with a generic unit and the same dimension as the rhs operand; compares the values in the standard unit; to check that we have a generated quantity as lhs operator, it is checked that its unit is of the type typical for such a quantity; to check dimension, the standardization call is generated through a compile time check;

Definition at line 770 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class GT1, class DU1, class SU1>
bool Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator< const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &  rhs_variable  )  const [inline]
 

less than

special case for rhs operand being a generated quantity with a generic unit and the same dimension as the lhs operand; compares the values in the standard unit; to check dimension, the standardization call is generated through a compile time check;

Definition at line 746 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class SU1>
bool Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator< const Q1< PQ, SU1 > &  rhs_variable  )  const [inline]
 

less than

special case for types from the same parent quantity PQ, but possibly different storage units SU and SU1; compares the values in the standard unit; we can be sure that values can be recalculated between SU and SU1;

Definition at line 734 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
bool Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator< const Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  rhs_variable  )  const [inline]
 

less than

special case for identical types; use value to retrieve the constant_value of the right hand side Constant.

Definition at line 724 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class GT1, class Head1, class Tail1, class DU1, class SU1>
bool Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator<= const Q1< Quantity< GT1, Loki::Typelist< Head1, Tail1 >, DU1, ST >, SU1 > &  rhs_variable  )  const [inline]
 

less equal

special case for lhs operand being a generated quantity with a generic unit and the same dimension as the rhs operand; compares the values in the standard unit; to check that we have a generated quantity as lhs operator, it is checked that its unit is of the type typical for such a quantity; to check dimension, the standardization call is generated through a compile time check;

Definition at line 904 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class GT1, class DU1, class SU1>
bool Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator<= const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &  rhs_variable  )  const [inline]
 

less equal

special case for rhs operand being a generated quantity with a generic unit and the same dimension as the lhs operand; compares the values in the standard unit; to check dimension, the standardization call is generated through a compile time check;

Definition at line 880 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class SU1>
bool Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator<= const Q1< PQ, SU1 > &  rhs_variable  )  const [inline]
 

less equal

special case for types from the same parent quantity PQ, but possibly different storage units SU and SU1; compares the values in the standard unit; we can be sure that values can be recalculated between SU and SU1;

Definition at line 868 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
bool Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator<= const Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  rhs_variable  )  const [inline]
 

less equal

special case for identical types; use value to retrieve the constant_value of the right hand side Constant.

Definition at line 858 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<class TQ>
Constant& Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator= const TQ &   )  [private]
 

assignment from other type

only declaration, never defined and private

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Constant& Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator= const Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &   )  [private]
 

assignment

only declaration, never defined and private

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class GT1, class Head1, class Tail1, class DU1, class SU1>
bool Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator== const Q1< Quantity< GT1, Loki::Typelist< Head1, Tail1 >, DU1, ST >, SU1 > &  rhs_variable  )  const [inline]
 

equality

special case for lhs operand being a generated quantity with a generic unit and the same dimension as the rhs operand; compares the values in the standard unit; to check that we have a generated quantity as lhs operator, it is checked that its unit is of the type typical for such a quantity; to check dimension, the standardization call is generated through a compile time check;

Definition at line 569 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class GT1, class DU1, class SU1>
bool Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator== const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &  rhs_variable  )  const [inline]
 

equality

special case for rhs operand being a generated quantity with a generic unit and the same dimension as the lhs operand; compares the values in the standard unit; to check dimension, the standardization call is generated through a compile time check;

Definition at line 544 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class SU1>
bool Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator== const Q1< PQ, SU1 > &  rhs_variable  )  const [inline]
 

equality

special case for types from the same parent quantity PQ, but possibly different storage units SU and SU1; compares the values in the standard unit; we can be sure that values can be recalculated between SU and SU1;

Definition at line 532 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
bool Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator== const Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  rhs_variable  )  const [inline]
 

equality

special case for identical types; use value to retrieve the constant_value of the right hand side Constant.

Definition at line 522 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class GT1, class Head1, class Tail1, class DU1, class SU1>
bool Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator> const Q1< Quantity< GT1, Loki::Typelist< Head1, Tail1 >, DU1, ST >, SU1 > &  rhs_variable  )  const [inline]
 

greater than

special case for lhs operand being a generated quantity with a generic unit and the same dimension as the rhs operand; compares the values in the standard unit; to check that we have a generated quantity as lhs operator, it is checked that its unit is of the type typical for such a quantity; to check dimension, the standardization call is generated through a compile time check;

Definition at line 703 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class GT1, class DU1, class SU1>
bool Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator> const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &  rhs_variable  )  const [inline]
 

greater than

special case for rhs operand being a generated quantity with a generic unit and the same dimension as the lhs operand; compares the values in the standard unit; to check dimension, the standardization call is generated through a compile time check;

Definition at line 679 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class SU1>
bool Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator> const Q1< PQ, SU1 > &  rhs_variable  )  const [inline]
 

greater than

special case for types from the same parent quantity PQ, but possibly different storage units SU and SU1; compares the values in the standard unit; we can be sure that values can be recalculated between SU and SU1;

Definition at line 667 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
bool Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator> const Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  rhs_variable  )  const [inline]
 

greater than

special case for identical types; use value to retrieve the constant_value of the right hand side Constant.

Definition at line 657 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class GT1, class Head1, class Tail1, class DU1, class SU1>
bool Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator>= const Q1< Quantity< GT1, Loki::Typelist< Head1, Tail1 >, DU1, ST >, SU1 > &  rhs_variable  )  const [inline]
 

greater equal

special case for lhs operand being a generated quantity with a generic unit and the same dimension as the rhs operand; compares the values in the standard unit; to check that we have a generated quantity as lhs operator, it is checked that its unit is of the type typical for such a quantity; to check dimension, the standardization call is generated through a compile time check;

Definition at line 837 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class GT1, class DU1, class SU1>
bool Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator>= const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &  rhs_variable  )  const [inline]
 

greater equal

special case for rhs operand being a generated quantity with a generic unit and the same dimension as the lhs operand; compares the values in the standard unit; to check dimension, the standardization call is generated through a compile time check;

Definition at line 813 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class SU1>
bool Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator>= const Q1< PQ, SU1 > &  rhs_variable  )  const [inline]
 

greater equal

special case for types from the same parent quantity PQ, but possibly different storage units SU and SU1; compares the values in the standard unit; we can be sure that values can be recalculated between SU and SU1;

Definition at line 801 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
bool Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator>= const Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  rhs_variable  )  const [inline]
 

greater equal

special case for identical types; use value to retrieve the constant_value of the right hand side Constant.

Definition at line 791 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
std::ostream& Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator>> std::ostream &  os  )  const [inline]
 

print the variable

used if the variable is placed to the left of operator>>; calls print_value () indirectly through Quantity<>::print, thus including name and symbol of quantity if requested.

Definition at line 1036 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
void Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator>> std::string &  str  )  const [inline]
 

store the value and unit of the variable in a std::string

converts to a string by template Conversion

Definition at line 1028 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<long N, long D>
GenerateVariable<Constant, BSUtilities::Rational<N, D> >::Mult Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::pow const BSUtilities::Rational< N, D > &   )  [inline]
 

the alternative pow function with rational exponent

NOTE: Rational<>::convert does not work!!

Definition at line 984 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
std::ostream& Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::print_value std::ostream &  os  )  const [inline]
 

print the value and the unit of the constant

places these items on the ostream os and returns the reference to the os object, thus allowing chaining of operator<< calls.

Definition at line 1022 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
GenerateVariable<Constant, BSUtilities::Rational<1, 2> >::Mult Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::sqrt void   )  [inline]
 

the alternative sqrt function

use as v.sqrt (), with v being an instantiation of a Constant

Definition at line 1011 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
ST Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::standard_value void   )  const [inline]
 

return the value in the standard unit;

The stored constant_value is standardized using the Standard () function of the unit SU

Definition at line 219 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
std::string Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::Unitname void   )  [inline, static]
 

return the storage unit name;

the name is interrogated from SU; static access.

Definition at line 322 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
const std::string Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::unitname void   )  const [inline]
 

return the storage unit name;

the name is interrogated from SU; dynamic access.

Definition at line 317 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
std::string Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::Unitsymbol void   )  [inline, static]
 

return the storage unit symbol;

the symbol is interrogated from SU; static access.

Definition at line 312 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
const std::string Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::unitsymbol void   )  const [inline]
 

return the storage unit symbol;

the symbol is interrogated from SU; dynamic access.

Definition at line 306 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
ST Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::value const std::string &  symbol  )  [inline]
 

return the value in a unit with symbol string symbolstring;

The string is checked at run time, this allows dynamic access. The stored value is first standardized using the Standard () function of the storage unit SU, and then recalculated into the unit found with findBySymbol. The allocated object pointed to by unitp is deleted. If symbol is not found by findBySymbol, a UnitMismatch exception is thrown.

Definition at line 282 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<class CUL, class EL>
ST Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::value const Units::Composed< Units::Compound< GT, CUL, ST >, EL > &   )  const [inline]
 

return the value in a Composed unit;

The stored value is first standardized using the Standard () function of the storage unit SU, and then recalculated into the Composed, which is checked against AllUnits; only the type of the Composed is used.

Definition at line 266 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<class NU, class P>
ST Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::value const Units::Prefixed< Units::Prefixable< GT, NU, ST >, P > &   )  const [inline]
 

return the value in a Prefixed unit;

The stored value is first standardized using the Standard () function of the storage unit SU, and then recalculated into the Prefixed, which is checked against AllUnits; only the type of the Prefixed is used.

Definition at line 249 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<class NU>
ST Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::value const Units::NonPrefixable< GT, NU, ST > &   )  const [inline]
 

return the value in a NonPrefixable unit NonPrefixable<GT, NU, ST>;

The stored value is first standardized using the Standard () function of the storage unit SU, and then recalculated into the NonPrefixable, which is checked against AllUnits; only the type of the Prefixable is used.

Definition at line 234 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
ST Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::value void   )  const [inline]
 

return the value in the storage unit;

The stored constant_value is returned without recalculation.

Definition at line 225 of file Constant.h.


Friends And Related Function Documentation

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Variable<PQ, SU> abs const Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  constant  )  [friend]
 

abs function

generates new object to be returned;

Definition at line 388 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Variable<PQ, SU> ceil const Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  constant  )  [friend]
 

ceil function

generates new object to be returned;

Definition at line 397 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Variable<PQ, SU> floor const Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  constant  )  [friend]
 

floor function

generates new object to be returned;

Definition at line 406 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class GT1, class DU1, class SU1>
Q1<Quantity<GT1, Loki::Typelist<Units::NonPrefixable<GT1, Units::GenericUnit, ST>, Loki::NullType>, DU1, ST>, SU1> fmod const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &  variable1,
const Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  constant
[friend]
 

fmod function

generates new object to be returned; case of first argument being a generated quantity with a generic unit and the same dimension as the first argument; calculation is done in standard unit; return type is identical to that of the first argument.

Definition at line 498 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class GT1, class DU1, class SU1>
Variable<PQ,SU> fmod const Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  constant,
const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &  quantity
[friend]
 

fmod function

generates new object to be returned; case of second argument being a generated quantity with a generic unit and the same dimension as the first argument; calculation is done in standard unit; return type is identical to that of the first argument.

Definition at line 471 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class SU1>
Variable<PQ, SU> fmod const Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  constant,
const Q1< PQ, SU1 > &  quantity
[friend]
 

fmod function

generates new object to be returned; case of two arguments of with same parent quantity; case of two identical Variables is a special case with identical function code; thus, this function serves both; calculation is done in standard unit; return type is identical to that of the first argument.

Definition at line 456 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Variable<PQ, SU> frexp const Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  constant,
int *  exponent
[friend]
 

frexp function

generates new object to be returned;

Definition at line 431 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Variable<PQ, SU> ldexp const Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  constant,
int *  exponent
[friend]
 

ldexp function

generates new object to be returned;

Definition at line 441 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Variable<PQ, SU> modf const Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  constant,
Variable< PQ, SU > *  integral
[friend]
 

modf function

generates new object to be returned; NOTE: make second variable from different type derived from parent quantity

Definition at line 418 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Variable<PQ, SU> operator * const ST  factor,
const Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  constant
[friend]
 

* operator for factor arranged BEFORE Variable

generates new object to be returned;

Definition at line 380 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
GenerateVariable<Constant, Loki::NullType>::Neg operator/ const ST  numerator,
const Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  factor
[friend]
 

division of a number by a constant

the type of the result is generated through GenerateVariable by negating the dimension of the variable;

Definition at line 954 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<long N, long D>
GenerateVariable<Constant, BSUtilities::Rational<N, D> >::Mult pow const Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  variable,
const BSUtilities::Rational< N, D > & 
[friend]
 

the pow function with rational exponent

NOTE: Rational<>::convert does not work!!

Definition at line 968 of file Constant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
GenerateVariable<Constant, BSUtilities::Rational<1, 2> >::Mult sqrt const Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  constant  )  [friend]
 

the sqrt function

use as sqrt (v), with v being an instantiation of a Constant

Definition at line 999 of file Constant.h.


Member Data Documentation

template<class GT, class Head, class Tail, class DU, class SU, class ST>
ST Quantities::Constant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::constant_value [private]
 

the value of the Constant in the unit SU;

This data member is private, and can only be accessed through the member functions value (); being set during construction of an object.

Definition at line 81 of file Constant.h.


The documentation for this class was generated from the following file:
Generated on Sun Jan 15 13:58:00 2006 for Quantity by doxygen 1.3.6