Physical Quantities  v1.0.0
C++ library of physical quantities, physical models, and units of measure for scientific computing. https://github.com/acodcha/phq
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PhQ::DimensionalPlanarVector< UnitType, NumericType > Class Template Reference

Abstract base class that represents any dimensional planar vector physical quantity. Such a physical quantity is composed of a value and a unit of measure where the value is a two- dimensional planar vector in the XY plane. More...

#include "DimensionalPlanarVector.hpp"

Public Member Functions

constexpr const PhQ::PlanarVector< NumericType > & Value () const noexcept
 Value of this physical quantity expressed in its standard unit of measure. More...
 
PhQ::PlanarVector< NumericType > Value (const UnitType unit) const
 Value of this physical quantity expressed in a given unit of measure. More...
 
template<UnitType NewUnit>
constexpr PhQ::PlanarVector< NumericType > StaticValue () const
 Value of this physical quantity expressed in a given unit of measure. This method can be evaluated statically at compile-time. More...
 
constexpr PhQ::PlanarVector< NumericType > & MutableValue () noexcept
 Returns the value of this physical quantity expressed in its standard unit of measure as a mutable value. More...
 
constexpr void SetValue (const PhQ::PlanarVector< NumericType > &value) noexcept
 Sets the value of this physical quantity expressed in its standard unit of measure to the given value. More...
 
std::string Print () const
 Prints this physical quantity as a string. This physical quantity's value is expressed in its standard unit of measure. More...
 
std::string Print (const UnitType unit) const
 Prints this physical quantity as a string. This physical quantity's value is expressed in the given unit of measure. More...
 
std::string JSON () const
 Serializes this physical quantity as a JSON message. This physical quantity's value is expressed in its standard unit of measure. More...
 
std::string JSON (const UnitType unit) const
 Serializes this physical quantity as a JSON message. This physical quantity's value is expressed in the given unit of measure. More...
 
std::string XML () const
 Serializes this physical quantity as an XML message. This physical quantity's value is expressed in its standard unit of measure. More...
 
std::string XML (const UnitType unit) const
 Serializes this physical quantity as an XML message. This physical quantity's value is expressed in the given unit of measure. More...
 
std::string YAML () const
 Serializes this physical quantity as a YAML message. This physical quantity's value is expressed in its standard unit of measure. More...
 
std::string YAML (const UnitType unit) const
 Serializes this physical quantity as a YAML message. This physical quantity's value is expressed in the given unit of measure. More...
 

Static Public Member Functions

static constexpr const PhQ::DimensionsDimensions ()
 Physical dimension set of this physical quantity. More...
 
static constexpr UnitType Unit ()
 Standard unit of measure for this physical quantity. This physical quantity's value is stored internally in this unit of measure. More...
 

Protected Member Functions

 DimensionalPlanarVector ()=default
 Default constructor. Constructs a dimensional planar vector physical quantity with an uninitialized value. More...
 
constexpr DimensionalPlanarVector (const PhQ::PlanarVector< NumericType > &value)
 Constructor. Constructs a dimensional planar vector physical quantity with a given value expressed in its standard unit of measure. More...
 
 DimensionalPlanarVector (const PhQ::PlanarVector< NumericType > &value, const UnitType unit)
 Constructor. Constructs a dimensional planar vector physical quantity with a given value expressed in a given unit of measure. More...
 
 ~DimensionalPlanarVector () noexcept=default
 Destructor. Destroys this dimensional planar vector physical quantity. More...
 
constexpr DimensionalPlanarVector (const DimensionalPlanarVector< UnitType, NumericType > &other)=default
 Copy constructor. Constructs a dimensional planar vector physical quantity by copying another one. More...
 
template<typename OtherNumericType >
constexpr DimensionalPlanarVector (const DimensionalPlanarVector< UnitType, OtherNumericType > &other)
 Copy constructor. Constructs a dimensional planar vector physical quantity by copying another one. More...
 
constexpr DimensionalPlanarVector (DimensionalPlanarVector< UnitType, NumericType > &&other) noexcept=default
 Move constructor. Constructs a dimensional planar vector physical quantity by moving another one. More...
 
constexpr DimensionalPlanarVector< UnitType, NumericType > & operator= (const DimensionalPlanarVector< UnitType, NumericType > &other)=default
 Copy assignment operator. Assigns this dimensional planar vector physical quantity by copying another one. More...
 
template<typename OtherNumericType >
constexpr DimensionalPlanarVector< UnitType, NumericType > & operator= (const DimensionalPlanarVector< UnitType, OtherNumericType > &other)
 Copy assignment operator. Assigns this dimensional planar vector physical quantity by copying another one. More...
 
constexpr DimensionalPlanarVector< UnitType, NumericType > & operator= (DimensionalPlanarVector< UnitType, NumericType > &&other) noexcept=default
 Move assignment operator. Assigns this dimensional planar vector physical quantity by moving another one. More...
 

Protected Attributes

PhQ::PlanarVector< NumericType > value
 Value of this physical quantity expressed in its standard unit of measure. More...
 

Detailed Description

template<typename UnitType, typename NumericType = double>
class PhQ::DimensionalPlanarVector< UnitType, NumericType >

Abstract base class that represents any dimensional planar vector physical quantity. Such a physical quantity is composed of a value and a unit of measure where the value is a two- dimensional planar vector in the XY plane.

Template Parameters
UnitTypeUnit of measure enumeration type.
NumericTypeFloating-point numeric type: float, double, or long double. Defaults to double if unspecified.

Definition at line 47 of file DimensionalPlanarVector.hpp.

Constructor & Destructor Documentation

◆ DimensionalPlanarVector() [1/6]

template<typename UnitType , typename NumericType = double>
PhQ::DimensionalPlanarVector< UnitType, NumericType >::DimensionalPlanarVector ( )
protecteddefault

Default constructor. Constructs a dimensional planar vector physical quantity with an uninitialized value.

◆ DimensionalPlanarVector() [2/6]

template<typename UnitType , typename NumericType = double>
constexpr PhQ::DimensionalPlanarVector< UnitType, NumericType >::DimensionalPlanarVector ( const PhQ::PlanarVector< NumericType > &  value)
inlineexplicitconstexprprotected

Constructor. Constructs a dimensional planar vector physical quantity with a given value expressed in its standard unit of measure.

Definition at line 168 of file DimensionalPlanarVector.hpp.

◆ DimensionalPlanarVector() [3/6]

template<typename UnitType , typename NumericType = double>
PhQ::DimensionalPlanarVector< UnitType, NumericType >::DimensionalPlanarVector ( const PhQ::PlanarVector< NumericType > &  value,
const UnitType  unit 
)
inlineprotected

Constructor. Constructs a dimensional planar vector physical quantity with a given value expressed in a given unit of measure.

Definition at line 173 of file DimensionalPlanarVector.hpp.

References PhQ::ConvertInPlace().

◆ ~DimensionalPlanarVector()

template<typename UnitType , typename NumericType = double>
PhQ::DimensionalPlanarVector< UnitType, NumericType >::~DimensionalPlanarVector ( )
protecteddefaultnoexcept

Destructor. Destroys this dimensional planar vector physical quantity.

◆ DimensionalPlanarVector() [4/6]

template<typename UnitType , typename NumericType = double>
constexpr PhQ::DimensionalPlanarVector< UnitType, NumericType >::DimensionalPlanarVector ( const DimensionalPlanarVector< UnitType, NumericType > &  other)
constexprprotecteddefault

Copy constructor. Constructs a dimensional planar vector physical quantity by copying another one.

◆ DimensionalPlanarVector() [5/6]

template<typename UnitType , typename NumericType = double>
template<typename OtherNumericType >
constexpr PhQ::DimensionalPlanarVector< UnitType, NumericType >::DimensionalPlanarVector ( const DimensionalPlanarVector< UnitType, OtherNumericType > &  other)
inlineexplicitconstexprprotected

Copy constructor. Constructs a dimensional planar vector physical quantity by copying another one.

Template Parameters
OtherNumericTypeFloating-point numeric type of the other physical quantity. Deduced automatically.

Definition at line 191 of file DimensionalPlanarVector.hpp.

◆ DimensionalPlanarVector() [6/6]

template<typename UnitType , typename NumericType = double>
constexpr PhQ::DimensionalPlanarVector< UnitType, NumericType >::DimensionalPlanarVector ( DimensionalPlanarVector< UnitType, NumericType > &&  other)
constexprprotecteddefaultnoexcept

Move constructor. Constructs a dimensional planar vector physical quantity by moving another one.

Member Function Documentation

◆ Dimensions()

template<typename UnitType , typename NumericType = double>
static constexpr const PhQ::Dimensions& PhQ::DimensionalPlanarVector< UnitType, NumericType >::Dimensions ( )
inlinestaticconstexpr

Physical dimension set of this physical quantity.

Definition at line 50 of file DimensionalPlanarVector.hpp.

◆ JSON() [1/2]

template<typename UnitType , typename NumericType = double>
std::string PhQ::DimensionalPlanarVector< UnitType, NumericType >::JSON ( ) const
inline

Serializes this physical quantity as a JSON message. This physical quantity's value is expressed in its standard unit of measure.

Definition at line 103 of file DimensionalPlanarVector.hpp.

References PhQ::Abbreviation(), and PhQ::DimensionalPlanarVector< UnitType, NumericType >::value.

Referenced by PhQ::DimensionalPlanarVector< UnitType, NumericType >::JSON().

◆ JSON() [2/2]

template<typename UnitType , typename NumericType = double>
std::string PhQ::DimensionalPlanarVector< UnitType, NumericType >::JSON ( const UnitType  unit) const
inline

Serializes this physical quantity as a JSON message. This physical quantity's value is expressed in the given unit of measure.

Definition at line 113 of file DimensionalPlanarVector.hpp.

References PhQ::Abbreviation(), PhQ::DimensionalPlanarVector< UnitType, NumericType >::JSON(), and PhQ::DimensionalPlanarVector< UnitType, NumericType >::Value().

◆ MutableValue()

template<typename UnitType , typename NumericType = double>
constexpr PhQ::PlanarVector<NumericType>& PhQ::DimensionalPlanarVector< UnitType, NumericType >::MutableValue ( )
inlineconstexprnoexcept

Returns the value of this physical quantity expressed in its standard unit of measure as a mutable value.

Definition at line 79 of file DimensionalPlanarVector.hpp.

References PhQ::DimensionalPlanarVector< UnitType, NumericType >::value.

◆ operator=() [1/3]

template<typename UnitType , typename NumericType = double>
constexpr DimensionalPlanarVector<UnitType, NumericType>& PhQ::DimensionalPlanarVector< UnitType, NumericType >::operator= ( const DimensionalPlanarVector< UnitType, NumericType > &  other)
constexprprotecteddefault

Copy assignment operator. Assigns this dimensional planar vector physical quantity by copying another one.

◆ operator=() [2/3]

template<typename UnitType , typename NumericType = double>
template<typename OtherNumericType >
constexpr DimensionalPlanarVector<UnitType, NumericType>& PhQ::DimensionalPlanarVector< UnitType, NumericType >::operator= ( const DimensionalPlanarVector< UnitType, OtherNumericType > &  other)
inlineconstexprprotected

Copy assignment operator. Assigns this dimensional planar vector physical quantity by copying another one.

Template Parameters
OtherNumericTypeFloating-point numeric type of the other physical quantity. Deduced automatically.

Definition at line 210 of file DimensionalPlanarVector.hpp.

References PhQ::DimensionalPlanarVector< UnitType, NumericType >::Value(), and PhQ::DimensionalPlanarVector< UnitType, NumericType >::value.

◆ operator=() [3/3]

template<typename UnitType , typename NumericType = double>
constexpr DimensionalPlanarVector<UnitType, NumericType>& PhQ::DimensionalPlanarVector< UnitType, NumericType >::operator= ( DimensionalPlanarVector< UnitType, NumericType > &&  other)
constexprprotecteddefaultnoexcept

Move assignment operator. Assigns this dimensional planar vector physical quantity by moving another one.

◆ Print() [1/2]

template<typename UnitType , typename NumericType = double>
std::string PhQ::DimensionalPlanarVector< UnitType, NumericType >::Print ( ) const
inline

Prints this physical quantity as a string. This physical quantity's value is expressed in its standard unit of measure.

Definition at line 91 of file DimensionalPlanarVector.hpp.

References PhQ::Abbreviation(), and PhQ::DimensionalPlanarVector< UnitType, NumericType >::value.

Referenced by PhQ::operator<<().

◆ Print() [2/2]

template<typename UnitType , typename NumericType = double>
std::string PhQ::DimensionalPlanarVector< UnitType, NumericType >::Print ( const UnitType  unit) const
inline

Prints this physical quantity as a string. This physical quantity's value is expressed in the given unit of measure.

Definition at line 97 of file DimensionalPlanarVector.hpp.

References PhQ::Abbreviation(), and PhQ::DimensionalPlanarVector< UnitType, NumericType >::Value().

◆ SetValue()

template<typename UnitType , typename NumericType = double>
constexpr void PhQ::DimensionalPlanarVector< UnitType, NumericType >::SetValue ( const PhQ::PlanarVector< NumericType > &  value)
inlineconstexprnoexcept

Sets the value of this physical quantity expressed in its standard unit of measure to the given value.

Definition at line 85 of file DimensionalPlanarVector.hpp.

References PhQ::DimensionalPlanarVector< UnitType, NumericType >::value.

◆ StaticValue()

template<typename UnitType , typename NumericType = double>
template<UnitType NewUnit>
constexpr PhQ::PlanarVector<NumericType> PhQ::DimensionalPlanarVector< UnitType, NumericType >::StaticValue ( ) const
inlineconstexpr

Value of this physical quantity expressed in a given unit of measure. This method can be evaluated statically at compile-time.

Definition at line 73 of file DimensionalPlanarVector.hpp.

References PhQ::DimensionalPlanarVector< UnitType, NumericType >::value.

◆ Unit()

template<typename UnitType , typename NumericType = double>
static constexpr UnitType PhQ::DimensionalPlanarVector< UnitType, NumericType >::Unit ( )
inlinestaticconstexpr

Standard unit of measure for this physical quantity. This physical quantity's value is stored internally in this unit of measure.

Definition at line 56 of file DimensionalPlanarVector.hpp.

◆ Value() [1/2]

template<typename UnitType , typename NumericType = double>
constexpr const PhQ::PlanarVector<NumericType>& PhQ::DimensionalPlanarVector< UnitType, NumericType >::Value ( ) const
inlineconstexprnoexcept

Value of this physical quantity expressed in its standard unit of measure.

Definition at line 61 of file DimensionalPlanarVector.hpp.

References PhQ::DimensionalPlanarVector< UnitType, NumericType >::value.

Referenced by PhQ::Acceleration< NumericType >::Acceleration(), PhQ::Displacement< NumericType >::Displacement(), PhQ::Force< NumericType >::Force(), PhQ::HeatFlux< NumericType >::HeatFlux(), PhQ::DimensionalPlanarVector< UnitType, NumericType >::JSON(), PhQ::PlanarPosition< NumericType >::operator+(), PhQ::PlanarDisplacement< NumericType >::operator+(), PhQ::PlanarPosition< NumericType >::operator-(), PhQ::PlanarDisplacement< NumericType >::operator-(), PhQ::DimensionalPlanarVector< UnitType, NumericType >::operator=(), PhQ::PlanarAcceleration< NumericType >::operator=(), PhQ::PlanarDisplacement< NumericType >::operator=(), PhQ::PlanarForce< NumericType >::operator=(), PhQ::PlanarHeatFlux< NumericType >::operator=(), PhQ::PlanarPosition< NumericType >::operator=(), PhQ::PlanarTemperatureGradient< NumericType >::operator=(), PhQ::PlanarTraction< NumericType >::operator=(), PhQ::PlanarVelocity< NumericType >::operator=(), PhQ::PlanarHeatFlux< NumericType >::PlanarHeatFlux(), PhQ::Position< NumericType >::Position(), PhQ::DimensionalPlanarVector< UnitType, NumericType >::Print(), PhQ::TemperatureGradient< NumericType >::TemperatureGradient(), PhQ::Traction< NumericType >::Traction(), PhQ::Velocity< NumericType >::Velocity(), PhQ::DimensionalPlanarVector< UnitType, NumericType >::XML(), and PhQ::DimensionalPlanarVector< UnitType, NumericType >::YAML().

◆ Value() [2/2]

template<typename UnitType , typename NumericType = double>
PhQ::PlanarVector<NumericType> PhQ::DimensionalPlanarVector< UnitType, NumericType >::Value ( const UnitType  unit) const
inline

Value of this physical quantity expressed in a given unit of measure.

Definition at line 66 of file DimensionalPlanarVector.hpp.

References PhQ::Convert(), and PhQ::DimensionalPlanarVector< UnitType, NumericType >::value.

◆ XML() [1/2]

template<typename UnitType , typename NumericType = double>
std::string PhQ::DimensionalPlanarVector< UnitType, NumericType >::XML ( ) const
inline

Serializes this physical quantity as an XML message. This physical quantity's value is expressed in its standard unit of measure.

Definition at line 123 of file DimensionalPlanarVector.hpp.

References PhQ::Abbreviation(), and PhQ::DimensionalPlanarVector< UnitType, NumericType >::value.

Referenced by PhQ::DimensionalPlanarVector< UnitType, NumericType >::XML().

◆ XML() [2/2]

template<typename UnitType , typename NumericType = double>
std::string PhQ::DimensionalPlanarVector< UnitType, NumericType >::XML ( const UnitType  unit) const
inline

Serializes this physical quantity as an XML message. This physical quantity's value is expressed in the given unit of measure.

Definition at line 133 of file DimensionalPlanarVector.hpp.

References PhQ::Abbreviation(), PhQ::DimensionalPlanarVector< UnitType, NumericType >::Value(), and PhQ::DimensionalPlanarVector< UnitType, NumericType >::XML().

◆ YAML() [1/2]

template<typename UnitType , typename NumericType = double>
std::string PhQ::DimensionalPlanarVector< UnitType, NumericType >::YAML ( ) const
inline

Serializes this physical quantity as a YAML message. This physical quantity's value is expressed in its standard unit of measure.

Definition at line 143 of file DimensionalPlanarVector.hpp.

References PhQ::Abbreviation(), and PhQ::DimensionalPlanarVector< UnitType, NumericType >::value.

Referenced by PhQ::DimensionalPlanarVector< UnitType, NumericType >::YAML().

◆ YAML() [2/2]

template<typename UnitType , typename NumericType = double>
std::string PhQ::DimensionalPlanarVector< UnitType, NumericType >::YAML ( const UnitType  unit) const
inline

Serializes this physical quantity as a YAML message. This physical quantity's value is expressed in the given unit of measure.

Definition at line 153 of file DimensionalPlanarVector.hpp.

References PhQ::Abbreviation(), PhQ::DimensionalPlanarVector< UnitType, NumericType >::Value(), and PhQ::DimensionalPlanarVector< UnitType, NumericType >::YAML().

Member Data Documentation

◆ value

template<typename UnitType , typename NumericType = double>
PhQ::PlanarVector<NumericType> PhQ::DimensionalPlanarVector< UnitType, NumericType >::value
protected

Value of this physical quantity expressed in its standard unit of measure.

Definition at line 222 of file DimensionalPlanarVector.hpp.

Referenced by PhQ::DimensionalPlanarVector< UnitType, NumericType >::JSON(), PhQ::DimensionalPlanarVector< UnitType, NumericType >::MutableValue(), PhQ::PlanarAcceleration< NumericType >::operator+(), PhQ::PlanarDisplacement< NumericType >::operator+(), PhQ::PlanarForce< NumericType >::operator+(), PhQ::PlanarHeatFlux< NumericType >::operator+(), PhQ::PlanarPosition< NumericType >::operator+(), PhQ::PlanarTemperatureGradient< NumericType >::operator+(), PhQ::PlanarTraction< NumericType >::operator+(), PhQ::PlanarVelocity< NumericType >::operator+(), PhQ::PlanarAcceleration< NumericType >::operator-(), PhQ::PlanarDisplacement< NumericType >::operator-(), PhQ::PlanarForce< NumericType >::operator-(), PhQ::PlanarHeatFlux< NumericType >::operator-(), PhQ::PlanarPosition< NumericType >::operator-(), PhQ::PlanarTemperatureGradient< NumericType >::operator-(), PhQ::PlanarTraction< NumericType >::operator-(), PhQ::PlanarVelocity< NumericType >::operator-(), PhQ::DimensionalPlanarVector< UnitType, NumericType >::operator=(), PhQ::DimensionalPlanarVector< UnitType, NumericType >::Print(), PhQ::DimensionalPlanarVector< UnitType, NumericType >::SetValue(), PhQ::DimensionalPlanarVector< UnitType, NumericType >::StaticValue(), PhQ::DimensionalPlanarVector< UnitType, NumericType >::Value(), PhQ::DimensionalPlanarVector< UnitType, NumericType >::XML(), and PhQ::DimensionalPlanarVector< UnitType, NumericType >::YAML().


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