ad_physics
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
ad::physics::ParametricValue Class Reference

DataType ParametricValue. More...

#include <ad/physics/ParametricValue.hpp>

Public Member Functions

 ParametricValue ()
 default constructor More...
 
_AD_PHYSICS_PARAMETRICVALUE_EXPLICIT_CONVERSION_ ParametricValue (double const iParametricValue)
 standard constructor More...
 
 ParametricValue (const ParametricValue &other)=default
 standard copy constructor
 
 ParametricValue (ParametricValue &&other)=default
 standard move constructor
 
ParametricValueoperator= (const ParametricValue &other)=default
 standard assignment operator More...
 
ParametricValueoperator= (ParametricValue &&other)=default
 standard move operator More...
 
bool operator== (const ParametricValue &other) const
 standard comparison operator More...
 
bool operator!= (const ParametricValue &other) const
 standard comparison operator More...
 
bool operator> (const ParametricValue &other) const
 standard comparison operator More...
 
bool operator< (const ParametricValue &other) const
 standard comparison operator More...
 
bool operator>= (const ParametricValue &other) const
 standard comparison operator More...
 
bool operator<= (const ParametricValue &other) const
 standard comparison operator More...
 
ParametricValue operator+ (const ParametricValue &other) const
 standard arithmetic operator More...
 
ParametricValueoperator+= (const ParametricValue &other)
 standard arithmetic operator More...
 
ParametricValue operator- (const ParametricValue &other) const
 standard arithmetic operator More...
 
ParametricValue operator-= (const ParametricValue &other)
 standard arithmetic operator More...
 
ParametricValue operator* (const double &scalar) const
 standard arithmetic operator More...
 
ParametricValue operator/ (const double &scalar) const
 standard arithmetic operator More...
 
double operator/ (const ParametricValue &other) const
 standard arithmetic operator More...
 
ParametricValue operator- () const
 standard arithmetic operator More...
 
_AD_PHYSICS_PARAMETRICVALUE_EXPLICIT_CONVERSION_ operator double () const
 conversion to base type: double More...
 
bool isValid () const
 
void ensureValid () const
 ensure that the ParametricValue is valid More...
 
void ensureValidNonZero () const
 ensure that the ParametricValue is valid and non zero More...
 

Static Public Member Functions

static ParametricValue getMin ()
 get minimum valid ParametricValue (i.e. cMinValue)
 
static ParametricValue getMax ()
 get maximum valid ParametricValue (i.e. cMaxValue)
 
static ParametricValue getPrecision ()
 get assumed accuracy of ParametricValue (i.e. cPrecisionValue)
 

Static Public Attributes

static const double cMinValue
 constant defining the minimum valid ParametricValue value (used in isValid())
 
static const double cMaxValue
 constant defining the maximum valid ParametricValue value (used in isValid())
 
static const double cPrecisionValue
 constant defining the assumed ParametricValue value accuracy (used in comparison operator==(), operator!=())
 

Detailed Description

DataType ParametricValue.

A parametric value is a ratio in the range of [0.0; 1.0] describing the relative progress. The unit is: Ratio

Constructor & Destructor Documentation

◆ ParametricValue() [1/2]

ad::physics::ParametricValue::ParametricValue ( )
inline

default constructor

The default value of ParametricValue is: std::numeric_limits<double>::quiet_NaN()

◆ ParametricValue() [2/2]

_AD_PHYSICS_PARAMETRICVALUE_EXPLICIT_CONVERSION_ ad::physics::ParametricValue::ParametricValue ( double const  iParametricValue)
inline

standard constructor

Note
_AD_PHYSICS_PARAMETRICVALUE_EXPLICIT_CONVERSION_ defines, if only an explicit conversion is allowed.

Member Function Documentation

◆ ensureValid()

void ad::physics::ParametricValue::ensureValid ( ) const
inline

ensure that the ParametricValue is valid

Throws an std::out_of_range() exception if the ParametricValue in not valid (i.e. isValid() returns false)

◆ ensureValidNonZero()

void ad::physics::ParametricValue::ensureValidNonZero ( ) const
inline

ensure that the ParametricValue is valid and non zero

Throws an std::out_of_range() exception if the ParametricValue in not valid or zero (i.e. isValid() returns false)

◆ isValid()

bool ad::physics::ParametricValue::isValid ( ) const
inline
Returns
true if the ParametricValue in a valid range

An ParametricValue value is defined to be valid if:

◆ operator double()

_AD_PHYSICS_PARAMETRICVALUE_EXPLICIT_CONVERSION_ ad::physics::ParametricValue::operator double ( ) const
inline

conversion to base type: double

Note
the conversion to the base type removes the physical unit. _AD_PHYSICS_PARAMETRICVALUE_EXPLICIT_CONVERSION_ defines, if only explicit calls are allowed.

◆ operator!=()

bool ad::physics::ParametricValue::operator!= ( const ParametricValue other) const
inline

standard comparison operator

Parameters
[in]otherOther ParametricValue.
Returns
true if one of the ParametricValue is not valid or they can be taken as numerically different

◆ operator*()

ParametricValue ad::physics::ParametricValue::operator* ( const double &  scalar) const
inline

standard arithmetic operator

Parameters
[in]scalarScalar double value
Returns
Result of arithmetic operation.
Note
throws a std::out_of_range exception if value or the result of the operation is not valid

◆ operator+()

ParametricValue ad::physics::ParametricValue::operator+ ( const ParametricValue other) const
inline

standard arithmetic operator

Parameters
[in]otherOther ParametricValue
Returns
Result of arithmetic operation.
Note
throws a std::out_of_range exception if one of the two operands or the result of the operation is not valid

◆ operator+=()

ParametricValue& ad::physics::ParametricValue::operator+= ( const ParametricValue other)
inline

standard arithmetic operator

Parameters
[in]otherOther ParametricValue
Returns
Result of arithmetic operation.
Note
throws a std::out_of_range exception if one of the two operands or the result of the operation is not valid

◆ operator-() [1/2]

ParametricValue ad::physics::ParametricValue::operator- ( ) const
inline

standard arithmetic operator

Returns
Result of arithmetic operation.
Note
throws a std::out_of_range exception if this or the result of the operation is not valid

◆ operator-() [2/2]

ParametricValue ad::physics::ParametricValue::operator- ( const ParametricValue other) const
inline

standard arithmetic operator

Parameters
[in]otherOther ParametricValue
Returns
Result of arithmetic operation.
Note
throws a std::out_of_range exception if one of the two operands or the result of the operation is not valid

◆ operator-=()

ParametricValue ad::physics::ParametricValue::operator-= ( const ParametricValue other)
inline

standard arithmetic operator

Parameters
[in]otherOther ParametricValue
Returns
Result of arithmetic operation.
Note
throws a std::out_of_range exception if one of the two operands or the result of the operation is not valid

◆ operator/() [1/2]

ParametricValue ad::physics::ParametricValue::operator/ ( const double &  scalar) const
inline

standard arithmetic operator

Parameters
[in]scalarScalar double value
Returns
Result of arithmetic operation.
Note
throws a std::out_of_range exception if this or the result of the operation is not valid or other is zero

◆ operator/() [2/2]

double ad::physics::ParametricValue::operator/ ( const ParametricValue other) const
inline

standard arithmetic operator

Parameters
[in]otherOther ParametricValue
Returns
Result of arithmetic operation.
Note
throws a std::out_of_range exception if one of the two operands or the result of the operation is not valid or other is zero
since ParametricValue is a type with physical unit, the division results in the dimensionless type.

◆ operator<()

bool ad::physics::ParametricValue::operator< ( const ParametricValue other) const
inline

standard comparison operator

Parameters
[in]otherOther ParametricValue.
Returns
true if both ParametricValue are valid and this ParametricValue is strictly numerically smaller than other.
Note
the precision of ParametricValue is considered

◆ operator<=()

bool ad::physics::ParametricValue::operator<= ( const ParametricValue other) const
inline

standard comparison operator

Parameters
[in]otherOther ParametricValue
Returns
true if both ParametricValue are valid and this ParametricValue is numerically smaller than other.
Note
the precision of ParametricValue is considered

◆ operator=() [1/2]

ParametricValue& ad::physics::ParametricValue::operator= ( const ParametricValue other)
default

standard assignment operator

Parameters
[in]otherOther ParametricValue
Returns
Reference to this ParametricValue.

◆ operator=() [2/2]

ParametricValue& ad::physics::ParametricValue::operator= ( ParametricValue &&  other)
default

standard move operator

Parameters
[in]otherOther ParametricValue
Returns
Reference to this ParametricValue.

◆ operator==()

bool ad::physics::ParametricValue::operator== ( const ParametricValue other) const
inline

standard comparison operator

Parameters
[in]otherOther ParametricValue
Returns
true if both ParametricValue are valid and can be taken as numerically equal

◆ operator>()

bool ad::physics::ParametricValue::operator> ( const ParametricValue other) const
inline

standard comparison operator

Parameters
[in]otherOther ParametricValue.
Returns
true if both ParametricValue are valid and this ParametricValue is strictly numerically greater than other.
Note
the precision of ParametricValue is considered

◆ operator>=()

bool ad::physics::ParametricValue::operator>= ( const ParametricValue other) const
inline

standard comparison operator

Parameters
[in]otherOther ParametricValue.
Returns
true if both ParametricValue are valid and this ParametricValue is numerically greater than other.
Note
the precision of ParametricValue is considered

The documentation for this class was generated from the following file: