Logo Search packages:      
Sourcecode: qbrew version File versions

Quantity Class Reference

#include <quantity.h>

Inherited by Volume, and Weight.

List of all members.

Detailed Description

A class to encapsulate the idea of a measurable quantity. This is a slight variation of Fowler's Quantity analysis pattern.

Definition at line 85 of file quantity.h.

Public Member Functions

double amount (const Unit &u) const
double amount () const
void convert (const Unit &u)
void fromQString (const QString &from, const Unit &defaultunit=generic)
Quantityoperator*= (const double d)
Quantityoperator+= (const double d)
Quantityoperator+= (const Quantity &q)
Quantityoperator-= (const double d)
Quantityoperator-= (const Quantity &q)
Quantityoperator/= (const double d)
Quantityoperator= (const Quantity &q)
bool operator== (const Quantity &q) const
 Quantity (const Quantity &q)
 Quantity (const QString &from, const Unit &defaultunit=generic)
 Quantity (double amount, const Unit &unit)
QString toQString ()
const Unitunit () const

Static Public Attributes

static Unit generic

Protected Attributes

double amount_
Unit const * unit_


Quantity operator* (const double d, const Quantity &q)
Quantity operator* (const Quantity &q, const double d)
Quantity operator+ (const double d, const Quantity &q)
Quantity operator+ (const Quantity &q, const double d)
Quantity operator+ (const Quantity &q1, const Quantity &q2)
Quantity operator- (const Quantity &q)
Quantity operator- (const double d, const Quantity &q)
Quantity operator- (const Quantity &q, const double d)
Quantity operator- (const Quantity &q1, const Quantity &q2)
Quantity operator/ (const double d, const Quantity &q)
Quantity operator/ (const Quantity &q, const double d)

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

Generated by  Doxygen 1.6.0   Back to index