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 | Private Attributes | List of all members
PhQ::Dimensions Class Reference

Physical dimension set of a unit of measure or physical quantity. Composed of the seven independent base physical dimensions: time (T), length (L), mass (M), electric current (I), temperature (Θ), amount of substance (N), and luminous intensity (J). Units of measure that share the same physical dimension set are of the same type and can be converted between one another. For example, the metre per second and the mile per hour are both units of measure that have the same physical dimension set of T^(-1)·L, which is the physical dimension set of speed, so these two units of measure can be converted between one another. On the other hand, the kilogram per cubic metre is a unit of measure with physical dimension set L^(-3)·M, which is the physical dimension set of mass density, so this unit of measure cannot be converted to either the metre per second or the mile per hour, which have a different physical dimension set. More...

#include "Dimensions.hpp"

Public Member Functions

constexpr Dimensions ()=default
 Default constructor. Constructs a dimensionless physical dimension set where all base physical dimensions are zero. More...
 
constexpr Dimensions (const Dimension::Time &time, const Dimension::Length &length, const Dimension::Mass &mass, const Dimension::ElectricCurrent &electric_current, const Dimension::Temperature &temperature, const Dimension::SubstanceAmount &substance_amount, const Dimension::LuminousIntensity &luminous_intensity)
 Constructor. Constructs a physical dimension set from the given base physical dimensions. More...
 
 ~Dimensions () noexcept=default
 Destructor. Destroys this physical dimension set. More...
 
constexpr Dimensions (const Dimensions &other)=default
 Copy constructor. Constructs a physical dimension set by copying another one. More...
 
constexpr Dimensions (Dimensions &&other) noexcept=default
 Move constructor. Constructs a physical dimension set by moving another one. More...
 
constexpr Dimensionsoperator= (const Dimensions &other)=default
 Copy assignment operator. Assigns the base physical dimensions of this physical dimension set by copying from another one. More...
 
constexpr Dimensionsoperator= (Dimensions &&other) noexcept=default
 Move assignment operator. Assigns the base physical dimensions of this physical dimension set by moving another one. More...
 
constexpr const Dimension::TimeTime () const noexcept
 Base physical dimension of time of this physical dimension set. More...
 
constexpr const Dimension::LengthLength () const noexcept
 Base physical dimension of length of this physical dimension set. More...
 
constexpr const Dimension::MassMass () const noexcept
 Base physical dimension of mass of this physical dimension set. More...
 
constexpr const Dimension::ElectricCurrentElectricCurrent () const noexcept
 Base physical dimension of electric current of this physical dimension set. More...
 
constexpr const Dimension::TemperatureTemperature () const noexcept
 Base physical dimension of temperature of this physical dimension set. More...
 
constexpr const Dimension::SubstanceAmountSubstanceAmount () const noexcept
 Base physical dimension of amount of substance of this physical dimension set. More...
 
constexpr const Dimension::LuminousIntensityLuminousIntensity () const noexcept
 Base physical dimension of luminous intensity of this physical dimension set. More...
 
std::string Print () const
 Prints this physical dimension set as a string. More...
 
std::string JSON () const
 Serializes this physical dimension set as a JSON message. More...
 
std::string XML () const
 Serializes this physical dimension set as an XML message. More...
 
std::string YAML () const
 Serializes this physical dimension set as a YAML message. More...
 

Private Attributes

Dimension::Time time
 Base physical dimension of time of this physical dimension set. More...
 
Dimension::Length length
 Base physical dimension of length of this physical dimension set. More...
 
Dimension::Mass mass
 Base physical dimension of mass of this physical dimension set. More...
 
Dimension::ElectricCurrent electric_current
 Base physical dimension of electric current of this physical dimension set. More...
 
Dimension::Temperature temperature
 Base physical dimension of temperature of this physical dimension set. More...
 
Dimension::SubstanceAmount substance_amount
 Base physical dimension of amount of substance of this physical dimension set. More...
 
Dimension::LuminousIntensity luminous_intensity
 Base physical dimension of luminous intensity of this physical dimension set. More...
 

Detailed Description

Physical dimension set of a unit of measure or physical quantity. Composed of the seven independent base physical dimensions: time (T), length (L), mass (M), electric current (I), temperature (Θ), amount of substance (N), and luminous intensity (J). Units of measure that share the same physical dimension set are of the same type and can be converted between one another. For example, the metre per second and the mile per hour are both units of measure that have the same physical dimension set of T^(-1)·L, which is the physical dimension set of speed, so these two units of measure can be converted between one another. On the other hand, the kilogram per cubic metre is a unit of measure with physical dimension set L^(-3)·M, which is the physical dimension set of mass density, so this unit of measure cannot be converted to either the metre per second or the mile per hour, which have a different physical dimension set.

Definition at line 49 of file Dimensions.hpp.

Constructor & Destructor Documentation

◆ Dimensions() [1/4]

constexpr PhQ::Dimensions::Dimensions ( )
constexprdefault

Default constructor. Constructs a dimensionless physical dimension set where all base physical dimensions are zero.

◆ Dimensions() [2/4]

constexpr PhQ::Dimensions::Dimensions ( const Dimension::Time time,
const Dimension::Length length,
const Dimension::Mass mass,
const Dimension::ElectricCurrent electric_current,
const Dimension::Temperature temperature,
const Dimension::SubstanceAmount substance_amount,
const Dimension::LuminousIntensity luminous_intensity 
)
inlineconstexpr

Constructor. Constructs a physical dimension set from the given base physical dimensions.

Definition at line 57 of file Dimensions.hpp.

◆ ~Dimensions()

PhQ::Dimensions::~Dimensions ( )
defaultnoexcept

Destructor. Destroys this physical dimension set.

◆ Dimensions() [3/4]

constexpr PhQ::Dimensions::Dimensions ( const Dimensions other)
constexprdefault

Copy constructor. Constructs a physical dimension set by copying another one.

◆ Dimensions() [4/4]

constexpr PhQ::Dimensions::Dimensions ( Dimensions &&  other)
constexprdefaultnoexcept

Move constructor. Constructs a physical dimension set by moving another one.

Member Function Documentation

◆ ElectricCurrent()

constexpr const Dimension::ElectricCurrent& PhQ::Dimensions::ElectricCurrent ( ) const
inlineconstexprnoexcept

Base physical dimension of electric current of this physical dimension set.

Definition at line 99 of file Dimensions.hpp.

References electric_current.

◆ JSON()

std::string PhQ::Dimensions::JSON ( ) const
inline

◆ Length()

constexpr const Dimension::Length& PhQ::Dimensions::Length ( ) const
inlineconstexprnoexcept

Base physical dimension of length of this physical dimension set.

Definition at line 89 of file Dimensions.hpp.

References length.

◆ LuminousIntensity()

constexpr const Dimension::LuminousIntensity& PhQ::Dimensions::LuminousIntensity ( ) const
inlineconstexprnoexcept

Base physical dimension of luminous intensity of this physical dimension set.

Definition at line 114 of file Dimensions.hpp.

References luminous_intensity.

◆ Mass()

constexpr const Dimension::Mass& PhQ::Dimensions::Mass ( ) const
inlineconstexprnoexcept

Base physical dimension of mass of this physical dimension set.

Definition at line 94 of file Dimensions.hpp.

References mass.

◆ operator=() [1/2]

constexpr Dimensions& PhQ::Dimensions::operator= ( const Dimensions other)
constexprdefault

Copy assignment operator. Assigns the base physical dimensions of this physical dimension set by copying from another one.

◆ operator=() [2/2]

constexpr Dimensions& PhQ::Dimensions::operator= ( Dimensions &&  other)
constexprdefaultnoexcept

Move assignment operator. Assigns the base physical dimensions of this physical dimension set by moving another one.

◆ Print()

std::string PhQ::Dimensions::Print ( ) const
inline

◆ SubstanceAmount()

constexpr const Dimension::SubstanceAmount& PhQ::Dimensions::SubstanceAmount ( ) const
inlineconstexprnoexcept

Base physical dimension of amount of substance of this physical dimension set.

Definition at line 109 of file Dimensions.hpp.

References substance_amount.

◆ Temperature()

constexpr const Dimension::Temperature& PhQ::Dimensions::Temperature ( ) const
inlineconstexprnoexcept

Base physical dimension of temperature of this physical dimension set.

Definition at line 104 of file Dimensions.hpp.

References temperature.

◆ Time()

constexpr const Dimension::Time& PhQ::Dimensions::Time ( ) const
inlineconstexprnoexcept

Base physical dimension of time of this physical dimension set.

Definition at line 84 of file Dimensions.hpp.

References time.

◆ XML()

std::string PhQ::Dimensions::XML ( ) const
inline

◆ YAML()

std::string PhQ::Dimensions::YAML ( ) const
inline

Member Data Documentation

◆ electric_current

Dimension::ElectricCurrent PhQ::Dimensions::electric_current
private

Base physical dimension of electric current of this physical dimension set.

Definition at line 319 of file Dimensions.hpp.

Referenced by ElectricCurrent(), JSON(), Print(), XML(), and YAML().

◆ length

Dimension::Length PhQ::Dimensions::length
private

Base physical dimension of length of this physical dimension set.

Definition at line 313 of file Dimensions.hpp.

Referenced by JSON(), Length(), Print(), XML(), and YAML().

◆ luminous_intensity

Dimension::LuminousIntensity PhQ::Dimensions::luminous_intensity
private

Base physical dimension of luminous intensity of this physical dimension set.

Definition at line 328 of file Dimensions.hpp.

Referenced by JSON(), LuminousIntensity(), Print(), XML(), and YAML().

◆ mass

Dimension::Mass PhQ::Dimensions::mass
private

Base physical dimension of mass of this physical dimension set.

Definition at line 316 of file Dimensions.hpp.

Referenced by JSON(), Mass(), Print(), XML(), and YAML().

◆ substance_amount

Dimension::SubstanceAmount PhQ::Dimensions::substance_amount
private

Base physical dimension of amount of substance of this physical dimension set.

Definition at line 325 of file Dimensions.hpp.

Referenced by JSON(), Print(), SubstanceAmount(), XML(), and YAML().

◆ temperature

Dimension::Temperature PhQ::Dimensions::temperature
private

Base physical dimension of temperature of this physical dimension set.

Definition at line 322 of file Dimensions.hpp.

Referenced by JSON(), Print(), Temperature(), XML(), and YAML().

◆ time

Dimension::Time PhQ::Dimensions::time
private

Base physical dimension of time of this physical dimension set.

Definition at line 310 of file Dimensions.hpp.

Referenced by JSON(), Print(), Time(), XML(), and YAML().


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