Control Libraries 6.3.4
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
state_representation::units::Velocity< T > Class Template Reference

Public Member Functions

constexpr Velocity (long double n=0.0)
 Constructor with a value in the base unit of T. More...
 
constexpr Velocity (const Velocity< T > &vel)
 Copy constructor from another Velocity. More...
 
constexpr long double get_value () const
 Getter of the value attribute. More...
 
constexpr Velocity< T > & operator- ()
 Overload the - operator. More...
 
constexpr Velocity< T > & operator+= (const Velocity< T > &rhs)
 Overload the += operator. More...
 
constexpr Velocity< T > operator+ (const Velocity< T > &rhs) const
 Overload the + operator. More...
 
constexpr Velocity< T > & operator-= (const Velocity< T > &rhs)
 Overload the -= operator. More...
 
constexpr Velocity< T > operator- (const Velocity< T > &rhs) const
 Overload the - operator. More...
 
constexpr Velocity< T > & operator*= (double lambda)
 Overload the *= operator with a scalar. More...
 
constexpr Velocity< T > operator* (double lambda) const
 Overload the * operator with a scalar. More...
 
constexpr Velocity< T > & operator/= (double lambda)
 Overload the /= operator with a scalar. More...
 
constexpr Velocity< T > operator/ (double lambda) const
 Overload the / operator with a scalar. More...
 
constexpr bool operator== (const Velocity< T > &rhs) const
 Overload the == operator. More...
 
constexpr bool operator!= (const Velocity< T > &rhs) const
 Overload the != operator. More...
 
constexpr bool operator> (const Velocity< T > &rhs) const
 Overload the > operator. More...
 
constexpr bool operator>= (const Velocity< T > &rhs) const
 Overload the > operator. More...
 
constexpr bool operator< (const Velocity< T > &rhs) const
 Overload the < operator. More...
 
constexpr bool operator<= (const Velocity< T > &rhs) const
 Overload the < operator. More...
 

Friends

constexpr double operator/ (const Velocity< T > &lhs, const Velocity< T > &rhs)
 Overload the / operator between two Velocitys. More...
 
constexpr Velocity< T > operator* (double lambda, const Velocity< T > &rhs)
 Overload the * operator with a scalar on the left side. More...
 
template<class Rep , class DurationRatio >
constexpr Velocity< T > operator/ (const T &lhs, const std::chrono::duration< Rep, DurationRatio > &rhs)
 Overload the / operator for a T divided by a time period. More...
 

Detailed Description

template<class T>
class state_representation::units::Velocity< T >

Definition at line 82 of file Velocity.hpp.

Constructor & Destructor Documentation

◆ Velocity() [1/2]

template<class T >
constexpr state_representation::units::Velocity< T >::Velocity ( long double  n = 0.0)
constexpr

Constructor with a value in the base unit of T.

Parameters
nthe value in the base unit of T

Definition at line 239 of file Velocity.hpp.

◆ Velocity() [2/2]

template<class T >
constexpr state_representation::units::Velocity< T >::Velocity ( const Velocity< T > &  vel)
constexpr

Copy constructor from another Velocity.

Parameters
velthe Velocity to copy

Definition at line 243 of file Velocity.hpp.

Member Function Documentation

◆ get_value()

template<class T >
constexpr long double state_representation::units::Velocity< T >::get_value
constexpr

Getter of the value attribute.

Returns
the value in meter per second

Definition at line 247 of file Velocity.hpp.

◆ operator!=()

template<class T >
constexpr bool state_representation::units::Velocity< T >::operator!= ( const Velocity< T > &  rhs) const
constexpr

Overload the != operator.

Parameters
rhsthe other Velocity to check inequality with
Returns
bool true if the two Velocitys are different

Definition at line 315 of file Velocity.hpp.

◆ operator*()

template<class T >
constexpr Velocity< T > state_representation::units::Velocity< T >::operator* ( double  lambda) const
constexpr

Overload the * operator with a scalar.

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

Definition at line 290 of file Velocity.hpp.

◆ operator*=()

template<class T >
constexpr Velocity< T > & state_representation::units::Velocity< T >::operator*= ( double  lambda)
constexpr

Overload the *= operator with a scalar.

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

Definition at line 284 of file Velocity.hpp.

◆ operator+()

template<class T >
constexpr Velocity< T > state_representation::units::Velocity< T >::operator+ ( const Velocity< T > &  rhs) const
constexpr

Overload the + operator.

Parameters
rhsVelocity to add
Returns
the current Velocity added the Velocity given in argument

Definition at line 264 of file Velocity.hpp.

◆ operator+=()

template<class T >
constexpr Velocity< T > & state_representation::units::Velocity< T >::operator+= ( const Velocity< T > &  rhs)
constexpr

Overload the += operator.

Parameters
rhsVelocity to add
Returns
the current Velocity added the Velocity given in argument

Definition at line 258 of file Velocity.hpp.

◆ operator-() [1/2]

template<class T >
constexpr Velocity< T > & state_representation::units::Velocity< T >::operator-
constexpr

Overload the - operator.

Returns
the negative velocity in the base unit

Definition at line 252 of file Velocity.hpp.

◆ operator-() [2/2]

template<class T >
constexpr Velocity< T > state_representation::units::Velocity< T >::operator- ( const Velocity< T > &  rhs) const
constexpr

Overload the - operator.

Parameters
rhsVelocity to subtract
Returns
the current Velocity minus the Velocity given in argument

Definition at line 277 of file Velocity.hpp.

◆ operator-=()

template<class T >
constexpr Velocity< T > & state_representation::units::Velocity< T >::operator-= ( const Velocity< T > &  rhs)
constexpr

Overload the -= operator.

Parameters
rhsVelocity to subtract
Returns
the current Velocity minus the Velocity given in argument

Definition at line 271 of file Velocity.hpp.

◆ operator/()

template<class T >
constexpr Velocity< T > state_representation::units::Velocity< T >::operator/ ( double  lambda) const
constexpr

Overload the / operator with a scalar.

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

Definition at line 303 of file Velocity.hpp.

◆ operator/=()

template<class T >
constexpr Velocity< T > & state_representation::units::Velocity< T >::operator/= ( double  lambda)
constexpr

Overload the /= operator with a scalar.

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

Definition at line 297 of file Velocity.hpp.

◆ operator<()

template<class T >
constexpr bool state_representation::units::Velocity< T >::operator< ( const Velocity< T > &  rhs) const
constexpr

Overload the < operator.

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

Definition at line 330 of file Velocity.hpp.

◆ operator<=()

template<class T >
constexpr bool state_representation::units::Velocity< T >::operator<= ( const Velocity< T > &  rhs) const
constexpr

Overload the < operator.

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

Definition at line 335 of file Velocity.hpp.

◆ operator==()

template<class T >
constexpr bool state_representation::units::Velocity< T >::operator== ( const Velocity< T > &  rhs) const
constexpr

Overload the == operator.

Parameters
rhsthe other Velocity to check equality with
Returns
bool true if the two Velocitys are equal

Definition at line 310 of file Velocity.hpp.

◆ operator>()

template<class T >
constexpr bool state_representation::units::Velocity< T >::operator> ( const Velocity< T > &  rhs) const
constexpr

Overload the > operator.

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

Definition at line 320 of file Velocity.hpp.

◆ operator>=()

template<class T >
constexpr bool state_representation::units::Velocity< T >::operator>= ( const Velocity< T > &  rhs) const
constexpr

Overload the > operator.

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

Definition at line 325 of file Velocity.hpp.

Friends And Related Function Documentation

◆ operator*

template<class T >
constexpr Velocity< T > operator* ( double  lambda,
const Velocity< T > &  rhs 
)
friend

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

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

Definition at line 224 of file Velocity.hpp.

◆ operator/ [1/2]

template<class T >
template<class Rep , class DurationRatio >
constexpr Velocity< T > operator/ ( const T &  lhs,
const std::chrono::duration< Rep, DurationRatio > &  rhs 
)
friend

Overload the / operator for a T divided by a time period.

Parameters
lhsthe T unit
rhsthe time period
Returns
the Velocity as the T over the time period

Definition at line 340 of file Velocity.hpp.

◆ operator/ [2/2]

template<class T >
constexpr double operator/ ( const Velocity< T > &  lhs,
const Velocity< T > &  rhs 
)
friend

Overload the / operator between two Velocitys.

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

Definition at line 215 of file Velocity.hpp.


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