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 Attributes | Private Member Functions | List of all members
PhQ::SpecificPower< NumericType > Class Template Reference

Mass-specific power. Power per unit mass; see PhQ::Power and PhQ::Mass. More...

#include "SpecificPower.hpp"

Public Member Functions

 SpecificPower ()=default
 Default constructor. Constructs a specific power quantity with an uninitialized value. More...
 
 SpecificPower (const NumericType value, const Unit::SpecificPower unit)
 Constructor. Constructs a specific power quantity with a given value expressed in a given specific power unit. More...
 
constexpr SpecificPower (const SpecificEnergy< NumericType > &specific_energy, const Time< NumericType > &time)
 Constructor. Constructs a specific power quantity from a given specific energy and time duration using the definition of specific power. More...
 
constexpr SpecificPower (const SpecificEnergy< NumericType > &specific_energy, const Frequency< NumericType > &frequency)
 Constructor. Constructs a specific power quantity from a given specific energy and frequency using the definition of specific power. More...
 
constexpr SpecificPower (const Power< NumericType > &power, const Mass< NumericType > &mass)
 Constructor. Constructs a specific power quantity from a given power and mass using the definition of specific power. More...
 
 ~SpecificPower () noexcept=default
 Destructor. Destroys this specific power quantity. More...
 
constexpr SpecificPower (const SpecificPower< NumericType > &other)=default
 Copy constructor. Constructs a specific power quantity by copying another one. More...
 
template<typename OtherNumericType >
constexpr SpecificPower (const SpecificPower< OtherNumericType > &other)
 Copy constructor. Constructs a specific power quantity by copying another one. More...
 
constexpr SpecificPower (SpecificPower< NumericType > &&other) noexcept=default
 Move constructor. Constructs a specific power quantity by moving another one. More...
 
constexpr SpecificPower< NumericType > & operator= (const SpecificPower< NumericType > &other)=default
 Copy assignment operator. Assigns this specific power quantity by copying another one. More...
 
template<typename OtherNumericType >
constexpr SpecificPower< NumericType > & operator= (const SpecificPower< OtherNumericType > &other)
 Copy assignment operator. Assigns this specific power quantity by copying another one. More...
 
constexpr SpecificPower< NumericType > & operator= (SpecificPower< NumericType > &&other) noexcept=default
 Move assignment operator. Assigns this specific power quantity by moving another one. More...
 
constexpr SpecificPower< NumericType > operator+ (const SpecificPower< NumericType > &specific_power) const
 
constexpr SpecificPower< NumericType > operator- (const SpecificPower< NumericType > &specific_power) const
 
constexpr SpecificPower< NumericType > operator* (const NumericType number) const
 
constexpr SpecificEnergy< NumericType > operator* (const Time< NumericType > &time) const
 
constexpr Power< NumericType > operator* (const Mass< NumericType > &mass) const
 
constexpr SpecificPower< NumericType > operator/ (const NumericType number) const
 
constexpr SpecificEnergy< NumericType > operator/ (const Frequency< NumericType > &frequency) const
 
constexpr Frequency< NumericType > operator/ (const SpecificEnergy< NumericType > &specific_energy) const
 
constexpr NumericType operator/ (const SpecificPower< NumericType > &specific_power) const noexcept
 
constexpr void operator+= (const SpecificPower< NumericType > &specific_power) noexcept
 
constexpr void operator-= (const SpecificPower< NumericType > &specific_power) noexcept
 
constexpr void operator*= (const NumericType number) noexcept
 
constexpr void operator/= (const NumericType number) noexcept
 
constexpr double Value () const noexcept
 Value of this physical quantity expressed in its standard unit of measure. More...
 
double Value (const Unit::SpecificPower unit) const
 Value of this physical quantity expressed in a given unit of measure. More...
 
constexpr double 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 double & 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 double 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 Unit::SpecificPower 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 Unit::SpecificPower 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 Unit::SpecificPower 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 Unit::SpecificPower 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 SpecificPower< NumericType > Zero ()
 Statically creates a specific power quantity of zero. More...
 
template<Unit::SpecificPower Unit>
static constexpr SpecificPower< NumericType > Create (const NumericType value)
 Statically creates a specific power quantity with a given value expressed in a given specific power unit. More...
 
static constexpr const PhQ::DimensionsDimensions ()
 Physical dimension set of this physical quantity. More...
 
static constexpr Unit::SpecificPower Unit ()
 Standard unit of measure for this physical quantity. This physical quantity's value is stored internally in this unit of measure. More...
 

Protected Attributes

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

Private Member Functions

constexpr SpecificPower (const NumericType value)
 Constructor. Constructs a specific power quantity with a given value expressed in the standard specific power unit. More...
 

Detailed Description

template<typename NumericType = double>
class PhQ::SpecificPower< NumericType >

Mass-specific power. Power per unit mass; see PhQ::Power and PhQ::Mass.

Definition at line 44 of file SpecificPower.hpp.

Constructor & Destructor Documentation

◆ SpecificPower() [1/9]

template<typename NumericType = double>
PhQ::SpecificPower< NumericType >::SpecificPower ( )
default

Default constructor. Constructs a specific power quantity with an uninitialized value.

◆ SpecificPower() [2/9]

template<typename NumericType = double>
PhQ::SpecificPower< NumericType >::SpecificPower ( const NumericType  value,
const Unit::SpecificPower< NumericType >  unit 
)
inline

Constructor. Constructs a specific power quantity with a given value expressed in a given specific power unit.

Definition at line 51 of file SpecificPower.hpp.

◆ SpecificPower() [3/9]

template<typename NumericType = double>
constexpr PhQ::SpecificPower< NumericType >::SpecificPower ( const SpecificEnergy< NumericType > &  specific_energy,
const Time< NumericType > &  time 
)
inlineconstexpr

Constructor. Constructs a specific power quantity from a given specific energy and time duration using the definition of specific power.

Definition at line 56 of file SpecificPower.hpp.

◆ SpecificPower() [4/9]

template<typename NumericType = double>
constexpr PhQ::SpecificPower< NumericType >::SpecificPower ( const SpecificEnergy< NumericType > &  specific_energy,
const Frequency< NumericType > &  frequency 
)
inlineconstexpr

Constructor. Constructs a specific power quantity from a given specific energy and frequency using the definition of specific power.

Definition at line 62 of file SpecificPower.hpp.

◆ SpecificPower() [5/9]

template<typename NumericType = double>
constexpr PhQ::SpecificPower< NumericType >::SpecificPower ( const Power< NumericType > &  power,
const Mass< NumericType > &  mass 
)
inlineconstexpr

Constructor. Constructs a specific power quantity from a given power and mass using the definition of specific power.

Definition at line 68 of file SpecificPower.hpp.

◆ ~SpecificPower()

template<typename NumericType = double>
PhQ::SpecificPower< NumericType >::~SpecificPower ( )
defaultnoexcept

Destructor. Destroys this specific power quantity.

◆ SpecificPower() [6/9]

template<typename NumericType = double>
constexpr PhQ::SpecificPower< NumericType >::SpecificPower ( const SpecificPower< NumericType > &  other)
constexprdefault

Copy constructor. Constructs a specific power quantity by copying another one.

◆ SpecificPower() [7/9]

template<typename NumericType = double>
template<typename OtherNumericType >
constexpr PhQ::SpecificPower< NumericType >::SpecificPower ( const SpecificPower< OtherNumericType > &  other)
inlineexplicitconstexpr

Copy constructor. Constructs a specific power quantity by copying another one.

Definition at line 79 of file SpecificPower.hpp.

◆ SpecificPower() [8/9]

template<typename NumericType = double>
constexpr PhQ::SpecificPower< NumericType >::SpecificPower ( SpecificPower< NumericType > &&  other)
constexprdefaultnoexcept

Move constructor. Constructs a specific power quantity by moving another one.

◆ SpecificPower() [9/9]

template<typename NumericType = double>
constexpr PhQ::SpecificPower< NumericType >::SpecificPower ( const NumericType  value)
inlineexplicitconstexprprivate

Constructor. Constructs a specific power quantity with a given value expressed in the standard specific power unit.

Definition at line 171 of file SpecificPower.hpp.

Member Function Documentation

◆ Create()

template<typename NumericType = double>
template<Unit::SpecificPower Unit>
static constexpr SpecificPower<NumericType> PhQ::SpecificPower< NumericType >::Create ( const NumericType  value)
inlinestaticconstexpr

Statically creates a specific power quantity with a given value expressed in a given specific power unit.

Definition at line 108 of file SpecificPower.hpp.

References PhQ::DimensionalScalar< Unit::SpecificPower, double >::value.

◆ Dimensions()

static constexpr const PhQ::Dimensions& PhQ::DimensionalScalar< Unit::SpecificPower , double >::Dimensions ( )
inlinestaticconstexprinherited

Physical dimension set of this physical quantity.

Definition at line 54 of file DimensionalScalar.hpp.

◆ JSON() [1/2]

std::string PhQ::DimensionalScalar< Unit::SpecificPower , double >::JSON ( ) const
inlineinherited

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

Definition at line 107 of file DimensionalScalar.hpp.

◆ JSON() [2/2]

std::string PhQ::DimensionalScalar< Unit::SpecificPower , double >::JSON ( const Unit::SpecificPower  unit) const
inlineinherited

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

Definition at line 117 of file DimensionalScalar.hpp.

◆ MutableValue()

constexpr double & PhQ::DimensionalScalar< Unit::SpecificPower , double >::MutableValue ( )
inlineconstexprnoexceptinherited

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

Definition at line 83 of file DimensionalScalar.hpp.

◆ operator*() [1/3]

template<typename NumericType = double>
constexpr Power<NumericType> PhQ::SpecificPower< NumericType >::operator* ( const Mass< NumericType > &  mass) const
inlineconstexpr

Definition at line 131 of file SpecificPower.hpp.

◆ operator*() [2/3]

template<typename NumericType = double>
constexpr SpecificPower<NumericType> PhQ::SpecificPower< NumericType >::operator* ( const NumericType  number) const
inlineconstexpr

◆ operator*() [3/3]

template<typename NumericType = double>
constexpr SpecificEnergy<NumericType> PhQ::SpecificPower< NumericType >::operator* ( const Time< NumericType > &  time) const
inlineconstexpr

Definition at line 127 of file SpecificPower.hpp.

◆ operator*=()

template<typename NumericType = double>
constexpr void PhQ::SpecificPower< NumericType >::operator*= ( const NumericType  number)
inlineconstexprnoexcept

◆ operator+()

template<typename NumericType = double>
constexpr SpecificPower<NumericType> PhQ::SpecificPower< NumericType >::operator+ ( const SpecificPower< NumericType > &  specific_power) const
inlineconstexpr

◆ operator+=()

template<typename NumericType = double>
constexpr void PhQ::SpecificPower< NumericType >::operator+= ( const SpecificPower< NumericType > &  specific_power)
inlineconstexprnoexcept

◆ operator-()

template<typename NumericType = double>
constexpr SpecificPower<NumericType> PhQ::SpecificPower< NumericType >::operator- ( const SpecificPower< NumericType > &  specific_power) const
inlineconstexpr

◆ operator-=()

template<typename NumericType = double>
constexpr void PhQ::SpecificPower< NumericType >::operator-= ( const SpecificPower< NumericType > &  specific_power)
inlineconstexprnoexcept

◆ operator/() [1/4]

template<typename NumericType = double>
constexpr SpecificEnergy<NumericType> PhQ::SpecificPower< NumericType >::operator/ ( const Frequency< NumericType > &  frequency) const
inlineconstexpr

Definition at line 139 of file SpecificPower.hpp.

◆ operator/() [2/4]

template<typename NumericType = double>
constexpr SpecificPower<NumericType> PhQ::SpecificPower< NumericType >::operator/ ( const NumericType  number) const
inlineconstexpr

◆ operator/() [3/4]

template<typename NumericType = double>
constexpr Frequency<NumericType> PhQ::SpecificPower< NumericType >::operator/ ( const SpecificEnergy< NumericType > &  specific_energy) const
inlineconstexpr

Definition at line 143 of file SpecificPower.hpp.

◆ operator/() [4/4]

template<typename NumericType = double>
constexpr NumericType PhQ::SpecificPower< NumericType >::operator/ ( const SpecificPower< NumericType > &  specific_power) const
inlineconstexprnoexcept

◆ operator/=()

template<typename NumericType = double>
constexpr void PhQ::SpecificPower< NumericType >::operator/= ( const NumericType  number)
inlineconstexprnoexcept

◆ operator=() [1/3]

template<typename NumericType = double>
constexpr SpecificPower<NumericType>& PhQ::SpecificPower< NumericType >::operator= ( const SpecificPower< NumericType > &  other)
constexprdefault

Copy assignment operator. Assigns this specific power quantity by copying another one.

◆ operator=() [2/3]

template<typename NumericType = double>
template<typename OtherNumericType >
constexpr SpecificPower<NumericType>& PhQ::SpecificPower< NumericType >::operator= ( const SpecificPower< OtherNumericType > &  other)
inlineconstexpr

Copy assignment operator. Assigns this specific power quantity by copying another one.

Definition at line 91 of file SpecificPower.hpp.

References PhQ::DimensionalScalar< UnitType, NumericType >::Value(), and PhQ::DimensionalScalar< Unit::SpecificPower, double >::value.

◆ operator=() [3/3]

template<typename NumericType = double>
constexpr SpecificPower<NumericType>& PhQ::SpecificPower< NumericType >::operator= ( SpecificPower< NumericType > &&  other)
constexprdefaultnoexcept

Move assignment operator. Assigns this specific power quantity by moving another one.

◆ Print() [1/2]

std::string PhQ::DimensionalScalar< Unit::SpecificPower , double >::Print ( ) const
inlineinherited

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

Definition at line 95 of file DimensionalScalar.hpp.

◆ Print() [2/2]

std::string PhQ::DimensionalScalar< Unit::SpecificPower , double >::Print ( const Unit::SpecificPower  unit) const
inlineinherited

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

Definition at line 101 of file DimensionalScalar.hpp.

◆ SetValue()

constexpr void PhQ::DimensionalScalar< Unit::SpecificPower , double >::SetValue ( const double  value)
inlineconstexprnoexceptinherited

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

Definition at line 89 of file DimensionalScalar.hpp.

◆ StaticValue()

constexpr double PhQ::DimensionalScalar< Unit::SpecificPower , double >::StaticValue ( ) const
inlineconstexprinherited

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

Definition at line 77 of file DimensionalScalar.hpp.

◆ Unit()

static constexpr Unit::SpecificPower PhQ::DimensionalScalar< Unit::SpecificPower , double >::Unit ( )
inlinestaticconstexprinherited

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

Definition at line 60 of file DimensionalScalar.hpp.

◆ Value() [1/2]

constexpr double PhQ::DimensionalScalar< Unit::SpecificPower , double >::Value ( ) const
inlineconstexprnoexceptinherited

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

Definition at line 65 of file DimensionalScalar.hpp.

◆ Value() [2/2]

double PhQ::DimensionalScalar< Unit::SpecificPower , double >::Value ( const Unit::SpecificPower  unit) const
inlineinherited

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

Definition at line 70 of file DimensionalScalar.hpp.

◆ XML() [1/2]

std::string PhQ::DimensionalScalar< Unit::SpecificPower , double >::XML ( ) const
inlineinherited

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

Definition at line 127 of file DimensionalScalar.hpp.

◆ XML() [2/2]

std::string PhQ::DimensionalScalar< Unit::SpecificPower , double >::XML ( const Unit::SpecificPower  unit) const
inlineinherited

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

Definition at line 137 of file DimensionalScalar.hpp.

◆ YAML() [1/2]

std::string PhQ::DimensionalScalar< Unit::SpecificPower , double >::YAML ( ) const
inlineinherited

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

Definition at line 147 of file DimensionalScalar.hpp.

◆ YAML() [2/2]

std::string PhQ::DimensionalScalar< Unit::SpecificPower , double >::YAML ( const Unit::SpecificPower  unit) const
inlineinherited

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

Definition at line 157 of file DimensionalScalar.hpp.

◆ Zero()

template<typename NumericType = double>
static constexpr SpecificPower<NumericType> PhQ::SpecificPower< NumericType >::Zero ( )
inlinestaticconstexpr

Statically creates a specific power quantity of zero.

Definition at line 101 of file SpecificPower.hpp.

Member Data Documentation

◆ value

double PhQ::DimensionalScalar< Unit::SpecificPower , double >::value
protectedinherited

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

Definition at line 221 of file DimensionalScalar.hpp.


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