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

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

variable quantities, specialization More...

#include <Variable.h>

List of all members.

Public Types

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

typedef SU Unit
 make the storage unit SU known as Unit


Public Member Functions

 Variable (void)
 default constructor

 Variable (const ST new_value)
 constructor

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

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

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

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

 Variable (const Variable &new_variable)
 copy constructor

template<template< class, class > class Q1, class SU1>  Variable (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>  Variable (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)

template<template< class, class > class Q1, class PQ1, class SU1>  Variable (const Q1< PQ1, SU1 > &)
 copy constructor from some other quantity Q1

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> Variable< PQ, NU > operator() (const NU &) const
 return the value in a Variable 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;

template<template< class, class > class Q1, class SU1> Variable & operator= (const Q1< PQ, SU1 > &source_quantity)
 assignment operator

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

Variable & operator= (const Variable &new_variable)
 assignment operator

template<template< class, class > class Q1, class SU1> Variable & operator+= (const Q1< PQ, SU1 > &new_variable)
 += operator

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

template<template< class, class > class Q1, class GT1, class Head1, class Tail1, class DU1, class SU1> Variable & operator+= (const Q1< Quantity< GT1, Loki::Typelist< Head1, Tail1 >, DU1, ST >, SU1 > &new_variable)
 += operator

template<template< class, class > class Q1, class SU1> Variable & operator-= (const Q1< PQ, SU1 > &new_variable)
 -= operator

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

template<class Q> Variable & operator-= (const Q &new_variable)
 -= operator

Variable & operator *= (const ST factor)
 *= operator for multiplication with ST

Variable & operator/= (const ST factor)
 /= operator for division by ST

Variable operator+ (void) const
 unary + operator

Variable operator- (void) const
 unary - operator

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

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


Variable operator * (const ST factor) const
 * operator for right hand multiplication with ST

Variable operator/ (const ST factor) const
 / operator for division by ST

bool operator== (const Variable &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 Variable &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 Variable &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 Variable &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 Variable &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 Variable &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< Variable,
Q >::Add 
operator * (const Q &factor) const
 multiplication of variables with a quantity

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

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

GenerateVariable< Variable,
BSUtilities::Rational<
3, 1 > >::Mult 
pow (const double &exponent)
 the alternative pow function with a double exponent

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

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

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

void read_value (const std::string &str)
 read variable value and unit from a string

void operator<< (const std::string &str)
 read from string to the right of operator<<

void operator= (const std::string &str)
 assign from a string

std::istream & operator<< (std::istream &is)
 read from a std::istream to the right of operator<<


Static Public Member Functions

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

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


Protected Attributes

ST variable_value
 the value of the Variable in the storage unit


Private Types

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


Friends

GenerateVariable< Variable,
BSUtilities::Rational< I,
long(1)> >::Mul 
Pow )(const Variable &variable, typename Loki::Int2Type< I >)
 the pow function with integer exponent

Variable operator * (const ST factor, const Variable &variable)
 * operator for left hand multiplication by ST

Variable abs (const Variable &variable)
 abs function

Variable ceil (const Variable &variable)
 ceil function

Variable floor (const Variable &variable)
 floor function

Variable modf (const Variable &variable, Variable *integral)
 modf function

Variable frexp (const Variable &variable, int *exponent)
 frexp function

Variable ldexp (const Variable &variable, int exponent)
 ldexp function

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

template<template< class, class > class Q1, class GT1, class DU1, class SU1> Variable fmod (const Variable &variable, 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 Variable &variable2)
 fmod function

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

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

GenerateVariable< Variable,
BSUtilities::Rational<
3, 1 > >::Mult 
pow (const Variable &variable, const double &exponent)
 the pow function with double exponent

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

void operator>> (const std::string &str, Variable &variable)
 read from string to the left of operator>>

std::istream & operator>> (std::istream &is, Variable &variable)
 read from a std::istream to the left of operator>>


Detailed Description

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

variable quantities, specialization

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

Definition at line 62 of file Variable.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::Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::Checked [private]
 

check SU

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

Definition at line 72 of file Variable.h.

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

the parent quantity;

make the parent quantity known as PQ.

Definition at line 77 of file Variable.h.


Member Function Documentation

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

multiplication of variables 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 1167 of file Variable.h.

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

* operator for right hand multiplication with ST

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

Definition at line 607 of file Variable.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::Variable< 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 875 of file Variable.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::Variable< 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 851 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class SU1>
bool Quantities::Variable< 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 839 of file Variable.h.

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

!equality

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

Definition at line 829 of file Variable.h.

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

return the value in a Variable object with unit NU;

Generates an object of the desired type and stores variable_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 306 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<class Q>
Variable Quantities::Variable< 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; general class Q is not specified in a more detailed way, since this is done in operator+=

Definition at line 588 of file Variable.h.

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

unary + operator

returns a new object of same type and same value.

Definition at line 569 of file Variable.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>
Variable& Quantities::Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator+= const Q1< Quantity< GT1, Loki::Typelist< Head1, Tail1 >, DU1, ST >, SU1 > &  new_variable  )  [inline]
 

+= operator

can be chained as in a += b += c; for a generated quantity as left hand side operand, and any quantity as right hand side operand which has the correct dimension; value of both operands recalculated into standard unit, reverse standardization of the result before stored in variable_value.

Definition at line 479 of file Variable.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& Quantities::Variable< 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 > &  new_variable  )  [inline]
 

+= operator

can be chained as in a += b += c; for a right hand side operand which is a generated quantity having a generic unit and the same dimension as the left hand side operand; value of both operands recalculated into standard unit, reverse standardization of the result before stored in variable_value.

Definition at line 453 of file Variable.h.

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

+= operator

can be chained as in a += b += c; for quantities related through the same parent quantity, possibly different storage unit; dimension is not checked, since the above ensures that they must be the same; value of both operands recalculated into standard unit, reverse standardization of the result before stored in variable_value.

Definition at line 437 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<class Q>
Variable Quantities::Variable< 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; general class Q is not specified in a more detailed way, since this is done in operator-=

Definition at line 599 of file Variable.h.

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

unary - operator

returns a new object of same type and same value with changed sign.

Definition at line 577 of file Variable.h.

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

-= operator

can be chained as in a -= b -= c; for a generated quantity as left hand side operand, and any quantity as right hand side operand which has the correct dimension; value of both operands recalculated into standard unit, reverse standardization of the result before stored in variable_value.

Definition at line 543 of file Variable.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& Quantities::Variable< 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 > &  new_variable  )  [inline]
 

-= operator

can be chained as in a -= b -= c; for a right hand side operand which is a generated quantity having a generic unit and the same dimension as the left hand side operand; value of both operands recalculated into standard unit, reverse standardization of the result before stored in variable_value.

Definition at line 519 of file Variable.h.

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

-= operator

can be chained as in a -= b += c; for quantities related through the same parent quantity, possibly different storage unit; dimension is not checked, since this ensures that they must be the same; value of both operands recalculated into standard unit, reverse standardization of the result before stored in variable_value.

Definition at line 503 of file Variable.h.

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

division of a variable 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 1181 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Variable Quantities::Variable< 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 615 of file Variable.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::Variable< 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 1009 of file Variable.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::Variable< 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 985 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class SU1>
bool Quantities::Variable< 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 973 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
bool Quantities::Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator< const Variable< 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 variable_value of the right hand side Variable.

Definition at line 963 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
std::istream& Quantities::Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator<< std::istream &  is  )  [inline]
 

read from a std::istream to the right of operator<<

creates an intermediary string into which the data are read which are subsequently interpreted with read_value; the reference to the istream object is returned to allow chaining.

Definition at line 1337 of file Variable.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::Variable< 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 1143 of file Variable.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::Variable< 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 1119 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class SU1>
bool Quantities::Variable< 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 1107 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
bool Quantities::Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator<= const Variable< 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 variable_value of the right hand side Variable.

Definition at line 1097 of file Variable.h.

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

assignment operator

assignment from same type; comparison against self assignment can be done by direct comparison of pointers; no need to convert values, since unit must be the same; raw value of new_variable is used, since no conversion into default unit is desired; only the variable value is assigned, name and symbol are not touched.

Definition at line 419 of file Variable.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& Quantities::Variable< 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 > &  source_quantity  )  [inline]
 

assignment operator

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 assigned to the target Variable, provided the dimensions of the two objects are equal. This is tested with CheckSecondDimension. The form of Q1<> must satisfy the template parameter sequence for a Variable (or a other classes similarly derived fom Quantity); this prohibits assignment from general objects (strings etc.); comparison against self-assignment must be performed through void *, since &Q1 might be a pointer to a class different from that pointed to by this; thus, it is checked that the adresses of the two objects differ; the raw value of the source_quantity is extracted, converted into the unit of the present object, and the result is stored; only the variable_value is assigned, name and symbol of the present variable are not touched. It is assumed that the storage type of the two objects is identical.

Definition at line 387 of file Variable.h.

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

assignment operator

specialized version for some parent quantity PQ; used if PQ of the source and target quantity are identical; then we can be sure that the value of the source can be recalculated into the unit of the target. the form of Q1<> must satisfy the template parameter sequence for a Variable (or a other classes similarly derived fom Quantity); this prohibits assignment from general objects (strings etc.); comparison against self-assignment must be performed through void *, since &Q1 might be a pointer to a class different from that pointed to by this; thus, it is checked that the adresses of the two objects differ; the value of the source_quantity in the storage unit is extracted, converted into the unit of the present object, and the result is stored; only the variable_value is assigned, name and symbol of the present variable are not touched. It is assumed that the storage type of the two objects is identical.

Definition at line 350 of file Variable.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::Variable< 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 808 of file Variable.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::Variable< 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 784 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class SU1>
bool Quantities::Variable< 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 772 of file Variable.h.

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

equality

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

Definition at line 762 of file Variable.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::Variable< 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 942 of file Variable.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::Variable< 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 918 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class SU1>
bool Quantities::Variable< 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 906 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
bool Quantities::Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator> const Variable< 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 variable_value of the right hand side Variable.

Definition at line 896 of file Variable.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::Variable< 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 1076 of file Variable.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::Variable< 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 1052 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class SU1>
bool Quantities::Variable< 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 1040 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
bool Quantities::Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator>= const Variable< 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 variable_value of the right hand side Variable.

Definition at line 1030 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
std::ostream& Quantities::Variable< 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 1311 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
void Quantities::Variable< 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 1303 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<long N, long D>
GenerateVariable<Variable, BSUtilities::Rational<N, D> >::Mult Quantities::Variable< 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 1249 of file Variable.h.

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

print the value and the unit of the variable

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

Definition at line 1297 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
void Quantities::Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::read_value const std::string &  str  ) 
 

read variable value and unit from a string

central function for all input functions.

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

the alternative sqrt function

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

Definition at line 1286 of file Variable.h.

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

return the value in the standard unit;

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

Definition at line 227 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
std::string Quantities::Variable< 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 328 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
const std::string Quantities::Variable< 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 323 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
std::string Quantities::Variable< 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 318 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
const std::string Quantities::Variable< 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 312 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
ST Quantities::Variable< 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 variable_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 288 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<class CUL, class EL>
ST Quantities::Variable< 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 variable_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 272 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<class NU, class P>
ST Quantities::Variable< 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 variable_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 256 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<class NU>
ST Quantities::Variable< 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 variable_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 242 of file Variable.h.

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

return the value in the storage unit;

The stored variable_value is returned without recalculation.

Definition at line 233 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class PQ1, class SU1>
Quantities::Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::Variable const Q1< PQ1, SU1 > &   ) 
 

copy constructor from some other quantity Q1

not defined here, since in general, this copy constructor does not make sense! Only works if a specialized version is provided by a particular Variable<>; if this is not the case, an undefined reference should be reported.

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::Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::Variable 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 Variable, provided the dimensions of the two objects are equal. This is tested with CheckSecondDimension. It is assumed that the storage type of the two objects is identical.

Definition at line 197 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class SU1>
Quantities::Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::Variable 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 Variable 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 Variable; 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 Variable or other classes similarly derived fom Quantity; this prohibits the conversion from general objects (string etc.). It is assumed that the storage type of the two objects is identical.

Definition at line 178 of file Variable.h.

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

copy constructor

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

Definition at line 157 of file Variable.h.

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

constructor from different unit given by string constant

takes a char * 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 143 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Quantities::Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::Variable 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 128 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<class NU>
Quantities::Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::Variable 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 117 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Quantities::Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::Variable 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 105 of file Variable.h.

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

constructor

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

Definition at line 99 of file Variable.h.

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

default constructor

Set the value to 0.0 (or equivalent) and assume this to be in unit SU.

Definition at line 94 of file Variable.h.


Friends And Related Function Documentation

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

abs function

generates new object to be returned;

Definition at line 632 of file Variable.h.

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

ceil function

generates new object to be returned;

Definition at line 641 of file Variable.h.

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

floor function

generates new object to be returned;

Definition at line 650 of file Variable.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 Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  variable2
[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 740 of file Variable.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 fmod const Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  variable,
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 713 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class SU1>
Variable fmod const Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  variable,
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 698 of file Variable.h.

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

frexp function

generates new object to be returned;

Definition at line 674 of file Variable.h.

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

ldexp function

generates new object to be returned;

Definition at line 683 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Variable modf const Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  variable,
Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, 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 662 of file Variable.h.

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

* operator for left hand multiplication by ST

generates new object to be returned;

Definition at line 624 of file Variable.h.

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

division of a number by a variable

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

Definition at line 1193 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
std::istream& operator>> std::istream &  is,
Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  variable
[friend]
 

read from a std::istream to the left of operator>>

must be a friend to have std::istream & as the type of the first object; uses read from istream to the right of operator<<.

Definition at line 1346 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
void operator>> const std::string &  str,
Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU > &  variable
[friend]
 

read from string to the left of operator>>

must be a friend to have std::string as the type of the first object

Definition at line 1323 of file Variable.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<long N, long D>
GenerateVariable<Variable, BSUtilities::Rational<N, D> >::Mult pow const Variable< 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 1207 of file Variable.h.

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

the sqrt function

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

Definition at line 1274 of file Variable.h.


Member Data Documentation

template<class GT, class Head, class Tail, class DU, class SU, class ST>
ST Quantities::Variable< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::variable_value [protected]
 

the value of the Variable in the storage unit

this data member is private, and can only be accessed through the member functions value ().

Definition at line 87 of file Variable.h.


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