#include <UniqueConstant.h>
Public Types | |
typedef unit::CheckUnit< unit::Unit< BT >, SU >::Check | Unit |
check SU and make the storage unit known as the Unit | |
Public Member Functions | |
ST | value (void) const |
return the value in the storage unit; | |
ST | standard_value (void) const |
return the value in the standard unit; | |
template<class NU> ST | value (const unit::NonPrefixable< BT, NU > &) const |
return the value in a NonPrefixable unit NonPrefixable<BT, NU, ST>; | |
template<class NU, class P> ST | value (const unit::Prefixed< unit::Prefixable< BT, NU >, P > &) const |
return the value in a Prefixed unit; | |
template<class CUL, class EL> ST | value (const unit::Composed< unit::ComposeBase< BT, CUL >, 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 |
binary operator- | |
Variable< PQ, SU > | operator * (const ST factor) const |
operator* for right hand side 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 DIM1, class BT1, class UL1, class DU1, class SU1> bool | operator== (const Q1< Quantity< DIM1, BT1, UL1, DU1, ST >, SU1 > &rhs_variable) const |
equality | |
bool | operator== (const Dynamic< ST > &dynamic) const |
equality | |
bool | operator!= (const UniqueConstant &rhs_variable) const |
inequality | |
template<template< class, class > class Q1, class SU1> bool | operator!= (const Q1< PQ, SU1 > &rhs_variable) const |
inequality | |
template<template< class, class > class Q1, class DIM1, class BT1, class UL1, class DU1, class SU1> bool | operator!= (const Q1< Quantity< DIM1, BT1, UL1, DU1, ST >, SU1 > &rhs_variable) const |
inequality | |
bool | operator!= (const Dynamic< ST > &dynamic) const |
inequality | |
bool | operator> (const UniqueConstant &rhs_variable) const |
comparison: greater than | |
template<template< class, class > class Q1, class SU1> bool | operator> (const Q1< PQ, SU1 > &rhs_variable) const |
comparison: greater than | |
template<template< class, class > class Q1, class DIM1, class BT1, class UL1, class DU1, class SU1> bool | operator> (const Q1< Quantity< DIM1, BT1, UL1, DU1, ST >, SU1 > &rhs_variable) const |
comparison: greater than | |
bool | operator> (const Dynamic< ST > &dynamic) const |
comparison: greater than | |
bool | operator< (const UniqueConstant &rhs_variable) const |
comparison: less than | |
template<template< class, class > class Q1, class SU1> bool | operator< (const Q1< PQ, SU1 > &rhs_variable) const |
comparison: less than | |
template<template< class, class > class Q1, class DIM1, class BT1, class UL1, class DU1, class SU1> bool | operator< (const Q1< Quantity< DIM1, BT1, UL1, DU1, ST >, SU1 > &rhs_variable) const |
comparison: less than | |
bool | operator< (const Dynamic< ST > &dynamic) const |
comparison: less than | |
bool | operator>= (const UniqueConstant &rhs_variable) const |
comparison: greater equal | |
template<template< class, class > class Q1, class SU1> bool | operator>= (const Q1< PQ, SU1 > &rhs_variable) const |
comparison: greater equal | |
template<template< class, class > class Q1, class DIM1, class BT1, class UL1, class DU1, class SU1> bool | operator>= (const Q1< Quantity< DIM1, BT1, UL1, DU1, ST >, SU1 > &rhs_variable) const |
comparison: greater equal | |
bool | operator>= (const Dynamic< ST > &dynamic) const |
comparison: greater equal | |
bool | operator<= (const UniqueConstant &rhs_variable) const |
comparison: less equal | |
template<template< class, class > class Q1, class SU1> bool | operator<= (const Q1< PQ, SU1 > &rhs_variable) const |
comparison: less equal | |
template<template< class, class > class Q1, class DIM1, class BT1, class UL1, class DU1, class SU1> bool | operator<= (const Q1< Quantity< DIM1, BT1, UL1, DU1, ST >, SU1 > &rhs_variable) const |
comparison: less equal | |
bool | operator<= (const Dynamic< ST > &dynamic) const |
comparison: 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 | |
template<class T> Dynamic< ST > | pow (const T &exp) const |
the alternative pow function with dynamic 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 |
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; | |
Public Attributes | |
GenerateVariable< UniqueConstant, BSUtilities::Rational< I, long(1)> >::Mul | pow )(typename Loki::Int2Type< I >) |
the alternative pow function with static integer exponent | |
Private Types | |
typedef dimension::Dimension< BSUtilities::Rational< RL_N, RL_D >, BSUtilities::Rational< RM_N, RM_D >, BSUtilities::Rational< RT_N, RT_D >, BSUtilities::Rational< RE_N, RE_D >, BSUtilities::Rational< RTE_N, RTE_D >, BSUtilities::Rational< RA_N, RA_D >, BSUtilities::Rational< RLU_N, RLU_D > > | DIM |
the dimension | |
typedef Quantity< DIM, BT, UL, DU, ST > | PQ |
the parent quantity; | |
typedef UniqueConstant< Quantity< DIM, BT, UL, 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 | |
GenerateVariable< UniqueConstant, Loki::NullType >::Inv | operator/ (const ST numerator, const UniqueConstant &factor) |
division of a number by a singleton constant | |
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 58 of file UniqueConstant.h.
|
the dimension make the dimension known as DIM Definition at line 86 of file UniqueConstant.h. |
|
the parent quantity; make the parent quantity known as PQ. Definition at line 91 of file UniqueConstant.h. |
|
the UniqueConstant itself;
Definition at line 94 of file UniqueConstant.h. |
|
check SU and make the storage unit known as the Unit parameter SU is checked to be subclassed from Unit<BT>; this ensures that SU (a) is a unit, and (b) is connected to PQ through base unit type BT. Definition at line 109 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 arguments does have an Add typedef, thus, Q does not need to be specified. Definition at line 737 of file UniqueConstant.h. |
|
operator* for right hand side multiplication with ST generates new object; can be chained as in a * b * c; Definition at line 290 of file UniqueConstant.h. |
|
inequality compares to a right hand side operand being a Dynamic; this is necessary since there is no copy construction (conversion) from Dynamic to UniqueConstant, thus, a separate function needs to be provided; compares the values in the standard unit; Definition at line 418 of file UniqueConstant.h. References quantity::Dynamic< ST >::_ra_d, quantity::Dynamic< ST >::_ra_n, quantity::Dynamic< ST >::_re_d, quantity::Dynamic< ST >::_re_n, quantity::Dynamic< ST >::_rl_d, quantity::Dynamic< ST >::_rl_n, quantity::Dynamic< ST >::_rlu_d, quantity::Dynamic< ST >::_rlu_n, quantity::Dynamic< ST >::_rm_d, quantity::Dynamic< ST >::_rm_n, quantity::Dynamic< ST >::_rt_d, quantity::Dynamic< ST >::_rt_n, quantity::Dynamic< ST >::_rte_d, quantity::Dynamic< ST >::_rte_n, and quantity::Dynamic< ST >::value(). |
|
inequality compares to a right hand side operand being a general quantity; compares the values in the standard unit; to check dimension, the standardization call is generated through a compile time check; this should handle generated transient quantities as rhs argument. Definition at line 402 of file UniqueConstant.h. |
|
inequality compares two objects of 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 389 of file UniqueConstant.h. |
|
inequality compares objects of identical types; use value to retrieve the variable value of the right hand side Constant and directly compare to variable_value. Definition at line 379 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 226 of file UniqueConstant.h. |
|
operator+ can be chained as in a + b + c; Definition at line 272 of file UniqueConstant.h. |
|
unary+ operator returns a Variable object with the same dimension and other characteristics and same value. Definition at line 254 of file UniqueConstant.h. |
|
binary operator- can be chained as in a - b - c; forwards to addition to Variable Definition at line 282 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 263 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 arguments does have an Sub typedef, thus, Q does not need to be specified. Definition at line 752 of file UniqueConstant.h. |
|
operator/ for division by ST generates new object; can be chained as in a * b / c; Definition at line 298 of file UniqueConstant.h. |
|
comparison: less than compares to a right hand side operand being a Dynamic; this is necessary since there is no copy construction (conversion) from Dynamic to UniqueConstant, thus, a separate function needs to be provided; compares the values in the standard unit; Definition at line 560 of file UniqueConstant.h. |
|
comparison: less than compares to a right hand side operand being a general quantity; compares the values in the standard unit; to check dimension, the standardization call is generated through a compile time check; this should handle generated transient quantities as rhs argument. Definition at line 544 of file UniqueConstant.h. |
|
comparison: less than compares two objects of 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 531 of file UniqueConstant.h. |
|
comparison: less than compares objects of identical types; use value to retrieve the variable value of the right hand side Constant and directly compare to variable_value. Definition at line 521 of file UniqueConstant.h. |
|
comparison: less equal compares to a right hand side operand being a Dynamic; this is necessary since there is no copy construction (conversion) from Dynamic to UniqueConstant, thus, a separate function needs to be provided; compares the values in the standard unit; Definition at line 702 of file UniqueConstant.h. |
|
comparison: less equal compares to a right hand side operand being a general quantity; compares the values in the standard unit; to check dimension, the standardization call is generated through a compile time check; this should handle generated transient quantities as rhs argument. Definition at line 686 of file UniqueConstant.h. |
|
comparison: less equal compares two objects of 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 673 of file UniqueConstant.h. |
|
comparison: less equal compares objects of identical types; use value to retrieve the variable value of the right hand side Constant and directly compare to variable_value. Definition at line 663 of file UniqueConstant.h. |
|
equality compares to a right hand side operand being a Dynamic; this is necessary since there is no copy construction (conversion) from Dynamic to UniqueConstant, thus, a separate function needs to be provided; compares the values in the standard unit; Definition at line 347 of file UniqueConstant.h. References quantity::Dynamic< ST >::_ra_d, quantity::Dynamic< ST >::_ra_n, quantity::Dynamic< ST >::_re_d, quantity::Dynamic< ST >::_re_n, quantity::Dynamic< ST >::_rl_d, quantity::Dynamic< ST >::_rl_n, quantity::Dynamic< ST >::_rlu_d, quantity::Dynamic< ST >::_rlu_n, quantity::Dynamic< ST >::_rm_d, quantity::Dynamic< ST >::_rm_n, quantity::Dynamic< ST >::_rt_d, quantity::Dynamic< ST >::_rt_n, quantity::Dynamic< ST >::_rte_d, quantity::Dynamic< ST >::_rte_n, and quantity::Dynamic< ST >::value(). |
|
equality compares to a right hand side operand being a general quantity; compares the values in the standard unit; to check dimension, the standardization call is generated through a compile time check; this should handle generated transient quantities as rhs argument. Definition at line 331 of file UniqueConstant.h. |
|
equality compares two objects of 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 318 of file UniqueConstant.h. |
|
equality compares objects of identical types; use value to retrieve the variable value of the right hand side Constant and directly compare to variable_value. Definition at line 308 of file UniqueConstant.h. |
|
comparison: greater than compares to a right hand side operand being a Dynamic; this is necessary since there is no copy construction (conversion) from Dynamic to UniqueConstant, thus, a separate function needs to be provided; compares the values in the standard unit; Definition at line 489 of file UniqueConstant.h. References quantity::Dynamic< ST >::_ra_d, quantity::Dynamic< ST >::_ra_n, quantity::Dynamic< ST >::_re_d, quantity::Dynamic< ST >::_re_n, quantity::Dynamic< ST >::_rl_d, quantity::Dynamic< ST >::_rl_n, quantity::Dynamic< ST >::_rlu_d, quantity::Dynamic< ST >::_rlu_n, quantity::Dynamic< ST >::_rm_d, quantity::Dynamic< ST >::_rm_n, quantity::Dynamic< ST >::_rt_d, quantity::Dynamic< ST >::_rt_n, quantity::Dynamic< ST >::_rte_d, quantity::Dynamic< ST >::_rte_n, and quantity::Dynamic< ST >::value(). |
|
comparison: greater than compares to a right hand side operand being a general quantity; compares the values in the standard unit; to check dimension, the standardization call is generated through a compile time check; this should handle generated transient quantities as rhs argument. Definition at line 473 of file UniqueConstant.h. |
|
comparison: greater than compares two objects of 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 460 of file UniqueConstant.h. |
|
comparison: greater than compares objects of identical types; use value to retrieve the variable value of the right hand side Constant and directly compare to variable_value. Definition at line 450 of file UniqueConstant.h. |
|
comparison: greater equal compares to a right hand side operand being a Dynamic; this is necessary since there is no copy construction (conversion) from Dynamic to UniqueConstant, thus, a separate function needs to be provided; compares the values in the standard unit; Definition at line 631 of file UniqueConstant.h. References quantity::Dynamic< ST >::_ra_d, quantity::Dynamic< ST >::_ra_n, quantity::Dynamic< ST >::_re_d, quantity::Dynamic< ST >::_re_n, quantity::Dynamic< ST >::_rl_d, quantity::Dynamic< ST >::_rl_n, quantity::Dynamic< ST >::_rlu_d, quantity::Dynamic< ST >::_rlu_n, quantity::Dynamic< ST >::_rm_d, quantity::Dynamic< ST >::_rm_n, quantity::Dynamic< ST >::_rt_d, quantity::Dynamic< ST >::_rt_n, quantity::Dynamic< ST >::_rte_d, quantity::Dynamic< ST >::_rte_n, and quantity::Dynamic< ST >::value(). |
|
comparison: greater equal compares to a right hand side operand being a general quantity; compares the values in the standard unit; to check dimension, the standardization call is generated through a compile time check; this should handle generated transient quantities as rhs argument. Definition at line 615 of file UniqueConstant.h. |
|
comparison: greater equal compares two objects of 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 602 of file UniqueConstant.h. |
|
comparison: greater equal compares objects of identical types; use value to retrieve the variable value of the right hand side Constant and directly compare to variable_value. Definition at line 592 of file UniqueConstant.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 857 of file UniqueConstant.h. |
|
store the value and unit of the variable in a std::string converts to a string by template Conversion Definition at line 849 of file UniqueConstant.h. |
|
the alternative pow function with dynamic exponent returns a transient Dynamic variable with the dimension of the first argument multiplied by exp; alternative formulation; forwards action to pow function with quantity and dynamic exponent (friend functions in Dynamic for specific T's). Definition at line 807 of file UniqueConstant.h. References quantity::exp(). |
|
the alternative pow function with rational exponent returns a transient variable with the dimension of the first argument multiplied by Rational<N, D>; used as object.pow (r); forwards action to pow function with quantity and rational exponent (in namespace Quantities). Definition at line 782 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 843 of file UniqueConstant.h. |
|
the alternative sqrt function use as v.sqrt (), with v being an instantiation of a Constant Definition at line 831 of file UniqueConstant.h. |
|
return the value in the standard unit; The stored constant_value is first standardized using the Standardize () function for unit SU Definition at line 156 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 140 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 132 of file UniqueConstant.h. |
|
return the storage unit name; the name is interrogated from SU; static access. Definition at line 248 of file UniqueConstant.h. |
|
return the storage unit name; the name is interrogated from SU; dynamic access. Definition at line 243 of file UniqueConstant.h. |
|
return the storage unit symbol; the symbol is interrogated from SU; static access. Definition at line 238 of file UniqueConstant.h. |
|
return the storage unit symbol; the symbol is interrogated from SU; dynamic access. Definition at line 232 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 Standardize () function for unit SU, and then dynamically 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 206 of file UniqueConstant.h. |
|
return the value in a Composed unit; The stored value is first standardized using the Standardize () function for unit SU, and then recalculated into the Composed, which is checked against AllUnits; only the type of the Composed is used. Definition at line 192 of file UniqueConstant.h. |
|
return the value in a Prefixed unit; The stored value is first standardized using the Standardize () function for unit SU, and then recalculated into the Prefixed, which is checked against AllUnits; only the type of the Prefixed is used. Definition at line 179 of file UniqueConstant.h. |
|
return the value in a NonPrefixable unit NonPrefixable<BT, NU, ST>; The stored value is first standardized using the Standardize () function for unit SU, and then recalculated into the NonPrefixable, which is checked against AllUnits; only the type of the Prefixable is used. Definition at line 166 of file UniqueConstant.h. |
|
return the value in the storage unit; The stored value is returned without recalculation. Definition at line 150 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 100 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 765 of file UniqueConstant.h. |
|
the sqrt function use as sqrt (v), with v being an singleton constant Definition at line 817 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 123 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 117 of file UniqueConstant.h. |
|
the alternative pow function with static integer exponent returns a transient variable with the dimensions of the first argument multiplied by I; used as object.pow (r); forwards action to pow function with quantity and static integer exponent (in namespace Quantities). Definition at line 796 of file UniqueConstant.h. |