Enroute Flight Navigation
A navigation app for VFR pilots
Units::Volume Class Reference

Convenience class for volume computations. More...

#include <Volume.h>

Public Member Functions

Q_INVOKABLE bool isFinite () const
 Checks if the volume is valid.
 
Q_INVOKABLE Units::Volumeoperator+= (Units::Volume other)
 Add volume to this volume.
 
Q_INVOKABLE std::partial_ordering operator<=> (const Units::Volume &rhs) const =default
 Comparison.
 
Q_INVOKABLE double toL () const
 Convert to liters.
 
Q_INVOKABLE double toGAL () const
 Convert to gallons.
 

Static Public Member Functions

static constexpr auto fromL (double volumeInL) -> Volume
 Constructs a volume.
 
static constexpr auto fromGAL (double volumeInGAL) -> Volume
 Constructs a volume.
 

Detailed Description

Convenience class for volume computations.

This extremely simple class allows computation with volumes, without the need to worry about units. On construction, the volume is set to NaN.

Definition at line 35 of file Volume.h.

Member Function Documentation

◆ fromGAL()

static constexpr auto Units::Volume::fromGAL ( double volumeInGAL) -> Volume
inlinestaticconstexpr

Constructs a volume.

Parameters
volumeInGALvolume in gallons
Returns
volume

Definition at line 59 of file Volume.h.

◆ fromL()

static constexpr auto Units::Volume::fromL ( double volumeInL) -> Volume
inlinestaticconstexpr

Constructs a volume.

Parameters
volumeInLvolume in liters
Returns
volume

Definition at line 46 of file Volume.h.

◆ isFinite()

Q_INVOKABLE bool Units::Volume::isFinite ( ) const
inlinenodiscard

Checks if the volume is valid.

Returns
True is the volume is a finite number

Definition at line 70 of file Volume.h.

◆ operator+=()

Q_INVOKABLE Units::Volume & Units::Volume::operator+= ( Units::Volume other)
inline

Add volume to this volume.

Parameters
othervolume to be added
Returns
reference to this volume

Definition at line 81 of file Volume.h.

◆ operator<=>()

Q_INVOKABLE std::partial_ordering Units::Volume::operator<=> ( const Units::Volume & rhs) const
nodiscarddefault

Comparison.

Parameters
rhsRight hand side of the comparison
Returns
Result of the comparison

◆ toGAL()

Q_INVOKABLE double Units::Volume::toGAL ( ) const
inlinenodiscard

Convert to gallons.

Returns
volume in gallons

Definition at line 108 of file Volume.h.

◆ toL()

Q_INVOKABLE double Units::Volume::toL ( ) const
inlinenodiscard

Convert to liters.

Returns
volume in liters

Definition at line 99 of file Volume.h.


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