#include <Variable.h>
Public 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 Loki::Typelist< DDH, DDT > | DDL |
the dedimensionalizer parameter type list type | |
typedef Loki::TL::TypeAt< DDL, 0 >::Result | DDP |
the parameters to the dedimensionalizing functor as a type | |
typedef Loki::Functor< R, DDL > | DD |
the dedimensionalizer type | |
typedef Quantity< DIM, BT, UL, DU, ST > | ABQ |
the abstract base quantity type | |
typedef Variable< ABQ, SU, DD > | V |
the variable type | |
typedef ABQ | PQ |
the parent quantity; | |
typedef BSUtilities::IF< BSUtilities::SameType< DD, typename DefaultDedimensionalizer< PQ, SU >::F >::sameType, DedimReturn< PQ, SU >, V >::RET | DDR |
the return variable type of dedimensionalizer | |
typedef unit::CheckUnit< unit::Unit< BT >, SU >::Check | Unit |
check SU and if ok, make the storage unit SU known as Unit | |
Public Member Functions | |
Variable (void) | |
default constructor | |
Variable (const DD &dedimensionalizer) | |
constructor with only dedimensionalizer function | |
Variable (const ST value) | |
constructor with only a value | |
Variable (const ST value, const DD &dedimensionalizer) | |
constructor with a value and dedimensionalizer | |
Variable (const ST value, const SU &) | |
constructor from same unit | |
Variable (const ST value, const SU &, const DD &dedimensionalizer) | |
constructor from same unit and dedimensionalizer | |
template<class NU> | Variable (const ST value, const NU &) |
constructor from different unit | |
Variable (const ST value, const std::string &symbol) | |
constructor from different unit given by std::string | |
Variable (const ST value, const char *symbol) | |
constructor from different unit given by string constant | |
template<template< class, class, class > class Q1> | Variable (const Q1< PQ, SU, DD > &quantity) |
copy constructor | |
template<template< class, class, class > class Q1, class SU1, class DD1> | Variable (const Q1< PQ, SU1, DD1 > &quantity) |
copy constructor from quantity with different unit (conversion) | |
template<template< class, class, class > class Q1, class BT1, class DIM1, class DU1, class SU1, class DD1> | Variable (const Q1< Quantity< DIM1, BT1, Loki::Typelist< unit::NonPrefixable< BT1, unit::GenericUnit >, Loki::NullType >, DU1, ST >, SU1, DD1 > &quantity) |
copy constructor from quantity with different unit (conversion) | |
template<template< class, class, class > class Q1, class PQ1, class SU1, class DD1> | Variable (const Q1< PQ1, SU1, DD1 > &) |
copy constructor from some other quantity Q1 | |
Variable (const Dynamic< ST > &dynamic) | |
copy construction from Dynamic | |
Variable & | operator= (const Variable &new_variable) |
assignment operator | |
template<template< class, class, class > class Q1, class SU1, class DD1> Variable & | operator= (const Q1< PQ, SU1, DD1 > &quantity) |
assignment operator | |
template<template< class, class, class > class Q1, class PQ1, class SU1, class DD1> Variable & | operator= (const Q1< PQ1, SU1, DD1 > &quantity) |
assignment operator | |
template<template< class, class, class > class Q1, class BT1, class DIM1, class DU1, class SU1, class DD1> Variable & | operator= (const Q1< Quantity< DIM1, BT1, Loki::Typelist< unit::NonPrefixable< BT1, unit::GenericUnit >, Loki::NullType >, DU1, ST >, SU1, DD1 > &quantity) |
assignment operator | |
Variable & | operator= (const Dynamic< ST > &dynamic) |
assignment from Dynamic | |
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>; | |
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 & | operator+= (const Variable &variable) |
operator+= | |
template<template< class, class, class > class Q1, class SU1, class DD1> Variable & | operator+= (const Q1< PQ, SU1, DD1 > &quantity) |
operator+= | |
template<template< class, class, class > class Q1, class BT1, class DIM1, class DU1, class SU1, class DD1> Variable & | operator+= (const Q1< Quantity< DIM1, BT1, Loki::Typelist< unit::NonPrefixable< BT1, unit::GenericUnit >, Loki::NullType >, DU1, ST >, SU1, DD1 > &quantity) |
operator+= | |
template<template< class, class, class > class Q1, class PQ1, class SU1, class DD1> Variable & | operator+= (const Q1< PQ1, SU1, DD1 > &quantity) |
operator+= | |
Variable & | operator-= (const Variable &new_variable) |
operator-= | |
template<template< class, class, class > class Q1, class SU1, class DD1> Variable & | operator-= (const Q1< PQ, SU1, DD1 > &quantity) |
operator-= | |
template<template< class, class, class > class Q1, class BT1, class DIM1, class DU1, class SU1, class DD1> Variable & | operator-= (const Q1< Quantity< DIM1, BT1, Loki::Typelist< unit::NonPrefixable< BT1, unit::GenericUnit >, Loki::NullType >, DU1, ST >, SU1, DD1 > &quantity) |
operator-= | |
template<template< class, class, class > class Q1, class PQ1, class SU1, class DD1> Variable & | operator-= (const Q1< PQ1, SU1, DD1 > &quantity) |
operator-= | |
Variable & | operator *= (const ST factor) |
operator*= for multiplication with ST and assignment | |
Variable & | operator/= (const ST divisor) |
operator/= for division by ST and assignment | |
Variable | operator+ (void) const |
unary operator+ | |
Variable | operator- (void) const |
unary operator- | |
template<template< class, class, class > class Q1, class DIM1, class BT1, class UL1, class DU1, class SU1, class DD1> Variable | operator+ (const Q1< Quantity< DIM1, BT1, UL1, DU1, ST >, SU1, DD1 > &quantity) const |
binary operator+ | |
Variable | operator+ (const Dynamic< ST > &quantity) const |
binary operator+ | |
template<template< class, class, class > class Q1, class DIM1, class BT1, class UL1, class DU1, class SU1, class DD1> Variable | operator- (const Q1< Quantity< DIM1, BT1, UL1, DU1, ST >, SU1, DD1 > &quantity) const |
binary operator- | |
Variable | operator- (const Dynamic< ST > &quantity) const |
binary operator- | |
Variable | operator * (const ST factor) const |
operator* for right hand multiplication with ST | |
Variable | operator/ (const ST divisor) const |
operator/ for division by ST | |
bool | operator== (const Variable &rhs_variable) const |
equality | |
template<template< class, class, class > class Q1, class SU1, class DD1> bool | operator== (const Q1< PQ, SU1, DD1 > &rhs_variable) const |
equality | |
template<template< class, class, class > class Q1, class DIM1, class BT1, class UL1, class DU1, class SU1, class DD1> bool | operator== (const Q1< Quantity< DIM1, BT1, UL1, DU1, ST >, SU1, DD1 > &rhs_variable) const |
equality | |
bool | operator!= (const Variable &rhs_variable) const |
inequality | |
template<template< class, class, class > class Q1, class SU1, class DD1> bool | operator!= (const Q1< PQ, SU1, DD1 > &rhs_variable) const |
inequality | |
template<template< class, class, class > class Q1, class DIM1, class BT1, class UL1, class DU1, class SU1, class DD1> bool | operator!= (const Q1< Quantity< DIM1, BT1, UL1, DU1, ST >, SU1, DD1 > &rhs_variable) const |
inequality | |
bool | operator> (const Variable &rhs_variable) const |
comparison: greater than | |
template<template< class, class, class > class Q1, class SU1, class DD1> bool | operator> (const Q1< PQ, SU1, DD1 > &rhs_variable) const |
comparison: greater than | |
template<template< class, class, class > class Q1, class DIM1, class BT1, class UL1, class DU1, class SU1, class DD1> bool | operator> (const Q1< Quantity< DIM1, BT1, UL1, DU1, ST >, SU1, DD1 > &rhs_variable) const |
comparison: greater than | |
bool | operator< (const Variable &rhs_variable) const |
comparison: less than | |
template<template< class, class, class > class Q1, class SU1, class DD1> bool | operator< (const Q1< PQ, SU1, DD1 > &rhs_variable) const |
comparison: less than | |
template<template< class, class, class > class Q1, class DIM1, class BT1, class UL1, class DU1, class SU1, class DD1> bool | operator< (const Q1< Quantity< DIM1, BT1, UL1, DU1, ST >, SU1, DD1 > &rhs_variable) const |
comparison: less than | |
bool | operator>= (const Variable &rhs_variable) const |
comparison: greater equal | |
template<template< class, class, class > class Q1, class SU1, class DD1> bool | operator>= (const Q1< PQ, SU1, DD1 > &rhs_variable) const |
comparison: greater equal | |
template<template< class, class, class > class Q1, class DIM1, class BT1, class UL1, class DU1, class SU1, class DD1> bool | operator>= (const Q1< Quantity< DIM1, BT1, UL1, DU1, ST >, SU1, DD1 > &rhs_variable) const |
comparison: greater equal | |
bool | operator<= (const Variable &rhs_variable) const |
comparison: less equal | |
template<template< class, class, class > class Q1, class SU1, class DD1> bool | operator<= (const Q1< PQ, SU1, DD1 > &rhs_variable) const |
comparison: less equal | |
template<template< class, class, class > class Q1, class DIM1, class BT1, class UL1, class DU1, class SU1, class DD1> bool | operator<= (const Q1< Quantity< DIM1, BT1, UL1, DU1, ST >, SU1, DD1 > &rhs_variable) const |
comparison: less equal | |
template<class Q> GenerateVariable< Variable, Q >::Add | operator * (const Q &factor) const |
multiplication of variables with a quantity | |
template<class Q> GenerateVariable< Variable, Q >::Sub | operator/ (const Q &factor) const |
division of a variable by a quantity | |
template<long N, long D> GenerateVariable< Variable, BSUtilities::Rational< N, D > >::Mult | pow (const BSUtilities::Rational< N, D > &) const |
the pow function with static rational exponent | |
template<class T> Dynamic< ST > | pow (const T &exp) const |
the pow function with dynamic exponent | |
GenerateVariable< Variable, BSUtilities::Rational< 1, 2 > >::Mult | sqrt (void) const |
the alternative sqrt function | |
std::ostream & | print_value (std::ostream &os) const |
print the value and the unit of the variable | |
void | operator>> (std::string &str) const |
store the value and unit of the variable in a std::string | |
std::ostream & | operator>> (std::ostream &os) const |
print the variable | |
void | read_value (const std::string &str) |
read variable value and unit from a string | |
void | operator<< (const std::string &str) |
read from string to the right of operator<< | |
void | operator= (const std::string &str) |
assign from a string | |
std::istream & | operator<< (std::istream &is) |
read from a std::istream to the right of operator<< | |
void | save (BSUtilities::xmlw::XmlStream &os) const |
save contents of the variable quantity object as xml | |
void | load (const TiXmlHandle node) const |
load contents of the variable quantity object from xml code | |
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< Variable, BSUtilities::Rational< I, long(1)> >::Mul | pow )(const typename Loki::Int2Type< I >) const |
the pow function with static integer exponent | |
Static Public Attributes | |
const std::string | MODE |
the xml Variable attribute | |
Static Private Member Functions | |
DDR | defaultDedimensionalizer (DDP) |
the default dedimensionalizing function | |
Private Attributes | |
DD | _dedimensionalizer |
the (de)dimensionalizing functor object | |
ST | _value |
the value of the Variable in the storage unit | |
Static Private Attributes | |
const DD | _defaultDD |
the default dedimensionalizing functor | |
Friends | |
template<template< class, class, class > class Q> Variable | operator+ (const Dynamic< ST > &quantity1, const Q< Quantity< DIM, BT, UL, DU, ST >, SU, DD > &quantity2) |
binary operator+ | |
template<template< class, class, class > class Q> Variable | operator- (const Dynamic< ST > &quantity1, const Q< Quantity< DIM, BT, UL, DU, ST >, SU, DD > &quantity2) |
binary operator- | |
template<template< class, class, class > class Q1, class DD1> Variable | operator * (const ST factor, const Q1< PQ, SU, DD1 > &variable) |
operator* for left hand multiplication by ST | |
GenerateVariable< Variable, Loki::NullType >::Inv | operator/ (const ST numerator, const Variable &factor) |
division of a number by a variable | |
GenerateVariable< Variable, BSUtilities::Rational< 1, 2 > >::Mult | sqrt (const Variable &variable) |
the sqrt function | |
void | operator>> (const std::string &str, Variable &variable) |
read from string to the left of operator>> | |
std::istream & | operator>> (std::istream &is, Variable &variable) |
read from a std::istream to the left of operator>> |
the parent quantity is required to be a Quantity, while there is no requirement on SU; the variable is derived from the parent quantity.
Definition at line 241 of file Variable.h.
|
the abstract base quantity type the Quantity which is used as the abstract base class for this quantity; Definition at line 291 of file Variable.h. |
|
the dedimensionalizer type
Definition at line 285 of file Variable.h. |
|
the dedimensionalizer parameter type list type
Definition at line 272 of file Variable.h. |
|
the parameters to the dedimensionalizing functor as a type a (possibly inhomogenous) collection of values to be given to the dedimensionalizing functor upon a call to redimensionalize the DedimensionalizedVariable; this is extracted from the DDL typelist, which should have a single element, which is again a Loki::Tuple, containing the individual parameters Definition at line 282 of file Variable.h. |
|
the return variable type of dedimensionalizer
Definition at line 309 of file Variable.h. |
|
the dimension make the dimension known as DIM Definition at line 269 of file Variable.h. |
|
the parent quantity; this is the quantity which is used to generate this quantity in template form as a parameter to the quantity mode; it is the same as the abstract base quantity; it is used by other classes, and MUST be public Definition at line 304 of file Variable.h. |
|
check SU and if ok, make the storage unit SU known as Unit parameter SU is checked to be subclassed from Unit<BT>; this ensures that SU (a) is a unit, (b) is a descendant of Unit<BT>, and (c) can be instantiated; since CheckUnit returns the test unit, this is typedef'ed for further use. Definition at line 349 of file Variable.h. |
|
the variable type make the variable known as V Definition at line 296 of file Variable.h. |
|
the default dedimensionalizing function returns an unnamed object; used if no dedimensionalizer is given by the user; does not use any of the parameters in DDP, the returned object contains unity. Definition at line 317 of file Variable.h. |
|
load contents of the variable quantity object from xml code use this is when attempting to input the contents of the variable quantity object through the Quantity ObjectFactory Definition at line 1586 of file Variable.h. |
|
multiplication of variables with a quantity the type of the result is generated through GenerateVariable by adding the dimensions of the two quantities; only GenerateVariable with two quantities as arguments does have an Add typedef, thus, Q does not need to be specified. Definition at line 1414 of file Variable.h. |
|
operator* for right hand multiplication with ST generates new object; can be chained as in a * b * c; Definition at line 1155 of file Variable.h. |
|
operator*= for multiplication with ST and assignment only right hand side ST makes sense, since the product can not be assigned to a ST in general Definition at line 962 of file Variable.h. |
|
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 1249 of file Variable.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 1236 of file Variable.h. |
|
inequality compares identical types; use value to retrieve the variabler value of the right hand side Variable and directly compare to _value. Definition at line 1226 of file Variable.h. |
|
return the value in a Variable object with unit NU; Generates an object of the desired type and stores _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. The dedimensionalizer in the returned object is the default. Definition at line 767 of file Variable.h. |
|
binary operator+ handles the case of addition of a Dynamic object on the right hand side of the operator; this is converted into an object of the left hand side type; this is only successful at run time, if the Dynamic object is commensurate; failure is indicated by a DimensionMismatch exception; finally addition is forwarded to the `generic' addition operator above. Definition at line 1050 of file Variable.h. |
|
binary operator+ takes any left hand side quantity object and decides (at compile time) which of the helper structure static exec member functions should be used, based on the type of the unit of the left hand side object, i.e. if this is typical for a generated quantity object or not. Definition at line 1031 of file Variable.h. |
|
unary operator+ returns a new object of same type and same value. Definition at line 980 of file Variable.h. |
|
operator+= specialization for two quantities from different parent quantities where the second is NOT a generated quantity; dedimensionalizer types could be identical or not; should never compile, but rather yield a DimensionError<true> compiler error message. Return is only for syntactic correctness. Definition at line 870 of file Variable.h. |
|
operator+= can be chained as in a += b += c; for a right hand side operand which is a generated quantity having a generic unit and the same dimension as the left hand side operand; the dedimensionalizer type of both quantities need not to be identical. value of both operands recalculated into standard unit, reverse standardization of the result before stored in _value. Definition at line 847 of file Variable.h. |
|
operator+= can be chained as in a += b += c; for quantities related through the same parent quantity and different storage unit; dimension is not checked, since the above ensures that they must be the same; the dedimensionalizer type of both quantities need not to be identical. value of both operands recalculated into standard unit, reverse standardization of the result before stored in _value. Definition at line 829 of file Variable.h. |
|
operator+= can be chained as in a += b += c; for two identical Variables; dimension is not checked, since the above ensures that they must be the same; the storage unit must be identical, thus, no recalculation is necessary; on the other hand, in order to avoid assignment to a generated quantity object, it is checked if the unit list UL of the Variable is the same type as that of a unit list of a generated quantity, i.e. the left hand side quantity object is a generated quantity object. If this is the case, the compiler tries to instantiate AssignmentError<true>, which is not defined. Thus, a compiler error message occurs. If UL is different, AssignmentError<false>::RET is true, and the += operation is performed. Definition at line 808 of file Variable.h. |
|
binary operator- handles the case of addition of a Dynamic object on the right hand side of the operator; this is converted into an object of the left hand side type; this is only successful, of the Dynamic object is commensurate; finally addition is forwarded to the `generic' addition operator above. Definition at line 1131 of file Variable.h. |
|
binary operator- takes any left hand side quantity object and decides (at compile time) which of the helper structure static exec member functions should be used, based on the type of the unit of the left hand side object, i.e. if this is typical for a generated quantity object or not. Definition at line 1113 of file Variable.h. |
|
unary operator- returns a new object of same type and same value with changed sign. Definition at line 986 of file Variable.h. |
|
operator-= specialization for two quantities from different parent quantities where the second is NOT a generated quantity; should never compile, but rather yield a DimensionError<true> compiler error message Definition at line 950 of file Variable.h. |
|
operator-= can be chained as in a -= b -= c; for a right hand side operand which is a generated quantity having a generic unit and the same dimension as the left hand side operand; value of both operands recalculated into standard unit, reverse standardization of the result before stored in _value. Definition at line 929 of file Variable.h. |
|
operator-= can be chained as in a -= b -= c; for quantities related through the same parent quantity and different storage unit; dimension is not checked, since the above ensures that they must be the same; value of both operands recalculated into standard unit, reverse standardization of the result before stored in _value. Definition at line 913 of file Variable.h. |
|
operator-= can be chained as in a -= b -= c; for two identical Variables; dimension is not checked, since the above ensures that they must be the same; on the other hand, in order to avoid assignment to a generated quantity object, it is checked if the unit list UL of the Variable is the same type as that of a unit list of a generated quantity, i.e. the left hand side quantity object is a generated quantity object. If this is the case, the compiler tries to instantiate AssignmentError<true>, which is not defined. Thus, a compiler error message occurs. If UL is different, AssignmentError<false>::RET is true, and the -= operation is performed. Definition at line 893 of file Variable.h. |
|
division of a variable by a quantity the type of the result is generated through GenerateVariable by subtracting the dimensions of the two quantities; only GenerateVariable with two quantities as arguments does have an Sub typedef, thus, Q does not need to be specified. Definition at line 1428 of file Variable.h. |
|
operator/ for division by ST generates new object; can be chained as in a * b / c; Definition at line 1163 of file Variable.h. |
|
operator/= for division by ST and assignment only right hand side ST makes sense, since the result of this operation with a left hand side ST can not be assigned to a ST in general Definition at line 972 of file Variable.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 1323 of file Variable.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 1310 of file Variable.h. |
|
comparison: less than compares identical types; use value to retrieve the variabler value of the right hand side Variable and directly compare to _value. Definition at line 1300 of file Variable.h. |
|
read from a std::istream to the right of operator<< creates an intermediary string into which the data are read which are subsequently interpreted with read_value; the reference to the istream object is returned to allow chaining. Definition at line 1554 of file Variable.h. |
|
read from string to the right of operator<<
Definition at line 1544 of file Variable.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 1397 of file Variable.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 1384 of file Variable.h. |
|
comparison: less equal compares identical types; use value to retrieve the variabler value of the right hand side Variable and directly compare to _value. Definition at line 1374 of file Variable.h. |
|
assign from a string
Definition at line 1547 of file Variable.h. |
|
assignment from Dynamic this assignment operator has to do run-time checking of the dimensional information in Dynamic! Definition at line 670 of file Variable.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(). |
|
assignment operator specialized version for a quantity derived from Quantity with a unit list typical for a generated quantity using a GenericUnit; this special case is the only exception when a quantity of different base unit type BT can be assigned to the target Variable, provided the dimensions of the two objects are equal. This is tested with CheckSecondDimension. The dedimensionalizer types may be different. The form of Q1<> must satisfy the template parameter sequence for a Variable (or a other classes similarly derived fom Quantity); this prohibits assignment from general objects (strings etc.); comparison against self-assignment must be performed through void *, since &Q1 might be a pointer to a class different from that pointed to by this; thus, it is checked that the adresses of the two objects differ; the raw value of the source_quantity is extracted, converted into the unit of the present object, and the result is stored; only the _value is assigned, name and symbol of the present variable are not touched. It is assumed that the storage type of the two objects is identical. Definition at line 647 of file Variable.h. |
|
assignment operator specialization for possibly different parent quantity PQ1; if trying to instantiate, PQ and PQ1 should be different, since the case of PQ and PQ1 being the same type is handled by the assignment operator given above. This handles types with identical or different dedimensionalizer types. Thus, SameType<>::sameType is always false and the IF construct tries to instantiate DimensionError<true> which is never defined. Consequently, this should never be instantiated correctly. Definition at line 615 of file Variable.h. |
|
assignment operator specialized version for some parent quantity PQ; used if PQ of the source and target quantity are identical; then we can be sure that the value of the source can be recalculated into the unit of the target. The dedimensionalizer types can be identical or different. The form of Q1<> must satisfy the template parameter sequence for a Variable (or a other classes similarly derived fom Quantity); this prohibits assignment from general objects (strings etc.); comparison against self-assignment must be performed through void *, since &Q1 might be a pointer to a class different from that pointed to by this; thus, it is checked that the adresses of the two objects differ; the value of the source_quantity in the storage unit is extracted, converted into the unit of the present object, and the result is stored; only the _value is assigned, name and symbol of the present variable are not touched. It is assumed that the storage type of the two objects is identical. Definition at line 590 of file Variable.h. |
|
assignment operator assignment from same type; comparison against self assignment can be done by direct comparison of pointers; no need to convert values, since unit must be the same; raw value of new_variable is used, since no conversion into default unit is desired; only the variable value is assigned, name and symbol are not touched. Definition at line 561 of file Variable.h. |
|
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 1212 of file Variable.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 1199 of file Variable.h. |
|
equality compares identical types; use value to retrieve the variable value of the right hand side Variable and directly compare to _value. Definition at line 1189 of file Variable.h. |
|
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 1286 of file Variable.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 1273 of file Variable.h. |
|
comparison: greater than compares identical types; use value to retrieve the variabler value of the right hand side Variable and directly compare to _value. Definition at line 1263 of file Variable.h. |
|
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 1360 of file Variable.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 1347 of file Variable.h. |
|
comparison: greater equal compares identical types; use value to retrieve the variabler value of the right hand side Variable and directly compare to _value. Definition at line 1337 of file Variable.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 1528 of file Variable.h. |
|
store the value and unit of the variable in a std::string converts to a string by template Conversion Definition at line 1520 of file Variable.h. |
|
the pow function with dynamic exponent returns a transient Dynamic variable with the dimensions of the first argument multiplied by exp; used as object.pow (r); forwards action to pow function with quantity and dynamic exponent (static functions in Dynamic for specific T's). Definition at line 1482 of file Variable.h. References quantity::exp(). |
|
the pow function with static rational exponent returns a transient variable with the dimension of the first argument multiplied by Rational<N, D>; standardized value to be used, since the transient variable assumes a standardization factor of unity. used as object.pow (r); Definition at line 1457 of file Variable.h. |
|
print the value and the unit of the variable places these items on the ostream os and returns the reference to the os object, thus allowing chaining of operator<< calls. Definition at line 1514 of file Variable.h. |
|
read variable value and unit from a string central function for all input functions. |
|
save contents of the variable quantity object as xml this should be used when attempting to output the contents of the variable quantity object in xml form, which can later be read without knowledge of the object's type; generates a transient object of type SU for saving its contents Definition at line 1571 of file Variable.h. |
|
the alternative sqrt function use as v.sqrt (), with v being an instantiation of a Variable Definition at line 1503 of file Variable.h. |
|
return the value in the standard unit; The stored _value is standardized using the Standardize () function for unit SU Definition at line 695 of file Variable.h. |
|
return the storage unit name; the name is interrogated from SU; static access. Definition at line 789 of file Variable.h. |
|
return the storage unit name; the name is interrogated from SU; dynamic access. Definition at line 784 of file Variable.h. |
|
return the storage unit symbol; the symbol is interrogated from SU; static access. Definition at line 779 of file Variable.h. |
|
return the storage unit symbol; the symbol is interrogated from SU; dynamic access. Definition at line 773 of file Variable.h. |
|
return the value in a unit with symbol string symbolstring; The string is checked at run time, this allows dynamic access. Consequently, when supplying an incorrect string for the symbol, this can not be detected at compile time, but only at run time. The stored _value is first standardized using the Standardize () function for 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 747 of file Variable.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 731 of file Variable.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 718 of file Variable.h. |
|
return the value in a NonPrefixable unit NonPrefixable<BT, NU>; 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 705 of file Variable.h. |
|
return the value in the storage unit; The stored _value is returned without recalculation. Definition at line 689 of file Variable.h. |
|
copy construction from Dynamic this copy constructor has to do run-time checking of the dimensional information in Dynamic; division by the Gcd brings all components of the seven dimension Rationals in Variable to the canonical values. Definition at line 526 of file Variable.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(). |
|
copy constructor from some other quantity Q1 function not defined here, since in general, this copy constructor does not make sense! Only works if a specialized version is provided by a particular Variable<>; if this is not the case, missing reference should be reported by the linker; handles cases where PQ and PQ1 correspond to totally different quantities, but also where the storage type is different. |
|
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 base unit type can be converted into the target Variable, provided the dimensions of the two objects are equal. This is tested with CheckSecondDimension. The dedimensionalizer of the source quantity is not copied. It is assumed that the storage type of the two objects is identical. Definition at line 493 of file Variable.h. |
|
copy constructor from quantity with different unit (conversion) specialized version for same parent quantity PQ; used if PQ of the target Variable to be constructed and that of the source quantity are identical; then we can be sure that the value of the source quantity can be recalculated into the unit of the target Variable; the result of this calculation is used in an initializer. The name and the symbol of the quantity are copied in the body of the function. The dedimensionalizer of the source quantity is not copied. The form of Q1<> must satisfy the template parameter sequence for a Variable or other classes similarly derived fom Quantity; this prohibits the conversion from general objects (string etc.). It is assumed that the storage type of the two objects is identical. Definition at line 474 of file Variable.h. |
|
copy constructor initialize the parent quantity ABQ; then copy the value, the name and symbol string of variable Definition at line 452 of file Variable.h. |
|
constructor from different unit given by string constant takes a const char * defining the symbol of the unit as the second argument; the symbol is checked at run time for dynamic access; the value is first standardized on the base of the unit determined, and recalculated into the storage unit SU; first initializes base class; findBySymbol may throw a UnitMismatch exception. Definition at line 437 of file Variable.h. |
|
constructor from different unit given by std::string takes a std:string defining the symbol of the unit as the second argument; the symbol is checked at run time and returned as a pointer to the base unit type BT; the unit object pointed to is later destroyed; the value is first dynamically standardized on the base of the unit determined, and then recalculated into the storage unit SU; first initializes base class; findBySymbol may throw a UnitMismatch exception. Definition at line 419 of file Variable.h. |
|
constructor from different unit takes an instance of a unit of template parameter type NU as the second argument 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 404 of file Variable.h. |
|
constructor from same unit and dedimensionalizer takes an instance of the storage unit as the second argument and uses value directly; store the dedmensionalizer. Definition at line 392 of file Variable.h. |
|
constructor from same unit takes an instance of the storage unit as the second argument and uses value directly; assumes default dedimensionalizer. Definition at line 384 of file Variable.h. |
|
constructor with a value and dedimensionalizer Set the value to new_value and assume this to be in unit SU; store the dedimensionalizer. Definition at line 376 of file Variable.h. |
|
constructor with only a value Set the value to new_value and assume this to be in unit SU; assume default dedimensionalizer. Definition at line 369 of file Variable.h. |
|
constructor with only dedimensionalizer function set the value to 0 (or equivalent) and store the dedimensionalizer Definition at line 361 of file Variable.h. |
|
default constructor Set the value to 0 (or equivalent) and assume this to be in unit SU; assume default dedimensionalizer. Definition at line 355 of file Variable.h. |
|
operator* for left hand multiplication by ST generates new object to be returned; due to promotion and conversions, this may also work for factors with a type different from ST, as long as it can be matched; out of class declaration without friend does not work with factor type different from storage type, since in that case first the template argument ST is deducted from the first function argument, and 'this deduction does not consider ... conversions' (Vandevoorde/Josuttis, p. 489); second argument can be quantity object of any mode. Definition at line 1181 of file Variable.h. |
|
binary operator+ handles the case of addition of a Dynamic object on the left hand side of the operator; this is converted into a Variable object of the right hand side type, which is only successful, if the Dynamic object is commensurate; finally addition is forwarded to the `generic' addition operator above; must be friend of the Variable class, since the first argument is not a Variable. Definition at line 1065 of file Variable.h. |
|
binary operator- handles the case of addition of a Dynamic object on the left hand side of the operator; this is converted into a Variable object of the right hand side type, which is only successful, if the Dynamic object is commensurate; finally addition is forwarded to the `generic' addition operator above; must be friend of the Variable class, since the first argument is not a Variable. Definition at line 1146 of file Variable.h. |
|
division of a number by a variable the type of the result is generated through GenerateVariable by negating the dimension of the variable; Definition at line 1440 of file Variable.h. |
|
read from a std::istream to the left of operator>> must be a friend to have std::istream & as the type of the first object; uses read from istream to the right of operator<<. Definition at line 1563 of file Variable.h. |
|
read from string to the left of operator>> must be a friend to have std::string as the type of the first object Definition at line 1540 of file Variable.h. |
|
the sqrt function use as sqrt (v), with v being an instantiation of a Variable Definition at line 1491 of file Variable.h. |
|
the (de)dimensionalizing functor object the _dedimensionalizer object is a functor which returns an object to be used to perform the dedimensionalization of an object of type V (by division) or the redimensionalization of the internally stored value into an object of type V. Thus, _dedimensionalizer stores the recipe how to (de)dimensionalize the value stored in the DedimensionalizedVariable object. Definition at line 333 of file Variable.h. |
|
the default dedimensionalizing functor initialized outside of class to defaultDedimensionalizer Definition at line 322 of file Variable.h. |
|
the value of the Variable in the storage unit this data member is private, and can only be accessed through the member functions value (). Definition at line 339 of file Variable.h. |
|
the xml Variable attribute define outside of class Definition at line 1612 of file Variable.h. |
|
the pow function with static integer exponent returns a transient variable with the dimension of the first argument multiplied by I; standardized value to be used, since the transient variable assumes a standardization factor of unity. used as object.pow (r); Definition at line 1471 of file Variable.h. |