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

DataType DurationSquared. More...

#include <ad/physics/DurationSquared.hpp>

Public Member Functions

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

Static Public Member Functions

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

Static Public Attributes

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

Detailed Description

DataType DurationSquared.

DurationSquared represents a squared Duration The unit is: SecondSquared

Constructor & Destructor Documentation

◆ DurationSquared() [1/2]

ad::physics::DurationSquared::DurationSquared ( )
inline

default constructor

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

◆ DurationSquared() [2/2]

_AD_PHYSICS_DURATIONSQUARED_EXPLICIT_CONVERSION_ ad::physics::DurationSquared::DurationSquared ( double const  iDurationSquared)
inline

standard constructor

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

Member Function Documentation

◆ ensureValid()

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

ensure that the DurationSquared is valid

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

◆ ensureValidNonZero()

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

ensure that the DurationSquared is valid and non zero

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

◆ isValid()

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

An DurationSquared value is defined to be valid if:

◆ operator double()

_AD_PHYSICS_DURATIONSQUARED_EXPLICIT_CONVERSION_ ad::physics::DurationSquared::operator double ( ) const
inline

conversion to base type: double

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

◆ operator!=()

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

standard comparison operator

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

◆ operator*()

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

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

standard arithmetic operator

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

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

standard arithmetic operator

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

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

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

standard arithmetic operator

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

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

standard arithmetic operator

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

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

standard arithmetic operator

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

◆ operator<()

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

standard comparison operator

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

◆ operator<=()

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

standard comparison operator

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

◆ operator=() [1/2]

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

standard assignment operator

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

◆ operator=() [2/2]

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

standard move operator

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

◆ operator==()

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

standard comparison operator

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

◆ operator>()

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

standard comparison operator

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

◆ operator>=()

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

standard comparison operator

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

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