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

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

constant single instance quantities, specialization More...

#include <UniqueConstant.h>

List of all members.

Public Types

typedef SU Unit
 the storage unit of the UniqueConstant;


Public Member Functions

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;

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 UniqueConstant &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 UniqueConstant &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 UniqueConstant &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 UniqueConstant &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 UniqueConstant &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 UniqueConstant &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< UniqueConstant,
Q >::Add 
operator * (const Q &factor)
 multiplication of singleton constant with a quantity

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

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

GenerateVariable< UniqueConstant,
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 singleton constant

void operator>> (std::string &str) const
std::ostream & operator>> (std::ostream &os) const

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;

typedef UniqueConstant< Quantity<
GT, Loki::Typelist< Head,
Tail >, DU, ST >, SU > 
SC
 the UniqueConstant itself;


Private Member Functions

 UniqueConstant (void)
 default constructor

 UniqueConstant (const UniqueConstant &new_constant)
 copy constructor


Private Attributes

ST constant_value
 the value of the UniqueConstant in the storage unit;


Static Private Attributes

const ST default_value_
 the value of the UniqueConstant in the default unit;


Friends

class Loki::CreateUsingNew< SC >
 declare the default creation policy a friend

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

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

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

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

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

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

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

template<template< class, class > class Q1, class SU1> Variable< PQ, SU > fmod (const UniqueConstant &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 UniqueConstant &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 UniqueConstant &constant)
 fmod function

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

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

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


Detailed Description

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

constant single instance 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 53 of file UniqueConstant.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::UniqueConstant< 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 group type GT.

Definition at line 64 of file UniqueConstant.h.

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

the parent quantity;

make the parent quantity known as PQ.

Definition at line 68 of file UniqueConstant.h.

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

the storage unit of the UniqueConstant;

make SU known as Unit

Definition at line 85 of file UniqueConstant.h.


Member Function Documentation

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

multiplication of singleton 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 831 of file UniqueConstant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Variable<PQ, SU> Quantities::UniqueConstant< 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 272 of file UniqueConstant.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::UniqueConstant< 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 539 of file UniqueConstant.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::UniqueConstant< 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 515 of file UniqueConstant.h.

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

template<class GT, class Head, class Tail, class DU, class SU, class ST>
bool Quantities::UniqueConstant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator!= const UniqueConstant< 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 493 of file UniqueConstant.h.

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

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

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

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

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

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

division of a singleton 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 846 of file UniqueConstant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Variable<PQ, SU> Quantities::UniqueConstant< 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 280 of file UniqueConstant.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::UniqueConstant< 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 673 of file UniqueConstant.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::UniqueConstant< 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 649 of file UniqueConstant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
template<template< class, class > class Q1, class SU1>
bool Quantities::UniqueConstant< 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 standarde unit; we can be sure that values can be recalculated between SU and SU1;

Definition at line 637 of file UniqueConstant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
bool Quantities::UniqueConstant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator< const UniqueConstant< 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 UniqueConstant.

Definition at line 627 of file UniqueConstant.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::UniqueConstant< 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 807 of file UniqueConstant.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::UniqueConstant< 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 783 of file UniqueConstant.h.

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

template<class GT, class Head, class Tail, class DU, class SU, class ST>
bool Quantities::UniqueConstant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator<= const UniqueConstant< 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 UniqueConstant.

Definition at line 761 of file UniqueConstant.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::UniqueConstant< 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 472 of file UniqueConstant.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::UniqueConstant< 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 448 of file UniqueConstant.h.

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

template<class GT, class Head, class Tail, class DU, class SU, class ST>
bool Quantities::UniqueConstant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator== const UniqueConstant< 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 426 of file UniqueConstant.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::UniqueConstant< 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 606 of file UniqueConstant.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::UniqueConstant< 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 582 of file UniqueConstant.h.

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

template<class GT, class Head, class Tail, class DU, class SU, class ST>
bool Quantities::UniqueConstant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator> const UniqueConstant< 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 560 of file UniqueConstant.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::UniqueConstant< 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 740 of file UniqueConstant.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::UniqueConstant< 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 716 of file UniqueConstant.h.

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

template<class GT, class Head, class Tail, class DU, class SU, class ST>
bool Quantities::UniqueConstant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::operator>= const UniqueConstant< 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 UniqueConstant.

Definition at line 694 of file UniqueConstant.h.

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

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

print the value and the unit of the singleton 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 931 of file UniqueConstant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
GenerateVariable<UniqueConstant, BSUtilities::Rational<1, 2> >::Mult Quantities::UniqueConstant< 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 919 of file UniqueConstant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
ST Quantities::UniqueConstant< 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 first standardized using the Standard () function of the unit SU

Definition at line 128 of file UniqueConstant.h.

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

copy constructor

initialize parent quantity PQ; then copy the value, the name and symbol string of new_constant private for singleton to avoid sneaky copy, thus, cannot be called.

Definition at line 116 of file UniqueConstant.h.

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

default constructor

assume the value to be in the storage unit; private for singleton to avoid sneaky construction; construction possible through friend class CreateUsingNew<>. Construction from other units is not possible, i.e. the value MUST be given in the storage unit.

Definition at line 108 of file UniqueConstant.h.

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

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

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

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

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

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

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

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

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

return the value in the storage unit;

The stored value is returned without recalculation.

Definition at line 134 of file UniqueConstant.h.


Friends And Related Function Documentation

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

abs function

generates new object to be returned;

Definition at line 297 of file UniqueConstant.h.

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

ceil function

generates new object to be returned;

Definition at line 304 of file UniqueConstant.h.

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

floor function

generates new object to be returned;

Definition at line 311 of file UniqueConstant.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 UniqueConstant< 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 402 of file UniqueConstant.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 UniqueConstant< 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 375 of file UniqueConstant.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 UniqueConstant< 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 359 of file UniqueConstant.h.

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

frexp function

generates new object to be returned;

Definition at line 334 of file UniqueConstant.h.

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

ldexp function

generates new object to be returned;

Definition at line 344 of file UniqueConstant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
friend class Loki::CreateUsingNew< SC > [friend]
 

declare the default creation policy a friend

necessary to allow private default constructor; CreateUsingNew is part of Alexandrescu's Loki library.

Definition at line 79 of file UniqueConstant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Variable<PQ, SU> modf const UniqueConstant< 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 321 of file UniqueConstant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
Variable<PQ, SU> operator * const ST  factor,
const UniqueConstant< 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 289 of file UniqueConstant.h.

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

division of a number by a singleton constant

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

Definition at line 859 of file UniqueConstant.h.

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

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

the sqrt function

use as sqrt (v), with v being an singleton constant

Definition at line 905 of file UniqueConstant.h.


Member Data Documentation

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

the value of the UniqueConstant in the storage unit;

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

Definition at line 99 of file UniqueConstant.h.

template<class GT, class Head, class Tail, class DU, class SU, class ST>
const ST Quantities::UniqueConstant< Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST >, SU >::default_value_ [static, private]
 

the value of the UniqueConstant in the default unit;

This data member is private, and can only be accessed through the member functions value (); must be defined outside of class as a specialization for each UniqueConstant<PQ, SU>.

Definition at line 93 of file UniqueConstant.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