qtty-cpp
Header-only C++ wrapper for qtty
Loading...
Searching...
No Matches
qtty::Quantity< UnitTag > Class Template Reference

#include <qtty/ffi_core.hpp>

Public Types

using unit_tag = UnitTag
 

Public Member Functions

constexpr Quantity ()
 
constexpr Quantity (double value)
 
constexpr double value () const
 
template<typename TargetType >
Quantity< typename ExtractTag< TargetType >::type > to () const
 
Quantity operator+ (const Quantity &other) const
 
Quantity operator- (const Quantity &other) const
 
Quantity operator* (double scalar) const
 
Quantity operator/ (double scalar) const
 
bool operator== (const Quantity &other) const
 
bool operator!= (const Quantity &other) const
 
bool operator< (const Quantity &other) const
 
bool operator> (const Quantity &other) const
 
bool operator<= (const Quantity &other) const
 
bool operator>= (const Quantity &other) const
 
Quantityoperator+= (const Quantity &other)
 
Quantityoperator-= (const Quantity &other)
 
Quantityoperator*= (double scalar)
 
Quantityoperator/= (double scalar)
 
Quantity operator- () const
 
Quantity abs () const
 

Static Public Member Functions

static constexpr UnitId unit_id ()
 

Friends

Quantity operator* (double scalar, const Quantity &q)
 

Detailed Description

template<typename UnitTag>
class qtty::Quantity< UnitTag >
Examples
demo.cpp.

Definition at line 135 of file ffi_core.hpp.

Member Typedef Documentation

◆ unit_tag

template<typename UnitTag >
using qtty::Quantity< UnitTag >::unit_tag = UnitTag

Definition at line 140 of file ffi_core.hpp.

Constructor & Destructor Documentation

◆ Quantity() [1/2]

◆ Quantity() [2/2]

template<typename UnitTag >
constexpr qtty::Quantity< UnitTag >::Quantity ( double  value)
inlineexplicitconstexpr

Definition at line 144 of file ffi_core.hpp.

Member Function Documentation

◆ abs()

template<typename UnitTag >
Quantity qtty::Quantity< UnitTag >::abs ( ) const
inline
Examples
demo.cpp.

Definition at line 288 of file ffi_core.hpp.

References qtty::Quantity< UnitTag >::Quantity().

Referenced by main().

◆ operator!=()

template<typename UnitTag >
bool qtty::Quantity< UnitTag >::operator!= ( const Quantity< UnitTag > &  other) const
inline

Definition at line 233 of file ffi_core.hpp.

◆ operator*()

template<typename UnitTag >
Quantity qtty::Quantity< UnitTag >::operator* ( double  scalar) const
inline

Definition at line 208 of file ffi_core.hpp.

References qtty::Quantity< UnitTag >::Quantity().

◆ operator*=()

template<typename UnitTag >
Quantity & qtty::Quantity< UnitTag >::operator*= ( double  scalar)
inline

Definition at line 269 of file ffi_core.hpp.

References qtty::Quantity< UnitTag >::Quantity().

◆ operator+()

template<typename UnitTag >
Quantity qtty::Quantity< UnitTag >::operator+ ( const Quantity< UnitTag > &  other) const
inline

Definition at line 193 of file ffi_core.hpp.

References qtty::Quantity< UnitTag >::Quantity().

◆ operator+=()

template<typename UnitTag >
Quantity & qtty::Quantity< UnitTag >::operator+= ( const Quantity< UnitTag > &  other)
inline

Definition at line 259 of file ffi_core.hpp.

◆ operator-() [1/2]

template<typename UnitTag >
Quantity qtty::Quantity< UnitTag >::operator- ( ) const
inline

Definition at line 284 of file ffi_core.hpp.

References qtty::Quantity< UnitTag >::Quantity().

◆ operator-() [2/2]

template<typename UnitTag >
Quantity qtty::Quantity< UnitTag >::operator- ( const Quantity< UnitTag > &  other) const
inline

Definition at line 197 of file ffi_core.hpp.

References qtty::Quantity< UnitTag >::Quantity().

◆ operator-=()

template<typename UnitTag >
Quantity & qtty::Quantity< UnitTag >::operator-= ( const Quantity< UnitTag > &  other)
inline

Definition at line 264 of file ffi_core.hpp.

◆ operator/()

template<typename UnitTag >
Quantity qtty::Quantity< UnitTag >::operator/ ( double  scalar) const
inline

Definition at line 212 of file ffi_core.hpp.

References qtty::Quantity< UnitTag >::Quantity().

◆ operator/=()

template<typename UnitTag >
Quantity & qtty::Quantity< UnitTag >::operator/= ( double  scalar)
inline

Definition at line 274 of file ffi_core.hpp.

References qtty::Quantity< UnitTag >::Quantity().

◆ operator<()

template<typename UnitTag >
bool qtty::Quantity< UnitTag >::operator< ( const Quantity< UnitTag > &  other) const
inline

Definition at line 237 of file ffi_core.hpp.

◆ operator<=()

template<typename UnitTag >
bool qtty::Quantity< UnitTag >::operator<= ( const Quantity< UnitTag > &  other) const
inline

Definition at line 245 of file ffi_core.hpp.

◆ operator==()

template<typename UnitTag >
bool qtty::Quantity< UnitTag >::operator== ( const Quantity< UnitTag > &  other) const
inline

Definition at line 229 of file ffi_core.hpp.

◆ operator>()

template<typename UnitTag >
bool qtty::Quantity< UnitTag >::operator> ( const Quantity< UnitTag > &  other) const
inline

Definition at line 241 of file ffi_core.hpp.

◆ operator>=()

template<typename UnitTag >
bool qtty::Quantity< UnitTag >::operator>= ( const Quantity< UnitTag > &  other) const
inline

Definition at line 249 of file ffi_core.hpp.

◆ to()

◆ unit_id()

template<typename UnitTag >
static constexpr UnitId qtty::Quantity< UnitTag >::unit_id ( )
inlinestaticconstexpr

Definition at line 147 of file ffi_core.hpp.

Referenced by qtty::Quantity< UnitTag >::to().

◆ value()

Friends And Related Symbol Documentation

◆ operator*

template<typename UnitTag >
Quantity operator* ( double  scalar,
const Quantity< UnitTag > &  q 
)
friend

Definition at line 217 of file ffi_core.hpp.


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