Control Libraries 7.4.0
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
state_representation::units::Distance Class Reference

Public Member Functions

constexpr Distance (long double n=0.0)
 Constructor with a value in meter.
 
constexpr Distance (const Distance &dist)
 Copy constructor from another distance.
 
constexpr long double get_value () const
 Getter of the value attribute.
 
constexpr Distanceoperator- ()
 Overload the - operator.
 
constexpr Distanceoperator+= (const Distance &rhs)
 Overload the += operator.
 
constexpr Distance operator+ (const Distance &rhs) const
 Overload the + operator.
 
constexpr Distanceoperator-= (const Distance &rhs)
 Overload the -= operator.
 
constexpr Distance operator- (const Distance &rhs) const
 Overload the - operator.
 
constexpr Distanceoperator*= (double lambda)
 Overload the *= operator with a scalar.
 
constexpr Distance operator* (double lambda) const
 Overload the * operator with a scalar.
 
constexpr Distanceoperator/= (double lambda)
 Overload the /= operator with a scalar.
 
constexpr Distance operator/ (double lambda) const
 Overload the / operator with a scalar.
 
constexpr bool operator== (const Distance &rhs) const
 Overload the == operator.
 
constexpr bool operator!= (const Distance &rhs) const
 Overload the != operator.
 
constexpr bool operator> (const Distance &rhs) const
 Overload the > operator.
 
constexpr bool operator>= (const Distance &rhs) const
 Overload the > operator.
 
constexpr bool operator< (const Distance &rhs) const
 Overload the < operator.
 
constexpr bool operator<= (const Distance &rhs) const
 Overload the < operator.
 

Friends

constexpr double operator/ (const Distance &lhs, const Distance &rhs)
 Overload the / operator between two distances.
 
constexpr Distance operator* (double lambda, const Distance &rhs)
 Overload the / operator with a scalar on the left side.
 
constexpr Distance literals::operator""_m (long double n)
 Literal operator to create a Distance in meter.
 
constexpr Distance literals::operator""_km (long double n)
 Literal operator to create a Distance in kilometer.
 
constexpr Distance literals::operator""_dm (long double n)
 Literal operator to create a Distance in decimeter.
 
constexpr Distance literals::operator""_cm (long double n)
 Literal operator to create a Distance in centimeter.
 
constexpr Distance literals::operator""_mm (long double n)
 Literal operator to create a Distance in millimeter.
 

Detailed Description

Definition at line 45 of file Distance.hpp.

Constructor & Destructor Documentation

◆ Distance() [1/2]

constexpr state_representation::units::Distance::Distance ( long double  n = 0.0)
constexpr

Constructor with a value in meter.

Parameters
nthe value in meter

Definition at line 223 of file Distance.hpp.

◆ Distance() [2/2]

constexpr state_representation::units::Distance::Distance ( const Distance dist)
constexpr

Copy constructor from another distance.

Parameters
distthe distance to copy

Definition at line 226 of file Distance.hpp.

Member Function Documentation

◆ get_value()

constexpr long double state_representation::units::Distance::get_value ( ) const
constexpr

Getter of the value attribute.

Returns
the value in meter

Definition at line 229 of file Distance.hpp.

◆ operator!=()

constexpr bool state_representation::units::Distance::operator!= ( const Distance rhs) const
constexpr

Overload the != operator.

Parameters
rhsthe other Distance to check inequality with
Returns
bool true if the two distances are different

Definition at line 286 of file Distance.hpp.

◆ operator*()

constexpr Distance state_representation::units::Distance::operator* ( double  lambda) const
constexpr

Overload the * operator with a scalar.

Parameters
lambdathe scalar to multiply with
Returns
the Distance multiply by lambda

Definition at line 265 of file Distance.hpp.

◆ operator*=()

constexpr Distance & state_representation::units::Distance::operator*= ( double  lambda)
constexpr

Overload the *= operator with a scalar.

Parameters
lambdathe scalar to multiply with
Returns
the Distance multiply by lambda

Definition at line 260 of file Distance.hpp.

◆ operator+()

constexpr Distance state_representation::units::Distance::operator+ ( const Distance rhs) const
constexpr

Overload the + operator.

Parameters
rhsDistance to add
Returns
the current Distance added the Distance given in argument

Definition at line 243 of file Distance.hpp.

◆ operator+=()

constexpr Distance & state_representation::units::Distance::operator+= ( const Distance rhs)
constexpr

Overload the += operator.

Parameters
rhsDistance to add
Returns
the current Distance added the Distance given in argument

Definition at line 238 of file Distance.hpp.

◆ operator-() [1/2]

constexpr Distance & state_representation::units::Distance::operator- ( )
constexpr

Overload the - operator.

Returns
the negative distance in meter

Definition at line 233 of file Distance.hpp.

◆ operator-() [2/2]

constexpr Distance state_representation::units::Distance::operator- ( const Distance rhs) const
constexpr

Overload the - operator.

Parameters
rhsDistance to subtract
Returns
the current Distance minus the Distance given in argument

Definition at line 254 of file Distance.hpp.

◆ operator-=()

constexpr Distance & state_representation::units::Distance::operator-= ( const Distance rhs)
constexpr

Overload the -= operator.

Parameters
rhsDistance to subtract
Returns
the current Distance minus the Distance given in argument

Definition at line 249 of file Distance.hpp.

◆ operator/()

constexpr Distance state_representation::units::Distance::operator/ ( double  lambda) const
constexpr

Overload the / operator with a scalar.

Parameters
lambdathe scalar to divide by
Returns
the Distance divided by lambda

Definition at line 276 of file Distance.hpp.

◆ operator/=()

constexpr Distance & state_representation::units::Distance::operator/= ( double  lambda)
constexpr

Overload the /= operator with a scalar.

Parameters
lambdathe scalar to divide by
Returns
the Distance divided by lambda

Definition at line 271 of file Distance.hpp.

◆ operator<()

constexpr bool state_representation::units::Distance::operator< ( const Distance rhs) const
constexpr

Overload the < operator.

Parameters
rhsthe other Distance to check strict inferiority with
Returns
bool true if the current distance is strictly inferior than provided distance

Definition at line 298 of file Distance.hpp.

◆ operator<=()

constexpr bool state_representation::units::Distance::operator<= ( const Distance rhs) const
constexpr

Overload the < operator.

Parameters
rhsthe other Distance to check inferiority with
Returns
bool true if the current distance is inferior than provided distance

Definition at line 302 of file Distance.hpp.

◆ operator==()

constexpr bool state_representation::units::Distance::operator== ( const Distance rhs) const
constexpr

Overload the == operator.

Parameters
rhsthe other Distance to check equality with
Returns
bool true if the two distances are equal

Definition at line 282 of file Distance.hpp.

◆ operator>()

constexpr bool state_representation::units::Distance::operator> ( const Distance rhs) const
constexpr

Overload the > operator.

Parameters
rhsthe other Distance to check strict superiority with
Returns
bool true if the current distance is strictly superior than provided distance

Definition at line 290 of file Distance.hpp.

◆ operator>=()

constexpr bool state_representation::units::Distance::operator>= ( const Distance rhs) const
constexpr

Overload the > operator.

Parameters
rhsthe other Distance to check superiority with
Returns
bool true if the current distance is superior than provided distance

Definition at line 294 of file Distance.hpp.

Friends And Related Symbol Documentation

◆ literals::operator""_cm

constexpr Distance literals::operator""_cm ( long double  n)
friend

Literal operator to create a Distance in centimeter.

Parameters
nthe distance value in centimeter
theDistance in the base unit (meter)

◆ literals::operator""_dm

constexpr Distance literals::operator""_dm ( long double  n)
friend

Literal operator to create a Distance in decimeter.

Parameters
nthe distance value in decimeter
theDistance in the base unit (meter)

◆ literals::operator""_km

constexpr Distance literals::operator""_km ( long double  n)
friend

Literal operator to create a Distance in kilometer.

Parameters
nthe distance value in kilometer
theDistance in the base unit (meter)

◆ literals::operator""_m

constexpr Distance literals::operator""_m ( long double  n)
friend

Literal operator to create a Distance in meter.

Parameters
nthe distance value in meter
theDistance in the base unit (meter)

◆ literals::operator""_mm

constexpr Distance literals::operator""_mm ( long double  n)
friend

Literal operator to create a Distance in millimeter.

Parameters
nthe distance value in millimeter
theDistance in the base unit (meter)

◆ operator*

constexpr Distance operator* ( double  lambda,
const Distance rhs 
)
friend

Overload the / operator with a scalar on the left side.

Parameters
lambdathe scalar to multiply with
Returns
the Distance multiply by lambda

Definition at line 310 of file Distance.hpp.

◆ operator/

constexpr double operator/ ( const Distance lhs,
const Distance rhs 
)
friend

Overload the / operator between two distances.

Parameters
lhsthe first distance
rhsthe second distance
Returns
the ratio between first and second distance

Definition at line 306 of file Distance.hpp.


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