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

DataType DistanceSquared. More...

#include <ad/physics/DistanceSquared.hpp>

Public Member Functions

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

Static Public Member Functions

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

Static Public Attributes

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

Detailed Description

DataType DistanceSquared.

DistanceSquared represents a squared Distance. The unit is: SquareMeter

Constructor & Destructor Documentation

◆ DistanceSquared() [1/2]

ad::physics::DistanceSquared::DistanceSquared ( )
inline

default constructor

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

◆ DistanceSquared() [2/2]

_AD_PHYSICS_DISTANCESQUARED_EXPLICIT_CONVERSION_ ad::physics::DistanceSquared::DistanceSquared ( double const  iDistanceSquared)
inline

standard constructor

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

Member Function Documentation

◆ ensureValid()

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

ensure that the DistanceSquared is valid

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

◆ ensureValidNonZero()

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

ensure that the DistanceSquared is valid and non zero

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

◆ isValid()

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

An DistanceSquared value is defined to be valid if:

◆ operator double()

_AD_PHYSICS_DISTANCESQUARED_EXPLICIT_CONVERSION_ ad::physics::DistanceSquared::operator double ( ) const
inline

conversion to base type: double

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

◆ operator!=()

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

standard comparison operator

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

◆ operator*()

DistanceSquared ad::physics::DistanceSquared::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+()

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

standard arithmetic operator

Parameters
[in]otherOther DistanceSquared
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+=()

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

standard arithmetic operator

Parameters
[in]otherOther DistanceSquared
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]

DistanceSquared ad::physics::DistanceSquared::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]

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

standard arithmetic operator

Parameters
[in]otherOther DistanceSquared
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-=()

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

standard arithmetic operator

Parameters
[in]otherOther DistanceSquared
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]

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

standard arithmetic operator

Parameters
[in]otherOther DistanceSquared
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 DistanceSquared is a type with physical unit, the division results in the dimensionless type.

◆ operator/() [2/2]

DistanceSquared ad::physics::DistanceSquared::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<()

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

standard comparison operator

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

◆ operator<=()

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

standard comparison operator

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

◆ operator=() [1/2]

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

standard assignment operator

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

◆ operator=() [2/2]

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

standard move operator

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

◆ operator==()

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

standard comparison operator

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

◆ operator>()

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

standard comparison operator

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

◆ operator>=()

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

standard comparison operator

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

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