NRE::Math::Unit< M, L, T, A > Class Template Reference

Used to define clear physical unit. More...

#include <NRE_Unit.hpp>

Inheritance diagram for NRE::Math::Unit< M, L, T, A >:

Public Member Functions

constexpr Unit ()
 
constexpr Unit (double val)
 
constexpr Unit (long double val)
 
constexpr double getValue () const
 
constexpr Unit< std::ratio_divide< M, std::ratio< 2 > >, std::ratio_divide< L, std::ratio< 2 > >, std::ratio_divide< T, std::ratio< 2 > >, std::ratio_divide< A, std::ratio< 2 > > > sqrt ()
 
constexpr Unit const & operator+= (Unit const &u)
 
constexpr Unit const & operator-= (Unit const &u)
 
constexpr Unit operator- () const
 
constexpr Unit operator+ (Unit const &u) const
 
constexpr Unit operator- (Unit const &u) const
 
constexpr bool operator== (Unit const &u) const
 
constexpr bool operator!= (Unit const &u) const
 
constexpr bool operator<= (Unit const &u) const
 
constexpr bool operator>= (Unit const &u) const
 
constexpr bool operator< (Unit const &u) const
 
constexpr bool operator> (Unit const &u) const
 
Utility::String toString () const
 

Detailed Description

template<class M, class L, class T, class A>
class NRE::Math::Unit< M, L, T, A >

Used to define clear physical unit.

Constructor & Destructor Documentation

template<class M, class L, class T, class A>
constexpr NRE::Math::Unit< M, L, T, A >::Unit ( )
inline

Default constructor

template<class M, class L, class T, class A>
constexpr NRE::Math::Unit< M, L, T, A >::Unit ( double  val)
inline

Construct a unit from a value

Parameters
valthe base value
template<class M, class L, class T, class A>
constexpr NRE::Math::Unit< M, L, T, A >::Unit ( long double  val)
inline

Construct a unit from a value

Parameters
valthe base value

Member Function Documentation

template<class M, class L, class T, class A>
constexpr double NRE::Math::Unit< M, L, T, A >::getValue ( ) const
inline

Value getter

Returns
the internal value
template<class M, class L, class T, class A>
constexpr bool NRE::Math::Unit< M, L, T, A >::operator!= ( Unit< M, L, T, A > const &  u) const
inline

Difference test between this and u

Parameters
uthe unit to test with u
Returns
the test's value
template<class M, class L, class T, class A>
constexpr Unit NRE::Math::Unit< M, L, T, A >::operator+ ( Unit< M, L, T, A > const &  u) const
inline

Compute the unit resulting in the addition of a unit to this

Parameters
uthe unit to add
Returns
the resulting unit
template<class M, class L, class T, class A>
constexpr Unit const& NRE::Math::Unit< M, L, T, A >::operator+= ( Unit< M, L, T, A > const &  u)
inline

Add a unit to this

Parameters
uthe unit to add
Returns
a reference to himself
template<class M, class L, class T, class A>
constexpr Unit NRE::Math::Unit< M, L, T, A >::operator- ( ) const
inline

Compute the opposite unit

Returns
the new unit with opposite value
template<class M, class L, class T, class A>
constexpr Unit NRE::Math::Unit< M, L, T, A >::operator- ( Unit< M, L, T, A > const &  u) const
inline

Compute the unit resulting in the subtraction of a unit to this

Parameters
uthe unit to add
Returns
the resulting unit
template<class M, class L, class T, class A>
constexpr Unit const& NRE::Math::Unit< M, L, T, A >::operator-= ( Unit< M, L, T, A > const &  u)
inline

Subtract a unit to this

Parameters
uthe unit to subtract
Returns
a reference to himself
template<class M, class L, class T, class A>
constexpr bool NRE::Math::Unit< M, L, T, A >::operator< ( Unit< M, L, T, A > const &  u) const
inline

Inferior test between this and u

Parameters
uthe unit to test with u
Returns
the test's value
template<class M, class L, class T, class A>
constexpr bool NRE::Math::Unit< M, L, T, A >::operator<= ( Unit< M, L, T, A > const &  u) const
inline

Superior or Equal test between this and u

Parameters
uthe unit to test with u
Returns
the test's value
template<class M, class L, class T, class A>
constexpr bool NRE::Math::Unit< M, L, T, A >::operator== ( Unit< M, L, T, A > const &  u) const
inline

Equality test between this and u

Parameters
uthe unit to test with u
Returns
the test's value
template<class M, class L, class T, class A>
constexpr bool NRE::Math::Unit< M, L, T, A >::operator> ( Unit< M, L, T, A > const &  u) const
inline

Superior test between this and u

Parameters
uthe unit to test with u
Returns
the test's value
template<class M, class L, class T, class A>
constexpr bool NRE::Math::Unit< M, L, T, A >::operator>= ( Unit< M, L, T, A > const &  u) const
inline

Inferior or Equal test between this and u

Parameters
uthe unit to test with u
Returns
the test's value
template<class M, class L, class T, class A>
constexpr Unit<std::ratio_divide<M, std::ratio<2> >, std::ratio_divide<L, std::ratio<2> >, std::ratio_divide<T, std::ratio<2> >, std::ratio_divide<A, std::ratio<2> > > NRE::Math::Unit< M, L, T, A >::sqrt ( )
inline

Compute the square root from the current unit

Returns
the computed value
template<class M, class L, class T, class A>
Utility::String NRE::Math::Unit< M, L, T, A >::toString ( ) const
inline

Convert the unit into a string

Returns
the converted unit

The documentation for this class was generated from the following file:
  • /mnt/c/Users/abell/Documents/GitHub/NRE-Math/src/Math/NRE_Unit.hpp