GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::physics::ConstComponentProxy< N, UnitT, Index > Class Template Reference

Read-only view of a specific component of a physical vector quantity. More...

#include <GREM/physics/quantities.hpp>

Inheritance diagram for grem::physics::ConstComponentProxy< N, UnitT, Index >:

Public Types

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

Public Member Functions

GREM_ALWAYS_INLINE constexpr ConstComponentProxy (const Quantity< N, UnitT > &quantity) noexcept
GREM_ALWAYS_INLINE constexpr operator Quantity< 1, UnitT > () 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<size_t OtherN, typename OtherUnitT, size_t OtherIndex>
requires (UnitT{} == OtherUnitT{})
GREM_ALWAYS_INLINE constexpr bool operator== (const ConstComponentProxy< OtherN, OtherUnitT, OtherIndex > &other) const noexcept
template<size_t OtherN, typename OtherUnitT, size_t OtherIndex>
requires (UnitT{} == OtherUnitT{})
GREM_ALWAYS_INLINE constexpr auto operator<=> (const ConstComponentProxy< OtherN, OtherUnitT, OtherIndex > &other) const noexcept
template<typename OtherUnitT>
requires (UnitT{} == OtherUnitT{})
GREM_ALWAYS_INLINE constexpr bool operator== (const Quantity< 1, OtherUnitT > &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 (UnitT::DIMENSION == DIMENSIONLESS && UnitT::MagnitudeType::VALUE == 1.0l)
GREM_ALWAYS_INLINE constexpr bool operator== (Arithmetic other) const noexcept
template<arithmetic Arithmetic>
requires (UnitT::DIMENSION == DIMENSIONLESS && UnitT::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 (UnitT::DIMENSION == TIME && !UnitT::MagnitudeType::IS_ABSOLUTE)
GREM_ALWAYS_INLINE constexpr bool operator== (const DurationBase< Rep, Period > &other) const noexcept
template<typename Rep, typename Period>
requires (UnitT::DIMENSION == TIME && !UnitT::MagnitudeType::IS_ABSOLUTE)
GREM_ALWAYS_INLINE constexpr auto operator<=> (const DurationBase< Rep, Period > &other) const noexcept
template<unit OtherUnitT>
requires (OtherUnitT::DIMENSION == DIMENSION)
GREM_ALWAYS_INLINE constexpr Quantity< 1, Unitless > in (OtherUnitT unit) 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 unit) 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 Attributes

static constexpr size_t RANK = 1
static constexpr Unit UNIT {}
static constexpr DimensionType DIMENSION {}
static constexpr MagnitudeType MAGNITUDE {}

Protected Member Functions

GREM_ALWAYS_INLINE constexpr Quantity< 1, UnitT > getValue () const noexcept

Protected Attributes

const Quantity< N, UnitT > * quantity

Detailed Description

template<size_t N, typename UnitT, size_t Index>
class grem::physics::ConstComponentProxy< N, UnitT, Index >

Read-only view of a specific component of a physical vector quantity.

Template Parameters
Nnumber of dimensions of the world space, specifying the number of vector components of the quantity (must be 2 or 3).
UnitTunit type of the quantity.
Indexindex of the referenced component in the quantity vector.

Member Typedef Documentation

◆ Unit

template<size_t N, typename UnitT, size_t Index>
using grem::physics::ConstComponentProxy< N, UnitT, Index >::Unit = UnitT

◆ DimensionType

template<size_t N, typename UnitT, size_t Index>
using grem::physics::ConstComponentProxy< N, UnitT, Index >::DimensionType = typename Unit::DimensionType

◆ MagnitudeType

template<size_t N, typename UnitT, size_t Index>
using grem::physics::ConstComponentProxy< N, UnitT, Index >::MagnitudeType = typename Unit::MagnitudeType

Constructor & Destructor Documentation

◆ ConstComponentProxy()

template<size_t N, typename UnitT, size_t Index>
GREM_ALWAYS_INLINE constexpr grem::physics::ConstComponentProxy< N, UnitT, Index >::ConstComponentProxy ( const Quantity< N, UnitT > & quantity)
inlineconstexprnoexcept

Member Function Documentation

◆ operator Quantity< 1, UnitT >()

template<size_t N, typename UnitT, size_t Index>
GREM_ALWAYS_INLINE constexpr grem::physics::ConstComponentProxy< N, UnitT, Index >::operator Quantity< 1, UnitT > ( ) const
inlineconstexprnoexcept

◆ operator float()

template<size_t N, typename UnitT, size_t Index>
GREM_ALWAYS_INLINE constexpr grem::physics::ConstComponentProxy< N, UnitT, Index >::operator float ( ) const
inlineconstexpr

◆ operator double()

template<size_t N, typename UnitT, size_t Index>
GREM_ALWAYS_INLINE constexpr grem::physics::ConstComponentProxy< N, UnitT, Index >::operator double ( ) const
inlineconstexpr

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

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

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

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

◆ operator Duration()

template<size_t N, typename UnitT, size_t Index>
GREM_ALWAYS_INLINE constexpr grem::physics::ConstComponentProxy< N, UnitT, Index >::operator Duration ( ) const
inlineconstexpr

◆ operator==() [1/5]

template<size_t N, typename UnitT, size_t Index>
template<size_t OtherN, typename OtherUnitT, size_t OtherIndex>
requires (UnitT{} == OtherUnitT{})
GREM_ALWAYS_INLINE constexpr bool grem::physics::ConstComponentProxy< N, UnitT, Index >::operator== ( const ConstComponentProxy< OtherN, OtherUnitT, OtherIndex > & other) const
inlinenodiscardconstexprnoexcept

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

template<size_t N, typename UnitT, size_t Index>
template<size_t OtherN, typename OtherUnitT, size_t OtherIndex>
requires (UnitT{} == OtherUnitT{})
GREM_ALWAYS_INLINE constexpr auto grem::physics::ConstComponentProxy< N, UnitT, Index >::operator<=> ( const ConstComponentProxy< OtherN, OtherUnitT, OtherIndex > & other) const
inlinenodiscardconstexprnoexcept

◆ operator==() [2/5]

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

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

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

◆ operator==() [3/5]

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

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

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

◆ operator==() [4/5]

template<size_t N, typename UnitT, size_t Index>
GREM_ALWAYS_INLINE constexpr bool grem::physics::ConstComponentProxy< N, UnitT, Index >::operator== ( Zero ) const
inlinenodiscardconstexprnoexcept

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

template<size_t N, typename UnitT, size_t Index>
GREM_ALWAYS_INLINE constexpr auto grem::physics::ConstComponentProxy< N, UnitT, Index >::operator<=> ( Zero ) const
inlinenodiscardconstexprnoexcept

◆ operator==() [5/5]

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

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

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

◆ in()

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

◆ as()

template<size_t N, typename UnitT, size_t Index>
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::ConstComponentProxy< N, UnitT, Index >::as ( OtherUnitT unit) const
inlinenodiscardconstexpr

◆ size()

template<size_t N, typename UnitT, size_t Index>
GREM_ALWAYS_INLINE constexpr size_t grem::physics::ConstComponentProxy< N, UnitT, Index >::size ( ) const
inlinenodiscardconstexprnoexcept

◆ getMinIndex()

template<size_t N, typename UnitT, size_t Index>
GREM_ALWAYS_INLINE size_t grem::physics::ConstComponentProxy< N, UnitT, Index >::getMinIndex ( ) const
inlinenodiscard

◆ getMaxIndex()

template<size_t N, typename UnitT, size_t Index>
GREM_ALWAYS_INLINE size_t grem::physics::ConstComponentProxy< N, UnitT, Index >::getMaxIndex ( ) const
inlinenodiscard

◆ getValue()

template<size_t N, typename UnitT, size_t Index>
GREM_ALWAYS_INLINE constexpr Quantity< 1, UnitT > grem::physics::ConstComponentProxy< N, UnitT, Index >::getValue ( ) const
inlinenodiscardconstexprprotectednoexcept

Member Data Documentation

◆ RANK

template<size_t N, typename UnitT, size_t Index>
size_t grem::physics::ConstComponentProxy< N, UnitT, Index >::RANK = 1
staticconstexpr

◆ UNIT

template<size_t N, typename UnitT, size_t Index>
Unit grem::physics::ConstComponentProxy< N, UnitT, Index >::UNIT {}
staticconstexpr

◆ DIMENSION

template<size_t N, typename UnitT, size_t Index>
DimensionType grem::physics::ConstComponentProxy< N, UnitT, Index >::DIMENSION {}
staticconstexpr

◆ MAGNITUDE

template<size_t N, typename UnitT, size_t Index>
MagnitudeType grem::physics::ConstComponentProxy< N, UnitT, Index >::MAGNITUDE {}
staticconstexpr

◆ quantity

template<size_t N, typename UnitT, size_t Index>
const Quantity<N, UnitT>* grem::physics::ConstComponentProxy< N, UnitT, Index >::quantity
protected

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