Base::Quantity Class Reference

The Quantity class. More...

#include <Quantity.h>

Public Member Functions

const QuantityFormatgetFormat () const
 
const UnitgetUnit () const
 returns the unit of the quantity More...
 
QString getUserString () const
 
QString getUserString (double &factor, QString &unitString) const
 transfer to user preferred unit/potence More...
 
QString getUserString (UnitsSchema *schema, double &factor, QString &unitString) const
 
double getValue () const
 get the Value of the quantity More...
 
double getValueAs (const Quantity &) const
 get the Value in a special unit given as quantity. More...
 
bool isDimensionless () const
 true if it has a number without a unit More...
 
bool isQuantity () const
 true if it has a number and a valid unit More...
 
bool isValid () const
 true if it has a number with or without a unit More...
 
Quantity operator* (const Quantity &p) const
 Operators. More...
 
Quantity operator* (double p) const
 
Quantity operator+ (const Quantity &p) const
 
Quantityoperator+= (const Quantity &p)
 
Quantity operator- () const
 
Quantity operator- (const Quantity &p) const
 
Quantityoperator-= (const Quantity &p)
 
Quantity operator/ (const Quantity &p) const
 
Quantity operator/ (double p) const
 
bool operator< (const Quantity &) const
 
bool operator<= (const Quantity &) const
 
Quantityoperator= (const Quantity &)
 
bool operator== (const Quantity &) const
 
bool operator> (const Quantity &) const
 
bool operator>= (const Quantity &) const
 
Quantity pow (const Quantity &) const
 
Quantity pow (double) const
 
 Quantity ()
 default constructor More...
 
 Quantity (const Quantity &)
 
 Quantity (double value, const QString &unit)
 
 Quantity (double value, const Unit &unit=Unit())
 
void setFormat (const QuantityFormat &f)
 
void setInvalid ()
 sets the quantity invalid More...
 
void setUnit (const Unit &un)
 set the unit of the quantity More...
 
void setValue (double val)
 set the value of the quantity More...
 
 ~Quantity ()
 Destruction. More...
 

Static Public Member Functions

static Quantity parse (const QString &string)
 

Static Public Attributes

static Quantity Ampere
 
static Quantity AngMinute
 
static Quantity AngSecond
 
static Quantity Bar
 
static Quantity Calorie
 
static Quantity Candela
 
static Quantity CentiMetre
 
static Quantity Coulomb
 
static Quantity CubicFoot
 
static Quantity DeciMetre
 
static Quantity Degree
 
static Quantity ElectronVolt
 
static Quantity Farad
 
static Quantity Foot
 
static Quantity Gauss
 
static Quantity GigaHertz
 
static Quantity GigaPascal
 
static Quantity Gon
 
static Quantity Gram
 
static Quantity Henry
 
static Quantity Hertz
 
static Quantity Hour
 
static Quantity Hundredweights
 
static Quantity Inch
 
static Quantity Joule
 
static Quantity Kelvin
 
static Quantity KiloAmpere
 
static Quantity KiloCalorie
 
static Quantity KiloElectronVolt
 
static Quantity KiloGram
 
static Quantity KiloHertz
 
static Quantity KiloJoule
 
static Quantity KiloMetre
 
static Quantity KiloNewton
 
static Quantity KiloNewtonPerMeter
 
static Quantity KiloOhm
 
static Quantity KiloPascal
 
static Quantity KiloSiemens
 
static Quantity KiloVolt
 
static Quantity KiloWatt
 
static Quantity KiloWattHour
 
static Quantity KMH
 
static Quantity KSI
 
static Quantity Liter
 
static Quantity MegaAmpere
 
static Quantity MegaElectronVolt
 
static Quantity MegaHertz
 
static Quantity MegaNewton
 
static Quantity MegaNewtonPerMeter
 
static Quantity MegaOhm
 
static Quantity MegaPascal
 
static Quantity MegaSiemens
 
static Quantity Metre
 
static Quantity MicroFarad
 
static Quantity MicroGram
 
static Quantity MicroHenry
 
static Quantity MicroKelvin
 
static Quantity MicroMetre
 
static Quantity MicroSiemens
 
static Quantity Mile
 
static Quantity MilePerHour
 
static Quantity MilliAmpere
 
static Quantity MilliBar
 
static Quantity MilliFarad
 
static Quantity MilliGram
 
static Quantity MilliHenry
 
static Quantity MilliJoule
 
static Quantity MilliKelvin
 
static Quantity MilliLiter
 
static Quantity MilliMetre
 
static Quantity MilliMole
 
static Quantity MilliNewton
 
static Quantity MilliNewtonPerMeter
 
static Quantity MilliSiemens
 
static Quantity MilliVolt
 
static Quantity MilliWatt
 
static Quantity Minute
 
static Quantity Mole
 
static Quantity MPH
 
static Quantity MPSI
 
static Quantity mTorr
 
static Quantity NanoFarad
 
static Quantity NanoHenry
 
static Quantity NanoMetre
 Predefined Unit types. More...
 
static Quantity Newton
 
static Quantity NewtonMeter
 
static Quantity NewtonPerMeter
 
static Quantity Oersted
 
static Quantity Ohm
 
static Quantity Ounce
 
static Quantity Pascal
 
static Quantity PicoFarad
 
static Quantity Pound
 
static Quantity PoundForce
 
static Quantity PSI
 
static Quantity Radian
 
static Quantity Second
 
static Quantity Siemens
 
static Quantity SquareFoot
 
static Quantity Stone
 
static Quantity TeraHertz
 
static Quantity Tesla
 
static Quantity Thou
 
static Quantity Ton
 
static Quantity Torr
 
static Quantity Volt
 
static Quantity VoltAmpere
 
static Quantity VoltAmpereSecond
 
static Quantity Watt
 
static Quantity WattSecond
 
static Quantity Weber
 
static Quantity Yard
 
static Quantity yTorr
 

Detailed Description

The Quantity class.

Constructor & Destructor Documentation

◆ Quantity() [1/4]

Quantity::Quantity ( )

default constructor

Referenced by operator*(), operator+(), operator-(), operator/(), parse(), and pow().

◆ Quantity() [2/4]

Quantity::Quantity ( const Quantity that)

◆ Quantity() [3/4]

Quantity::Quantity ( double  value,
const Unit unit = Unit() 
)
explicit

◆ Quantity() [4/4]

Quantity::Quantity ( double  value,
const QString &  unit 
)
explicit

References parse().

◆ ~Quantity()

Base::Quantity::~Quantity ( )

Destruction.

Member Function Documentation

◆ getFormat()

◆ getUnit()

◆ getUserString() [1/3]

QString Base::Quantity::getUserString ( ) const

◆ getUserString() [2/3]

◆ getUserString() [3/3]

QString Quantity::getUserString ( UnitsSchema schema,
double &  factor,
QString &  unitString 
) const

◆ getValue()

◆ getValueAs()

◆ isDimensionless()

bool Quantity::isDimensionless ( ) const

true if it has a number without a unit

References isValid().

◆ isQuantity()

bool Quantity::isQuantity ( ) const

true if it has a number and a valid unit

References isValid().

◆ isValid()

bool Quantity::isValid ( ) const

true if it has a number with or without a unit

Referenced by isDimensionless(), and isQuantity().

◆ operator*() [1/2]

Quantity Quantity::operator* ( const Quantity p) const

Operators.

References Quantity().

◆ operator*() [2/2]

Quantity Quantity::operator* ( double  p) const

References Quantity().

◆ operator+()

Quantity Quantity::operator+ ( const Quantity p) const

References Quantity().

◆ operator+=()

Quantity & Quantity::operator+= ( const Quantity p)

◆ operator-() [1/2]

Quantity Quantity::operator- ( ) const

References Quantity().

◆ operator-() [2/2]

Quantity Quantity::operator- ( const Quantity p) const

References Quantity().

◆ operator-=()

Quantity & Quantity::operator-= ( const Quantity p)

◆ operator/() [1/2]

Quantity Quantity::operator/ ( const Quantity p) const

References Quantity().

◆ operator/() [2/2]

Quantity Quantity::operator/ ( double  p) const

References Quantity().

◆ operator<()

bool Quantity::operator< ( const Quantity that) const

◆ operator<=()

bool Quantity::operator<= ( const Quantity that) const

◆ operator=()

Quantity & Quantity::operator= ( const Quantity New)

◆ operator==()

bool Quantity::operator== ( const Quantity that) const

◆ operator>()

bool Quantity::operator> ( const Quantity that) const

◆ operator>=()

bool Quantity::operator>= ( const Quantity that) const

◆ parse()

◆ pow() [1/2]

Quantity Quantity::pow ( const Quantity p) const

References Quantity().

◆ pow() [2/2]

Quantity Quantity::pow ( double  p) const

References Quantity().

◆ setFormat()

◆ setInvalid()

void Quantity::setInvalid ( )

sets the quantity invalid

◆ setUnit()

◆ setValue()

Member Data Documentation

◆ Ampere

Quantity Quantity::Ampere
static

◆ AngMinute

Quantity Quantity::AngMinute
static

◆ AngSecond

Quantity Quantity::AngSecond
static

◆ Bar

Quantity Quantity::Bar
static

◆ Calorie

Quantity Quantity::Calorie
static

◆ Candela

Quantity Quantity::Candela
static

◆ CentiMetre

Quantity Quantity::CentiMetre
static

◆ Coulomb

Quantity Quantity::Coulomb
static

◆ CubicFoot

Quantity Quantity::CubicFoot
static

◆ DeciMetre

Quantity Quantity::DeciMetre
static

◆ Degree

Quantity Quantity::Degree
static

◆ ElectronVolt

Quantity Quantity::ElectronVolt
static

◆ Farad

Quantity Quantity::Farad
static

◆ Foot

Quantity Quantity::Foot
static

◆ Gauss

Quantity Quantity::Gauss
static

◆ GigaHertz

Quantity Quantity::GigaHertz
static

◆ GigaPascal

Quantity Quantity::GigaPascal
static

◆ Gon

Quantity Quantity::Gon
static

◆ Gram

Quantity Quantity::Gram
static

◆ Henry

Quantity Quantity::Henry
static

◆ Hertz

Quantity Quantity::Hertz
static

◆ Hour

Quantity Quantity::Hour
static

◆ Hundredweights

Quantity Quantity::Hundredweights
static

◆ Inch

Quantity Quantity::Inch
static

◆ Joule

Quantity Quantity::Joule
static

◆ Kelvin

◆ KiloAmpere

Quantity Quantity::KiloAmpere
static

◆ KiloCalorie

Quantity Quantity::KiloCalorie
static

◆ KiloElectronVolt

Quantity Quantity::KiloElectronVolt
static

◆ KiloGram

Quantity Quantity::KiloGram
static

◆ KiloHertz

Quantity Quantity::KiloHertz
static

◆ KiloJoule

Quantity Quantity::KiloJoule
static

◆ KiloMetre

Quantity Quantity::KiloMetre
static

◆ KiloNewton

Quantity Quantity::KiloNewton
static

◆ KiloNewtonPerMeter

Quantity Quantity::KiloNewtonPerMeter
static

◆ KiloOhm

Quantity Quantity::KiloOhm
static

◆ KiloPascal

Quantity Quantity::KiloPascal
static

◆ KiloSiemens

Quantity Quantity::KiloSiemens
static

◆ KiloVolt

Quantity Quantity::KiloVolt
static

◆ KiloWatt

Quantity Quantity::KiloWatt
static

◆ KiloWattHour

Quantity Quantity::KiloWattHour
static

◆ KMH

Quantity Quantity::KMH
static

◆ KSI

Quantity Quantity::KSI
static

◆ Liter

Quantity Quantity::Liter
static

◆ MegaAmpere

Quantity Quantity::MegaAmpere
static

◆ MegaElectronVolt

Quantity Quantity::MegaElectronVolt
static

◆ MegaHertz

Quantity Quantity::MegaHertz
static

◆ MegaNewton

Quantity Quantity::MegaNewton
static

◆ MegaNewtonPerMeter

Quantity Quantity::MegaNewtonPerMeter
static

◆ MegaOhm

Quantity Quantity::MegaOhm
static

◆ MegaPascal

Quantity Quantity::MegaPascal
static

◆ MegaSiemens

Quantity Quantity::MegaSiemens
static

◆ Metre

Quantity Quantity::Metre
static

◆ MicroFarad

Quantity Quantity::MicroFarad
static

◆ MicroGram

Quantity Quantity::MicroGram
static

◆ MicroHenry

Quantity Quantity::MicroHenry
static

◆ MicroKelvin

Quantity Quantity::MicroKelvin
static

◆ MicroMetre

Quantity Quantity::MicroMetre
static

◆ MicroSiemens

Quantity Quantity::MicroSiemens
static

◆ Mile

Quantity Quantity::Mile
static

◆ MilePerHour

Quantity Quantity::MilePerHour
static

◆ MilliAmpere

Quantity Quantity::MilliAmpere
static

◆ MilliBar

Quantity Quantity::MilliBar
static

◆ MilliFarad

Quantity Quantity::MilliFarad
static

◆ MilliGram

Quantity Quantity::MilliGram
static

◆ MilliHenry

Quantity Quantity::MilliHenry
static

◆ MilliJoule

Quantity Quantity::MilliJoule
static

◆ MilliKelvin

Quantity Quantity::MilliKelvin
static

◆ MilliLiter

Quantity Quantity::MilliLiter
static

◆ MilliMetre

◆ MilliMole

Quantity Quantity::MilliMole
static

◆ MilliNewton

Quantity Quantity::MilliNewton
static

◆ MilliNewtonPerMeter

Quantity Quantity::MilliNewtonPerMeter
static

◆ MilliSiemens

Quantity Quantity::MilliSiemens
static

◆ MilliVolt

Quantity Quantity::MilliVolt
static

◆ MilliWatt

Quantity Quantity::MilliWatt
static

◆ Minute

Quantity Quantity::Minute
static

◆ Mole

Quantity Quantity::Mole
static

◆ MPH

Quantity Quantity::MPH
static

◆ MPSI

Quantity Quantity::MPSI
static

◆ mTorr

Quantity Quantity::mTorr
static

◆ NanoFarad

Quantity Quantity::NanoFarad
static

◆ NanoHenry

Quantity Quantity::NanoHenry
static

◆ NanoMetre

Quantity Quantity::NanoMetre
static

Predefined Unit types.

◆ Newton

Quantity Quantity::Newton
static

◆ NewtonMeter

Quantity Quantity::NewtonMeter
static

◆ NewtonPerMeter

◆ Oersted

Quantity Quantity::Oersted
static

◆ Ohm

Quantity Quantity::Ohm
static

◆ Ounce

Quantity Quantity::Ounce
static

◆ Pascal

Quantity Quantity::Pascal
static

◆ PicoFarad

Quantity Quantity::PicoFarad
static

◆ Pound

Quantity Quantity::Pound
static

◆ PoundForce

Quantity Quantity::PoundForce
static

◆ PSI

Quantity Quantity::PSI
static

◆ Radian

Quantity Quantity::Radian
static

◆ Second

Quantity Quantity::Second
static

◆ Siemens

Quantity Quantity::Siemens
static

◆ SquareFoot

Quantity Quantity::SquareFoot
static

◆ Stone

Quantity Quantity::Stone
static

◆ TeraHertz

Quantity Quantity::TeraHertz
static

◆ Tesla

Quantity Quantity::Tesla
static

◆ Thou

Quantity Quantity::Thou
static

◆ Ton

Quantity Quantity::Ton
static

◆ Torr

Quantity Quantity::Torr
static

◆ Volt

Quantity Quantity::Volt
static

◆ VoltAmpere

Quantity Quantity::VoltAmpere
static

◆ VoltAmpereSecond

Quantity Quantity::VoltAmpereSecond
static

◆ Watt

Quantity Quantity::Watt
static

◆ WattSecond

Quantity Quantity::WattSecond
static

◆ Weber

Quantity Quantity::Weber
static

◆ Yard

Quantity Quantity::Yard
static

◆ yTorr

Quantity Quantity::yTorr
static

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