#include <Constant.h>
Public Types | |
typedef SU | Unit |
the unit of the Constant; | |
Public Member Functions | |
Constant (void) | |
default constructor | |
Constant (const ST new_value) | |
constructor | |
Constant (const ST new_value, const SU &) | |
constructor from same unit | |
Constant (const Constant &new_constant) | |
copy constructor | |
template<class NU> | Constant (const ST new_value, const NU &) |
constructor from different unit | |
Constant (const ST new_value, const std::string &unitsymbol) | |
constructor from different unit given by std::string | |
Constant (const ST new_value, const char *unitsymbol) | |
constructor from different unit given by string constant | |
template<template< class, class > class Q1, class SU1> | Constant (const Q1< PQ, SU1 > &source_quantity) |
copy constructor from quantity with different unit (conversion) | |
template<template< class, class > class Q1, class GT1, class DU1, class SU1> | Constant (const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &source_quantity) |
copy constructor from quantity with different unit (conversion) | |
ST | standard_value (void) const |
return the value in the standard unit; | |
ST | value (void) const |
return the value in the storage unit; | |
template<class NU> ST | value (const Units::NonPrefixable< GT, NU, ST > &) const |
return the value in a NonPrefixable unit NonPrefixable<GT, NU, ST>; | |
template<class NU, class P> ST | value (const Units::Prefixed< Units::Prefixable< GT, NU, ST >, P > &) const |
return the value in a Prefixed unit; | |
template<class CUL, class EL> ST | value (const Units::Composed< Units::Compound< GT, CUL, ST >, EL > &) const |
return the value in a Composed unit; | |
ST | value (const std::string &symbol) |
return the value in a unit with symbol string symbolstring; | |
template<class NU> Constant< PQ, NU > | operator() (const NU &) const |
return the value in a Constant object with unit NU; | |
const std::string | unitsymbol (void) const |
return the storage unit symbol; | |
const std::string | unitname (void) const |
return the storage unit name; | |
Variable< PQ, SU > | operator+ (void) const |
unary + operator | |
Variable< PQ, SU > | operator- (void) const |
unary - operator | |
template<class Q> Variable< PQ, SU > | operator+ (const Q &new_variable) const |
+ operator | |
template<class Q> Variable< PQ, SU > | operator- (const Q &new_variable) const |
| |
Variable< PQ, SU > | operator * (const ST factor) const |
* operator for multiplication with ST | |
Variable< PQ, SU > | operator/ (const ST factor) const |
/ operator for division by ST | |
bool | operator== (const Constant &rhs_variable) const |
equality | |
template<template< class, class > class Q1, class SU1> bool | operator== (const Q1< PQ, SU1 > &rhs_variable) const |
equality | |
template<template< class, class > class Q1, class GT1, class DU1, class SU1> bool | operator== (const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &rhs_variable) const |
equality | |
template<template< class, class > class Q1, class GT1, class Head1, class Tail1, class DU1, class SU1> bool | operator== (const Q1< Quantity< GT1, Loki::Typelist< Head1, Tail1 >, DU1, ST >, SU1 > &rhs_variable) const |
equality | |
bool | operator!= (const Constant &rhs_variable) const |
!equality | |
template<template< class, class > class Q1, class SU1> bool | operator!= (const Q1< PQ, SU1 > &rhs_variable) const |
!equality | |
template<template< class, class > class Q1, class GT1, class DU1, class SU1> bool | operator!= (const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &rhs_variable) const |
!equality | |
template<template< class, class > class Q1, class GT1, class Head1, class Tail1, class DU1, class SU1> bool | operator!= (const Q1< Quantity< GT1, Loki::Typelist< Head1, Tail1 >, DU1, ST >, SU1 > &rhs_variable) const |
!equality | |
bool | operator> (const Constant &rhs_variable) const |
greater than | |
template<template< class, class > class Q1, class SU1> bool | operator> (const Q1< PQ, SU1 > &rhs_variable) const |
greater than | |
template<template< class, class > class Q1, class GT1, class DU1, class SU1> bool | operator> (const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &rhs_variable) const |
greater than | |
template<template< class, class > class Q1, class GT1, class Head1, class Tail1, class DU1, class SU1> bool | operator> (const Q1< Quantity< GT1, Loki::Typelist< Head1, Tail1 >, DU1, ST >, SU1 > &rhs_variable) const |
greater than | |
bool | operator< (const Constant &rhs_variable) const |
less than | |
template<template< class, class > class Q1, class SU1> bool | operator< (const Q1< PQ, SU1 > &rhs_variable) const |
less than | |
template<template< class, class > class Q1, class GT1, class DU1, class SU1> bool | operator< (const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &rhs_variable) const |
less than | |
template<template< class, class > class Q1, class GT1, class Head1, class Tail1, class DU1, class SU1> bool | operator< (const Q1< Quantity< GT1, Loki::Typelist< Head1, Tail1 >, DU1, ST >, SU1 > &rhs_variable) const |
less than | |
bool | operator>= (const Constant &rhs_variable) const |
greater equal | |
template<template< class, class > class Q1, class SU1> bool | operator>= (const Q1< PQ, SU1 > &rhs_variable) const |
greater equal | |
template<template< class, class > class Q1, class GT1, class DU1, class SU1> bool | operator>= (const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &rhs_variable) const |
greater equal | |
template<template< class, class > class Q1, class GT1, class Head1, class Tail1, class DU1, class SU1> bool | operator>= (const Q1< Quantity< GT1, Loki::Typelist< Head1, Tail1 >, DU1, ST >, SU1 > &rhs_variable) const |
greater equal | |
bool | operator<= (const Constant &rhs_variable) const |
less equal | |
template<template< class, class > class Q1, class SU1> bool | operator<= (const Q1< PQ, SU1 > &rhs_variable) const |
less equal | |
template<template< class, class > class Q1, class GT1, class DU1, class SU1> bool | operator<= (const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &rhs_variable) const |
less equal | |
template<template< class, class > class Q1, class GT1, class Head1, class Tail1, class DU1, class SU1> bool | operator<= (const Q1< Quantity< GT1, Loki::Typelist< Head1, Tail1 >, DU1, ST >, SU1 > &rhs_variable) const |
less equal | |
template<class Q> GenerateVariable< Constant, Q >::Add | operator * (const Q &factor) |
multiplication of constant with a quantity | |
template<class Q> GenerateVariable< Constant, Q >::Sub | operator/ (const Q &factor) |
division of a constant by a quantity | |
template<long N, long D> GenerateVariable< Constant, BSUtilities::Rational< N, D > >::Mult | pow (const BSUtilities::Rational< N, D > &) |
the alternative pow function with rational exponent | |
GenerateVariable< Constant, BSUtilities::Rational< 1, 2 > >::Mult | sqrt (void) |
the alternative sqrt function | |
std::ostream & | print_value (std::ostream &os) const |
print the value and the unit of the constant | |
void | operator>> (std::string &str) const |
store the value and unit of the variable in a std::string | |
std::ostream & | operator>> (std::ostream &os) const |
print the variable | |
Static Public Member Functions | |
std::string | Unitsymbol (void) |
return the storage unit symbol; | |
std::string | Unitname (void) |
return the storage unit name; | |
Private Types | |
typedef Units::CheckUnit< Units::Unit< GT, ST >, SU >::Check | Checked |
check SU | |
typedef Quantity< GT, Loki::Typelist< Head, Tail >, DU, ST > | PQ |
the parent quantity; | |
Private Member Functions | |
Constant & | operator= (const Constant &) |
assignment | |
template<class TQ> Constant & | operator= (const TQ &) |
assignment from other type | |
Private Attributes | |
ST | constant_value |
the value of the Constant in the unit SU; | |
Friends | |
Variable< PQ, SU > | operator * (const ST factor, const Constant &constant) |
* operator for factor arranged BEFORE Variable | |
Variable< PQ, SU > | abs (const Constant &constant) |
abs function | |
Variable< PQ, SU > | ceil (const Constant &constant) |
ceil function | |
Variable< PQ, SU > | floor (const Constant &constant) |
floor function | |
Variable< PQ, SU > | modf (const Constant &constant, Variable< PQ, SU > *integral) |
modf function | |
Variable< PQ, SU > | frexp (const Constant &constant, int *exponent) |
frexp function | |
Variable< PQ, SU > | ldexp (const Constant &constant, int *exponent) |
ldexp function | |
template<template< class, class > class Q1, class SU1> Variable< PQ, SU > | fmod (const Constant &constant, const Q1< PQ, SU1 > &quantity) |
fmod function | |
template<template< class, class > class Q1, class GT1, class DU1, class SU1> Variable< PQ, SU > | fmod (const Constant &constant, const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &quantity) |
fmod function | |
template<template< class, class > class Q1, class GT1, class DU1, class SU1> Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > | fmod (const Q1< Quantity< GT1, Loki::Typelist< Units::NonPrefixable< GT1, Units::GenericUnit, ST >, Loki::NullType >, DU1, ST >, SU1 > &variable1, const Constant &constant) |
fmod function | |
GenerateVariable< Constant, Loki::NullType >::Neg | operator/ (const ST numerator, const Constant &factor) |
division of a number by a constant | |
template<long N, long D> GenerateVariable< Constant, BSUtilities::Rational< N, D > >::Mult | pow (const Constant &variable, const BSUtilities::Rational< N, D > &) |
the pow function with rational exponent | |
GenerateVariable< Constant, BSUtilities::Rational< 1, 2 > >::Mult | sqrt (const Constant &constant) |
the sqrt function |
the parent quantity is required to be a Quantity, while there is no requirement on SU; the constant is derived from the parent quantity.
Definition at line 52 of file Constant.h.
|
check SU parameter SU is checked to be subclassed from Unit<GT, ST>; this ensures that SU (a) is a unit, and (b) is connected to PQ through the group type GT. Definition at line 62 of file Constant.h. |
|
the parent quantity; make the parent quantity known as PQ. Definition at line 67 of file Constant.h. Referenced by Constant(). |
|
the unit of the Constant; make SU known as the Unit of the Constant Definition at line 73 of file Constant.h. Referenced by Constant(). |
|
copy constructor from quantity with different unit (conversion) specialized version for a quantity derived from Quantity with a unit list typical for a generated quantity using a GenericUnit; this special case is the only exception when a quantity of different group type can be converted into the target Constant, provided the dimensions of the two objects are equal. This is tested with CheckSecondDimension. Definition at line 199 of file Constant.h. |
|
copy constructor from quantity with different unit (conversion) specialized version for same parent quantity PQ; used if PQ of the target Constant to be constructed and that of the source quantity are identical; then we can be sure that the value of the source quantity can be recalculated into the unit of the target Constant; the result of this calculation is used in an initializer. The name and the symbol of the quantity are copied in the body of the function. The form of Q1<> must satisfy the template parameter sequence for a Constant or other classes similarly derived fom Quantity; this prohibits the conversion from general objects (string etc.). Definition at line 179 of file Constant.h. |
|
constructor from different unit given by string constant takes a std:string to define the symbol of the unit as the second parameter and recalculates the value into the storage unit Unit; first initializes base class; findBySymbol may throw a UnitMismatch exception. Definition at line 157 of file Constant.h. References PQ. |
|
constructor from different unit given by std::string takes a std:string to define the symbol of the unit as the second parameter and recalculates the value into the storage unit SU; first initializes base class; findBySymbol may throw a UnitMismatch exception. Definition at line 142 of file Constant.h. References PQ. |
|
constructor from different unit takes an instance of a unit of parameter type NU as the second parameter and recalculates the value into the storage unit SU; check that NU is listed in AllUnits; only the type NU is used; first initializes base class; Note: use only if NU is a concrete, not an abstract type. Definition at line 130 of file Constant.h. References PQ. |
|
copy constructor initialize the parent quantity PQ; then copy the value, the name and symbol string of new_constant; Definition at line 115 of file Constant.h. References PQ. |
|
constructor from same unit takes an instance of the storage unit as the second parameter and uses value directly. Definition at line 108 of file Constant.h. |
|
constructor Set the value to new_value and assume this to be in storage unit SU. Definition at line 102 of file Constant.h. |
|
default constructor Set the value to 0.0 and assume this to be in storage unit SU. Definition at line 97 of file Constant.h. |
|
multiplication of constant with a quantity the type of the result is generated through GenerateVariable by adding the dimensions of the two quantities; only GenerateVariable with two quantities as parameters does have an Add typedef, thus, Q does not need to be specified. Definition at line 928 of file Constant.h. |
|
* operator for multiplication with ST generates new object; can be chained as in a * b * c; Definition at line 363 of file Constant.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 636 of file Constant.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 612 of file Constant.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 600 of file Constant.h. |
|
!equality special case for identical types; use value to retrieve the constant_value of the right hand side Constant. Definition at line 590 of file Constant.h. |
|
return the value in a Constant object with unit NU; Generates an object of the desired type and stores constant_value (which is in unit SU); recalculation occurs within the constructor of the new object. This is a conversion into another object with the new unit NU. Definition at line 300 of file Constant.h. |
|
+ operator can be chained as in a + b + c; Definition at line 346 of file Constant.h. |
|
unary + operator returns a Variable object with the same dimension and other characteristics and same value. Definition at line 328 of file Constant.h. |
|
can be chained as in a + b - c; Definition at line 355 of file Constant.h. |
|
unary - operator returns a Variable object with the same dimension and other characteristics and same value with changed sign. Definition at line 337 of file Constant.h. |
|
division of a constant by a quantity the type of the result is generated through GenerateVariable by subtracting the dimensions of the two quantities; only GenerateVariable with two quantities as parameters does have an Sub typedef, thus, Q does not need to be specified. Definition at line 942 of file Constant.h. |
|
/ operator for division by ST generates new object; can be chained as in a * b / c; Definition at line 371 of file Constant.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 770 of file Constant.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 746 of file Constant.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 standard unit; we can be sure that values can be recalculated between SU and SU1; Definition at line 734 of file Constant.h. |
|
less than special case for identical types; use value to retrieve the constant_value of the right hand side Constant. Definition at line 724 of file Constant.h. |
|
less equal special case for lhs operand being a generated quantity with a generic unit and the same dimension as the rhs operand; compares the values in the standard unit; to check that we have a generated quantity as lhs operator, it is checked that its unit is of the type typical for such a quantity; to check dimension, the standardization call is generated through a compile time check; Definition at line 904 of file Constant.h. |
|
less equal special case for rhs operand being a generated quantity with a generic unit and the same dimension as the lhs operand; compares the values in the standard unit; to check dimension, the standardization call is generated through a compile time check; Definition at line 880 of file Constant.h. |
|
less equal special case for types from the same parent quantity PQ, but possibly different storage units SU and SU1; compares the values in the standard unit; we can be sure that values can be recalculated between SU and SU1; Definition at line 868 of file Constant.h. |
|
less equal special case for identical types; use value to retrieve the constant_value of the right hand side Constant. Definition at line 858 of file Constant.h. |
|
assignment from other type only declaration, never defined and private |
|
assignment only declaration, never defined and private |
|
equality special case for lhs operand being a generated quantity with a generic unit and the same dimension as the rhs operand; compares the values in the standard unit; to check that we have a generated quantity as lhs operator, it is checked that its unit is of the type typical for such a quantity; to check dimension, the standardization call is generated through a compile time check; Definition at line 569 of file Constant.h. |
|
equality special case for rhs operand being a generated quantity with a generic unit and the same dimension as the lhs operand; compares the values in the standard unit; to check dimension, the standardization call is generated through a compile time check; Definition at line 544 of file Constant.h. |
|
equality special case for types from the same parent quantity PQ, but possibly different storage units SU and SU1; compares the values in the standard unit; we can be sure that values can be recalculated between SU and SU1; Definition at line 532 of file Constant.h. |
|
equality special case for identical types; use value to retrieve the constant_value of the right hand side Constant. Definition at line 522 of file Constant.h. |
|
greater than special case for lhs operand being a generated quantity with a generic unit and the same dimension as the rhs operand; compares the values in the standard unit; to check that we have a generated quantity as lhs operator, it is checked that its unit is of the type typical for such a quantity; to check dimension, the standardization call is generated through a compile time check; Definition at line 703 of file Constant.h. |
|
greater than special case for rhs operand being a generated quantity with a generic unit and the same dimension as the lhs operand; compares the values in the standard unit; to check dimension, the standardization call is generated through a compile time check; Definition at line 679 of file Constant.h. |
|
greater than special case for types from the same parent quantity PQ, but possibly different storage units SU and SU1; compares the values in the standard unit; we can be sure that values can be recalculated between SU and SU1; Definition at line 667 of file Constant.h. |
|
greater than special case for identical types; use value to retrieve the constant_value of the right hand side Constant. Definition at line 657 of file Constant.h. |
|
greater equal special case for lhs operand being a generated quantity with a generic unit and the same dimension as the rhs operand; compares the values in the standard unit; to check that we have a generated quantity as lhs operator, it is checked that its unit is of the type typical for such a quantity; to check dimension, the standardization call is generated through a compile time check; Definition at line 837 of file Constant.h. |
|
greater equal special case for rhs operand being a generated quantity with a generic unit and the same dimension as the lhs operand; compares the values in the standard unit; to check dimension, the standardization call is generated through a compile time check; Definition at line 813 of file Constant.h. |
|
greater equal special case for types from the same parent quantity PQ, but possibly different storage units SU and SU1; compares the values in the standard unit; we can be sure that values can be recalculated between SU and SU1; Definition at line 801 of file Constant.h. |
|
greater equal special case for identical types; use value to retrieve the constant_value of the right hand side Constant. Definition at line 791 of file Constant.h. |
|
print the variable used if the variable is placed to the left of operator>>; calls print_value () indirectly through Quantity<>::print, thus including name and symbol of quantity if requested. Definition at line 1036 of file Constant.h. |
|
store the value and unit of the variable in a std::string converts to a string by template Conversion Definition at line 1028 of file Constant.h. |
|
the alternative pow function with rational exponent NOTE: Rational<>::convert does not work!! Definition at line 984 of file Constant.h. |
|
print the value and the unit of the constant places these items on the ostream os and returns the reference to the os object, thus allowing chaining of operator<< calls. Definition at line 1022 of file Constant.h. |
|
the alternative sqrt function use as v.sqrt (), with v being an instantiation of a Constant Definition at line 1011 of file Constant.h. |
|
return the value in the standard unit; The stored constant_value is standardized using the Standard () function of the unit SU Definition at line 219 of file Constant.h. |
|
return the storage unit name; the name is interrogated from SU; static access. Definition at line 322 of file Constant.h. |
|
return the storage unit name; the name is interrogated from SU; dynamic access. Definition at line 317 of file Constant.h. |
|
return the storage unit symbol; the symbol is interrogated from SU; static access. Definition at line 312 of file Constant.h. |
|
return the storage unit symbol; the symbol is interrogated from SU; dynamic access. Definition at line 306 of file Constant.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 282 of file Constant.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 266 of file Constant.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 249 of file Constant.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 234 of file Constant.h. |
|
return the value in the storage unit; The stored constant_value is returned without recalculation. Definition at line 225 of file Constant.h. |
|
abs function generates new object to be returned; Definition at line 388 of file Constant.h. |
|
ceil function generates new object to be returned; Definition at line 397 of file Constant.h. |
|
floor function generates new object to be returned; Definition at line 406 of file Constant.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 498 of file Constant.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 471 of file Constant.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 456 of file Constant.h. |
|
frexp function generates new object to be returned; Definition at line 431 of file Constant.h. |
|
ldexp function generates new object to be returned; Definition at line 441 of file Constant.h. |
|
modf function generates new object to be returned; NOTE: make second variable from different type derived from parent quantity Definition at line 418 of file Constant.h. |
|
* operator for factor arranged BEFORE Variable generates new object to be returned; Definition at line 380 of file Constant.h. |
|
division of a number by a constant the type of the result is generated through GenerateVariable by negating the dimension of the variable; Definition at line 954 of file Constant.h. |
|
the pow function with rational exponent NOTE: Rational<>::convert does not work!! Definition at line 968 of file Constant.h. |
|
the sqrt function use as sqrt (v), with v being an instantiation of a Constant Definition at line 999 of file Constant.h. |
|
the value of the Constant in the unit SU; This data member is private, and can only be accessed through the member functions value (); being set during construction of an object. Definition at line 81 of file Constant.h. |