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::MemoryRate< NumericType > Class Template Reference

Computer memory rate. Can represent the time rate of change of memory or a memory transfer speed; see PhQ::Memory, PhQ::Time, and PhQ::Frequency. More...

#include "MemoryRate.hpp"

Public Member Functions

 MemoryRate ()=default
 Default constructor. Constructs a memory rate with an uninitialized value. More...
 
 MemoryRate (const NumericType value, const Unit::MemoryRate unit)
 Constructor. Constructs a memory rate with a given value expressed in a given memory rate unit. More...
 
constexpr MemoryRate (const Memory< NumericType > &memory, const Time< NumericType > &time)
 Constructor. Constructs a memory rate from a given memory and time duration using the definition of memory rate. More...
 
constexpr MemoryRate (const Memory< NumericType > &memory, const Frequency< NumericType > &frequency)
 Constructor. Constructs a memory rate from a given memory and frequency using the definition of memory rate. More...
 
 ~MemoryRate () noexcept=default
 Destructor. Destroys this memory rate. More...
 
constexpr MemoryRate (const MemoryRate< NumericType > &other)=default
 Copy constructor. Constructs a memory rate by copying another one. More...
 
template<typename OtherNumericType >
constexpr MemoryRate (const MemoryRate< OtherNumericType > &other)
 Copy constructor. Constructs a memory rate by copying another one. More...
 
constexpr MemoryRate (MemoryRate< NumericType > &&other) noexcept=default
 Move constructor. Constructs a memory rate by moving another one. More...
 
constexpr MemoryRate< NumericType > & operator= (const MemoryRate< NumericType > &other)=default
 Copy assignment operator. Assigns this memory rate by copying another one. More...
 
template<typename OtherNumericType >
constexpr MemoryRate< NumericType > & operator= (const MemoryRate< OtherNumericType > &other)
 Copy assignment operator. Assigns this memory rate by copying another one. More...
 
constexpr MemoryRate< NumericType > & operator= (MemoryRate< NumericType > &&other) noexcept=default
 Move assignment operator. Assigns this memory rate by moving another one. More...
 
constexpr MemoryRate< NumericType > operator+ (const MemoryRate< NumericType > &memory_rate) const
 
constexpr MemoryRate< NumericType > operator- (const MemoryRate< NumericType > &memory_rate) const
 
constexpr MemoryRate< NumericType > operator* (const NumericType number) const
 
constexpr Memory< NumericType > operator* (const Time< NumericType > &time) const
 
constexpr MemoryRate< NumericType > operator/ (const NumericType number) const
 
constexpr Memory< NumericType > operator/ (const Frequency< NumericType > &frequency) const
 
constexpr Frequency< NumericType > operator/ (const Memory< NumericType > &memory) const
 
constexpr NumericType operator/ (const MemoryRate< NumericType > &memory_rate) const noexcept
 
constexpr void operator+= (const MemoryRate< NumericType > &memory_rate) noexcept
 
constexpr void operator-= (const MemoryRate< NumericType > &memory_rate) 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::MemoryRate 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::MemoryRate 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::MemoryRate 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::MemoryRate 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::MemoryRate 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 MemoryRate< NumericType > Zero ()
 Statically creates a memory rate of zero. More...
 
template<Unit::MemoryRate Unit>
static constexpr MemoryRate< NumericType > Create (const NumericType value)
 Statically creates a memory rate with a given value expressed in a given memory rate unit. More...
 
static constexpr const PhQ::DimensionsDimensions ()
 Physical dimension set of this physical quantity. More...
 
static constexpr Unit::MemoryRate 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 MemoryRate (const NumericType value)
 Constructor. Constructs a memory rate quantity with a given value expressed in the standard memory rate unit. More...
 

Detailed Description

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

Computer memory rate. Can represent the time rate of change of memory or a memory transfer speed; see PhQ::Memory, PhQ::Time, and PhQ::Frequency.

Definition at line 43 of file MemoryRate.hpp.

Constructor & Destructor Documentation

◆ MemoryRate() [1/8]

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

Default constructor. Constructs a memory rate with an uninitialized value.

◆ MemoryRate() [2/8]

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

Constructor. Constructs a memory rate with a given value expressed in a given memory rate unit.

Definition at line 50 of file MemoryRate.hpp.

◆ MemoryRate() [3/8]

template<typename NumericType = double>
constexpr PhQ::MemoryRate< NumericType >::MemoryRate ( const Memory< NumericType > &  memory,
const Time< NumericType > &  time 
)
inlineconstexpr

Constructor. Constructs a memory rate from a given memory and time duration using the definition of memory rate.

Definition at line 55 of file MemoryRate.hpp.

◆ MemoryRate() [4/8]

template<typename NumericType = double>
constexpr PhQ::MemoryRate< NumericType >::MemoryRate ( const Memory< NumericType > &  memory,
const Frequency< NumericType > &  frequency 
)
inlineconstexpr

Constructor. Constructs a memory rate from a given memory and frequency using the definition of memory rate.

Definition at line 60 of file MemoryRate.hpp.

◆ ~MemoryRate()

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

Destructor. Destroys this memory rate.

◆ MemoryRate() [5/8]

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

Copy constructor. Constructs a memory rate by copying another one.

◆ MemoryRate() [6/8]

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

Copy constructor. Constructs a memory rate by copying another one.

Definition at line 71 of file MemoryRate.hpp.

◆ MemoryRate() [7/8]

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

Move constructor. Constructs a memory rate by moving another one.

◆ MemoryRate() [8/8]

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

Constructor. Constructs a memory rate quantity with a given value expressed in the standard memory rate unit.

Definition at line 154 of file MemoryRate.hpp.

Member Function Documentation

◆ Create()

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

Statically creates a memory rate with a given value expressed in a given memory rate unit.

Definition at line 98 of file MemoryRate.hpp.

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

◆ Dimensions()

static constexpr const PhQ::Dimensions& PhQ::DimensionalScalar< Unit::MemoryRate , 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::MemoryRate , 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::MemoryRate , double >::JSON ( const Unit::MemoryRate  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::MemoryRate , 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/2]

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

◆ operator*() [2/2]

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

Definition at line 115 of file MemoryRate.hpp.

◆ operator*=()

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

◆ operator+()

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

◆ operator+=()

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

◆ operator-()

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

◆ operator-=()

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

◆ operator/() [1/4]

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

Definition at line 123 of file MemoryRate.hpp.

◆ operator/() [2/4]

template<typename NumericType = double>
constexpr Frequency<NumericType> PhQ::MemoryRate< NumericType >::operator/ ( const Memory< NumericType > &  memory) const
inlineconstexpr

Definition at line 127 of file MemoryRate.hpp.

◆ operator/() [3/4]

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

◆ operator/() [4/4]

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

◆ operator/=()

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

◆ operator=() [1/3]

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

Copy assignment operator. Assigns this memory rate by copying another one.

◆ operator=() [2/3]

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

Copy assignment operator. Assigns this memory rate by copying another one.

Definition at line 82 of file MemoryRate.hpp.

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

◆ operator=() [3/3]

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

Move assignment operator. Assigns this memory rate by moving another one.

◆ Print() [1/2]

std::string PhQ::DimensionalScalar< Unit::MemoryRate , 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::MemoryRate , double >::Print ( const Unit::MemoryRate  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::MemoryRate , 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::MemoryRate , 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::MemoryRate PhQ::DimensionalScalar< Unit::MemoryRate , 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::MemoryRate , 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::MemoryRate , double >::Value ( const Unit::MemoryRate  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::MemoryRate , 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::MemoryRate , double >::XML ( const Unit::MemoryRate  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::MemoryRate , 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::MemoryRate , double >::YAML ( const Unit::MemoryRate  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 MemoryRate<NumericType> PhQ::MemoryRate< NumericType >::Zero ( )
inlinestaticconstexpr

Statically creates a memory rate of zero.

Definition at line 91 of file MemoryRate.hpp.

Member Data Documentation

◆ value

double PhQ::DimensionalScalar< Unit::MemoryRate , 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: