#include <UniqueConstant.h>
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 |
| |
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 |
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.
|
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. |
|
the parent quantity; make the parent quantity known as PQ. Definition at line 68 of file UniqueConstant.h. |
|
the storage unit of the UniqueConstant; make SU known as Unit Definition at line 85 of file UniqueConstant.h. |
|
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. |
|
* operator for multiplication with ST generates new object; can be chained as in a * b * c; Definition at line 272 of file UniqueConstant.h. |
|
!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. |
|
!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. |
|
!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. |
|
!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. |
|
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. |
|
+ operator can be chained as in a + b + c; Definition at line 255 of file UniqueConstant.h. |
|
unary + operator returns a Variable object with the same dimension and other characteristics and same value. Definition at line 237 of file UniqueConstant.h. |
|
can be chained as in a + b - c; Definition at line 264 of file UniqueConstant.h. |
|
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. |
|
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. |
|
/ operator for division by ST generates new object; can be chained as in a * b / c; Definition at line 280 of file UniqueConstant.h. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
the alternative pow function with rational exponent NOTE: Rational<>::convert does not work!! Definition at line 889 of file UniqueConstant.h. |
|
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. |
|
the alternative sqrt function use as v.sqrt (), with v being an instantiation of a Constant Definition at line 919 of file UniqueConstant.h. |
|
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. |
|
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. |
|
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. |
|
return the storage unit name; the name is interrogated from SU; static access. Definition at line 231 of file UniqueConstant.h. |
|
return the storage unit name; the name is interrogated from SU; dynamic access. Definition at line 226 of file UniqueConstant.h. |
|
return the storage unit symbol; the symbol is interrogated from SU; static access. Definition at line 221 of file UniqueConstant.h. |
|
return the storage unit symbol; the symbol is interrogated from SU; dynamic access. Definition at line 215 of file UniqueConstant.h. |
|
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. |
|
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. |
|
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. |
|
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. |
|
return the value in the storage unit; The stored value is returned without recalculation. Definition at line 134 of file UniqueConstant.h. |
|
abs function generates new object to be returned; Definition at line 297 of file UniqueConstant.h. |
|
ceil function generates new object to be returned; Definition at line 304 of file UniqueConstant.h. |
|
floor function generates new object to be returned; Definition at line 311 of file UniqueConstant.h. |
|
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. |
|
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. |
|
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. |
|
frexp function generates new object to be returned; Definition at line 334 of file UniqueConstant.h. |
|
ldexp function generates new object to be returned; Definition at line 344 of file UniqueConstant.h. |
|
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. |
|
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. |
|
* operator for factor arranged BEFORE Variable generates new object to be returned; Definition at line 289 of file UniqueConstant.h. |
|
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. |
|
the pow function with rational exponent NOTE: Rational<>::convert does not work!! Definition at line 873 of file UniqueConstant.h. |
|
the sqrt function use as sqrt (v), with v being an singleton constant Definition at line 905 of file UniqueConstant.h. |
|
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. |
|
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. |