GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::physics::Quantity< 1, UnitT > Struct Template Reference

#include <GREM/physics/quantities.hpp>

Public Types

using Unit = UnitT
using DimensionType = typename Unit::DimensionType
using MagnitudeType = typename Unit::MagnitudeType

Public Member Functions

GREM_ALWAYS_INLINE constexpr Quantity ()=default
GREM_ALWAYS_INLINE constexpr Quantity (const Quantity &)=default
GREM_ALWAYS_INLINE constexpr Quantity (Quantity &&) noexcept=default
GREM_ALWAYS_INLINE constexpr Quantity & operator= (const Quantity &)=default
GREM_ALWAYS_INLINE constexpr Quantity & operator= (Quantity &&) noexcept=default
GREM_ALWAYS_INLINE constexpr ~Quantity ()=default
GREM_ALWAYS_INLINE constexpr Quantity (Zero)
GREM_ALWAYS_INLINE constexpr Quantity (floating_point auto value)
template<unit OtherUnitT>
requires (!same_as<OtherUnitT, UnitT> && OtherUnitT::DIMENSION == DIMENSION && (OtherUnitT::MagnitudeType::IS_ABSOLUTE == MagnitudeType::IS_ABSOLUTE || !OtherUnitT::MagnitudeType::IS_ABSOLUTE))
GREM_ALWAYS_INLINE constexpr Quantity (const Quantity< 1, OtherUnitT > &q)
template<typename Rep, typename Period>
requires (DIMENSION == TIME && MagnitudeType::VALUE == 1.0l && !MagnitudeType::IS_ABSOLUTE)
GREM_ALWAYS_INLINE constexpr Quantity (const DurationBase< Rep, Period > &duration)
GREM_ALWAYS_INLINE constexpr Quantity & operator= (Zero)
GREM_ALWAYS_INLINE constexpr bool operator== (const Quantity &other) const noexcept
template<typename OtherUnitT>
requires (UnitT{} == OtherUnitT{})
GREM_ALWAYS_INLINE constexpr bool operator== (const Quantity< 1, OtherUnitT > &other) const noexcept
GREM_ALWAYS_INLINE constexpr auto operator<=> (const Quantity &other) const noexcept
template<typename OtherUnitT>
requires (UnitT{} == OtherUnitT{})
GREM_ALWAYS_INLINE constexpr auto operator<=> (const Quantity< 1, OtherUnitT > &other) const noexcept
template<arithmetic Arithmetic>
requires (DIMENSION == DIMENSIONLESS && MagnitudeType::VALUE == 1.0l)
GREM_ALWAYS_INLINE constexpr bool operator== (Arithmetic other) const noexcept
template<arithmetic Arithmetic>
requires (DIMENSION == DIMENSIONLESS && MagnitudeType::VALUE == 1.0l)
GREM_ALWAYS_INLINE constexpr auto operator<=> (Arithmetic other) const noexcept
GREM_ALWAYS_INLINE constexpr bool operator== (Zero) const noexcept
GREM_ALWAYS_INLINE constexpr auto operator<=> (Zero) const noexcept
template<typename Rep, typename Period>
requires (DIMENSION == TIME && !MagnitudeType::IS_ABSOLUTE)
GREM_ALWAYS_INLINE constexpr bool operator== (const DurationBase< Rep, Period > &other) const noexcept
template<typename Rep, typename Period>
requires (DIMENSION == TIME && !MagnitudeType::IS_ABSOLUTE)
GREM_ALWAYS_INLINE constexpr auto operator<=> (const DurationBase< Rep, Period > &other) const noexcept
GREM_ALWAYS_INLINE constexpr operator float () const
GREM_ALWAYS_INLINE constexpr operator double () const
GREM_ALWAYS_INLINE constexpr operator DurationBase< float, Ratio< 1, 1 > > () const
GREM_ALWAYS_INLINE constexpr operator DurationBase< double, Ratio< 1, 1 > > () const
GREM_ALWAYS_INLINE constexpr operator Duration () const
template<unit OtherUnitT>
requires (OtherUnitT::DIMENSION == DIMENSION)
GREM_ALWAYS_INLINE constexpr Quantity< 1, Unitless > in (OtherUnitT) const
template<unit OtherUnitT>
requires (OtherUnitT::DIMENSION == DIMENSION && (OtherUnitT::MagnitudeType::IS_ABSOLUTE == MagnitudeType::IS_ABSOLUTE || OtherUnitT::MagnitudeType::IS_ABSOLUTE))
GREM_ALWAYS_INLINE constexpr Quantity< 1, OtherUnitT > as (OtherUnitT) const
GREM_ALWAYS_INLINE constexpr size_t size () const noexcept
GREM_ALWAYS_INLINE size_t getMinIndex () const
GREM_ALWAYS_INLINE size_t getMaxIndex () const

Static Public Member Functions

template<typename OtherUnitT>
static GREM_ALWAYS_INLINE constexpr Quantity reinterpret (Quantity< 1, OtherUnitT > other)
static GREM_ALWAYS_INLINE constexpr Quantity reinterpret (floating_point auto value)

Static Public Attributes

static constexpr size_t RANK = 1
static constexpr Unit UNIT {}
static constexpr DimensionType DIMENSION {}
static constexpr MagnitudeType MAGNITUDE {}
static const Quantity MIN
static const Quantity MAX
static const Quantity SMALLEST_NORMAL
static const Quantity SMALLEST_SUBNORMAL
static const Quantity MACHINE_EPSILON
static const Quantity INF
static const Quantity QUIET_NAN

Friends

template<size_t OtherN, typename OtherUnitT>
struct Quantity

Member Typedef Documentation

◆ Unit

template<typename UnitT>
using grem::physics::Quantity< 1, UnitT >::Unit = UnitT

◆ DimensionType

template<typename UnitT>
using grem::physics::Quantity< 1, UnitT >::DimensionType = typename Unit::DimensionType

◆ MagnitudeType

template<typename UnitT>
using grem::physics::Quantity< 1, UnitT >::MagnitudeType = typename Unit::MagnitudeType

Constructor & Destructor Documentation

◆ Quantity() [1/7]

template<typename UnitT>
GREM_ALWAYS_INLINE constexpr grem::physics::Quantity< 1, UnitT >::Quantity ( )
constexprdefault

◆ Quantity() [2/7]

template<typename UnitT>
GREM_ALWAYS_INLINE constexpr grem::physics::Quantity< 1, UnitT >::Quantity ( const Quantity< 1, UnitT > & )
constexprdefault

◆ Quantity() [3/7]

template<typename UnitT>
GREM_ALWAYS_INLINE constexpr grem::physics::Quantity< 1, UnitT >::Quantity ( Quantity< 1, UnitT > && )
constexprdefaultnoexcept

◆ ~Quantity()

template<typename UnitT>
GREM_ALWAYS_INLINE constexpr grem::physics::Quantity< 1, UnitT >::~Quantity ( )
constexprdefault

◆ Quantity() [4/7]

template<typename UnitT>
GREM_ALWAYS_INLINE constexpr grem::physics::Quantity< 1, UnitT >::Quantity ( Zero )
inlineconstexpr

◆ Quantity() [5/7]

template<typename UnitT>
GREM_ALWAYS_INLINE constexpr grem::physics::Quantity< 1, UnitT >::Quantity ( floating_point auto value)
inlineconstexpr

◆ Quantity() [6/7]

template<typename UnitT>
template<unit OtherUnitT>
requires (!same_as<OtherUnitT, UnitT> && OtherUnitT::DIMENSION == DIMENSION && (OtherUnitT::MagnitudeType::IS_ABSOLUTE == MagnitudeType::IS_ABSOLUTE || !OtherUnitT::MagnitudeType::IS_ABSOLUTE))
GREM_ALWAYS_INLINE constexpr grem::physics::Quantity< 1, UnitT >::Quantity ( const Quantity< 1, OtherUnitT > & q)
inlineconstexpr

◆ Quantity() [7/7]

template<typename UnitT>
template<typename Rep, typename Period>
requires (DIMENSION == TIME && MagnitudeType::VALUE == 1.0l && !MagnitudeType::IS_ABSOLUTE)
GREM_ALWAYS_INLINE constexpr grem::physics::Quantity< 1, UnitT >::Quantity ( const DurationBase< Rep, Period > & duration)
inlineconstexpr

Member Function Documentation

◆ reinterpret() [1/2]

template<typename UnitT>
template<typename OtherUnitT>
GREM_ALWAYS_INLINE constexpr Quantity grem::physics::Quantity< 1, UnitT >::reinterpret ( Quantity< 1, OtherUnitT > other)
inlinestaticnodiscardconstexpr

◆ reinterpret() [2/2]

template<typename UnitT>
GREM_ALWAYS_INLINE constexpr Quantity grem::physics::Quantity< 1, UnitT >::reinterpret ( floating_point auto value)
inlinestaticnodiscardconstexpr

◆ operator=() [1/3]

template<typename UnitT>
GREM_ALWAYS_INLINE constexpr Quantity & grem::physics::Quantity< 1, UnitT >::operator= ( const Quantity< 1, UnitT > & )
constexprdefault

◆ operator=() [2/3]

template<typename UnitT>
GREM_ALWAYS_INLINE constexpr Quantity & grem::physics::Quantity< 1, UnitT >::operator= ( Quantity< 1, UnitT > && )
constexprdefaultnoexcept

◆ operator=() [3/3]

template<typename UnitT>
GREM_ALWAYS_INLINE constexpr Quantity & grem::physics::Quantity< 1, UnitT >::operator= ( Zero )
inlineconstexpr

◆ operator==() [1/5]

template<typename UnitT>
GREM_ALWAYS_INLINE constexpr bool grem::physics::Quantity< 1, UnitT >::operator== ( const Quantity< 1, UnitT > & other) const
inlinenodiscardconstexprnoexcept

◆ operator==() [2/5]

template<typename UnitT>
template<typename OtherUnitT>
requires (UnitT{} == OtherUnitT{})
GREM_ALWAYS_INLINE constexpr bool grem::physics::Quantity< 1, UnitT >::operator== ( const Quantity< 1, OtherUnitT > & other) const
inlinenodiscardconstexprnoexcept

◆ operator<=>() [1/5]

template<typename UnitT>
GREM_ALWAYS_INLINE constexpr auto grem::physics::Quantity< 1, UnitT >::operator<=> ( const Quantity< 1, UnitT > & other) const
inlinenodiscardconstexprnoexcept

◆ operator<=>() [2/5]

template<typename UnitT>
template<typename OtherUnitT>
requires (UnitT{} == OtherUnitT{})
GREM_ALWAYS_INLINE constexpr auto grem::physics::Quantity< 1, UnitT >::operator<=> ( const Quantity< 1, OtherUnitT > & other) const
inlinenodiscardconstexprnoexcept

◆ operator==() [3/5]

template<typename UnitT>
template<arithmetic Arithmetic>
requires (DIMENSION == DIMENSIONLESS && MagnitudeType::VALUE == 1.0l)
GREM_ALWAYS_INLINE constexpr bool grem::physics::Quantity< 1, UnitT >::operator== ( Arithmetic other) const
inlinenodiscardconstexprnoexcept

◆ operator<=>() [3/5]

template<typename UnitT>
template<arithmetic Arithmetic>
requires (DIMENSION == DIMENSIONLESS && MagnitudeType::VALUE == 1.0l)
GREM_ALWAYS_INLINE constexpr auto grem::physics::Quantity< 1, UnitT >::operator<=> ( Arithmetic other) const
inlinenodiscardconstexprnoexcept

◆ operator==() [4/5]

template<typename UnitT>
GREM_ALWAYS_INLINE constexpr bool grem::physics::Quantity< 1, UnitT >::operator== ( Zero ) const
inlinenodiscardconstexprnoexcept

◆ operator<=>() [4/5]

template<typename UnitT>
GREM_ALWAYS_INLINE constexpr auto grem::physics::Quantity< 1, UnitT >::operator<=> ( Zero ) const
inlinenodiscardconstexprnoexcept

◆ operator==() [5/5]

template<typename UnitT>
template<typename Rep, typename Period>
requires (DIMENSION == TIME && !MagnitudeType::IS_ABSOLUTE)
GREM_ALWAYS_INLINE constexpr bool grem::physics::Quantity< 1, UnitT >::operator== ( const DurationBase< Rep, Period > & other) const
inlinenodiscardconstexprnoexcept

◆ operator<=>() [5/5]

template<typename UnitT>
template<typename Rep, typename Period>
requires (DIMENSION == TIME && !MagnitudeType::IS_ABSOLUTE)
GREM_ALWAYS_INLINE constexpr auto grem::physics::Quantity< 1, UnitT >::operator<=> ( const DurationBase< Rep, Period > & other) const
inlinenodiscardconstexprnoexcept

◆ operator float()

template<typename UnitT>
GREM_ALWAYS_INLINE constexpr grem::physics::Quantity< 1, UnitT >::operator float ( ) const
inlineconstexpr

◆ operator double()

template<typename UnitT>
GREM_ALWAYS_INLINE constexpr grem::physics::Quantity< 1, UnitT >::operator double ( ) const
inlineconstexpr

◆ operator DurationBase< float, Ratio< 1, 1 > >()

template<typename UnitT>
GREM_ALWAYS_INLINE constexpr grem::physics::Quantity< 1, UnitT >::operator DurationBase< float, Ratio< 1, 1 > > ( ) const
inlineconstexpr

◆ operator DurationBase< double, Ratio< 1, 1 > >()

template<typename UnitT>
GREM_ALWAYS_INLINE constexpr grem::physics::Quantity< 1, UnitT >::operator DurationBase< double, Ratio< 1, 1 > > ( ) const
inlineconstexpr

◆ operator Duration()

template<typename UnitT>
GREM_ALWAYS_INLINE constexpr grem::physics::Quantity< 1, UnitT >::operator Duration ( ) const
inlineconstexpr

◆ in()

template<typename UnitT>
template<unit OtherUnitT>
requires (OtherUnitT::DIMENSION == DIMENSION)
GREM_ALWAYS_INLINE constexpr Quantity< 1, Unitless > grem::physics::Quantity< 1, UnitT >::in ( OtherUnitT ) const
inlinenodiscardconstexpr

◆ as()

template<typename UnitT>
template<unit OtherUnitT>
requires (OtherUnitT::DIMENSION == DIMENSION && (OtherUnitT::MagnitudeType::IS_ABSOLUTE == MagnitudeType::IS_ABSOLUTE || OtherUnitT::MagnitudeType::IS_ABSOLUTE))
GREM_ALWAYS_INLINE constexpr Quantity< 1, OtherUnitT > grem::physics::Quantity< 1, UnitT >::as ( OtherUnitT ) const
inlinenodiscardconstexpr

◆ size()

template<typename UnitT>
GREM_ALWAYS_INLINE constexpr size_t grem::physics::Quantity< 1, UnitT >::size ( ) const
inlinenodiscardconstexprnoexcept

◆ getMinIndex()

template<typename UnitT>
GREM_ALWAYS_INLINE size_t grem::physics::Quantity< 1, UnitT >::getMinIndex ( ) const
inlinenodiscard

◆ getMaxIndex()

template<typename UnitT>
GREM_ALWAYS_INLINE size_t grem::physics::Quantity< 1, UnitT >::getMaxIndex ( ) const
inlinenodiscard

◆ Quantity

template<typename UnitT>
template<size_t OtherN, typename OtherUnitT>
friend struct Quantity
friend

Member Data Documentation

◆ RANK

template<typename UnitT>
size_t grem::physics::Quantity< 1, UnitT >::RANK = 1
staticconstexpr

◆ UNIT

template<typename UnitT>
Unit grem::physics::Quantity< 1, UnitT >::UNIT {}
staticconstexpr

◆ DIMENSION

template<typename UnitT>
DimensionType grem::physics::Quantity< 1, UnitT >::DIMENSION {}
staticconstexpr

◆ MAGNITUDE

template<typename UnitT>
MagnitudeType grem::physics::Quantity< 1, UnitT >::MAGNITUDE {}
staticconstexpr

◆ MIN

template<typename UnitT>
const Quantity grem::physics::Quantity< 1, UnitT >::MIN
static

◆ MAX

template<typename UnitT>
const Quantity grem::physics::Quantity< 1, UnitT >::MAX
static

◆ SMALLEST_NORMAL

template<typename UnitT>
const Quantity grem::physics::Quantity< 1, UnitT >::SMALLEST_NORMAL
static

◆ SMALLEST_SUBNORMAL

template<typename UnitT>
const Quantity grem::physics::Quantity< 1, UnitT >::SMALLEST_SUBNORMAL
static

◆ MACHINE_EPSILON

template<typename UnitT>
const Quantity grem::physics::Quantity< 1, UnitT >::MACHINE_EPSILON
static

◆ INF

template<typename UnitT>
const Quantity grem::physics::Quantity< 1, UnitT >::INF
static

◆ QUIET_NAN

template<typename UnitT>
const Quantity grem::physics::Quantity< 1, UnitT >::QUIET_NAN
static

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