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

DataType SpeedSquared. More...

#include <ad/physics/SpeedSquared.hpp>

Public Member Functions

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

Static Public Member Functions

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

Static Public Attributes

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

Detailed Description

DataType SpeedSquared.

SpeedSquared represents a squared Speed. The unit is: SquareMeterPerSecondSquared

Constructor & Destructor Documentation

◆ SpeedSquared() [1/2]

ad::physics::SpeedSquared::SpeedSquared ( )
inline

default constructor

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

◆ SpeedSquared() [2/2]

_AD_PHYSICS_SPEEDSQUARED_EXPLICIT_CONVERSION_ ad::physics::SpeedSquared::SpeedSquared ( double const  iSpeedSquared)
inline

standard constructor

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

Member Function Documentation

◆ ensureValid()

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

ensure that the SpeedSquared is valid

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

◆ ensureValidNonZero()

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

ensure that the SpeedSquared is valid and non zero

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

◆ isValid()

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

An SpeedSquared value is defined to be valid if:

◆ operator double()

_AD_PHYSICS_SPEEDSQUARED_EXPLICIT_CONVERSION_ ad::physics::SpeedSquared::operator double ( ) const
inline

conversion to base type: double

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

◆ operator!=()

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

standard comparison operator

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

◆ operator*()

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

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

standard arithmetic operator

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

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

standard arithmetic operator

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

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

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

standard arithmetic operator

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

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

standard arithmetic operator

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

SpeedSquared ad::physics::SpeedSquared::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::SpeedSquared::operator/ ( const SpeedSquared other) const
inline

standard arithmetic operator

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

◆ operator<()

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

standard comparison operator

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

◆ operator<=()

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

standard comparison operator

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

◆ operator=() [1/2]

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

standard assignment operator

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

◆ operator=() [2/2]

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

standard move operator

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

◆ operator==()

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

standard comparison operator

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

◆ operator>()

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

standard comparison operator

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

◆ operator>=()

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

standard comparison operator

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

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