casa
$Rev:20696$
|
Base for Quantities (i.e. dimensioned values) More...
#include <QBase.h>
Public Member Functions | |
QBase () | |
Default constructor, generates "". | |
QBase (const QBase &other) | |
Copy constructor. | |
QBase (const Unit &s) | |
Construct dimensioned QBase (e.g. | |
virtual | ~QBase () |
Destructor. | |
QBase & | operator= (const QBase &other) |
Assignment (copy) | |
virtual QBase * | clone () const =0 |
Get a copy of Quantum. | |
virtual const Unit & | getFullUnit () const =0 |
Get the unit attached to the Quantum (use getUnit() if only interested in the String part of the unit) | |
virtual void | print (ostream &os) const =0 |
Print a Quantum. | |
virtual uInt | type () const =0 |
Get the type of derived Quantum (using QuantumType). | |
const String & | getUnit () const |
Get units of QBase. | |
void | setUnit (const Unit &s) |
Re-specify parts of a QBase. | |
void | setUnit (const QBase &other) |
Set new unit, copied from specified QBase, without changing value. | |
Bool | isConform (const Unit &s) const |
Check for conformal matching units (e.g. | |
Bool | isConform (const QBase &other) const |
Using units specified in QBase. | |
Protected Attributes | |
Unit | qUnit |
Base for Quantities (i.e. dimensioned values)
Internal
QBase is the base class for Quantum .
Quantities are values with a unit. Their basic specification can be one of two forms:
Quantity( Double value, String unit); // or: Unit unit Quantum<Type> ( Type value, String unit) // or: Unit unit
See Quantum for details.
To provide the possibilty of mixing units from different Quantum<T1>
, Quantum<T2>
Default constructor, generates "".
casa::QBase::QBase | ( | const QBase & | other | ) |
Copy constructor.
casa::QBase::QBase | ( | const Unit & | s | ) |
Construct dimensioned QBase (e.g.
'km/Mpc')
<h3>Thrown Exceptions</h3><ul> <li> AipsError if non-matching unit dimensions </ul>
virtual casa::QBase::~QBase | ( | ) | [virtual] |
Destructor.
virtual QBase* casa::QBase::clone | ( | ) | const [pure virtual] |
Get a copy of Quantum.
Implemented in casa::Quantum< Qtype >, casa::Quantum< double >, casa::Quantum< Double >, and casa::Quantum< Vector< Double > >.
virtual const Unit& casa::QBase::getFullUnit | ( | ) | const [pure virtual] |
Get the unit attached to the Quantum (use getUnit() if only interested in the String part of the unit)
Implemented in casa::Quantum< Qtype >, casa::Quantum< double >, casa::Quantum< Double >, and casa::Quantum< Vector< Double > >.
const String& casa::QBase::getUnit | ( | ) | const |
Bool casa::QBase::isConform | ( | const Unit & | s | ) | const |
Bool casa::QBase::isConform | ( | const QBase & | other | ) | const |
Using units specified in QBase.
virtual void casa::QBase::print | ( | ostream & | os | ) | const [pure virtual] |
Print a Quantum.
Implemented in casa::Quantum< Qtype >, casa::Quantum< double >, casa::Quantum< Double >, and casa::Quantum< Vector< Double > >.
void casa::QBase::setUnit | ( | const Unit & | s | ) |
Re-specify parts of a QBase.
void casa::QBase::setUnit | ( | const QBase & | other | ) |
Set new unit, copied from specified QBase, without changing value.
virtual uInt casa::QBase::type | ( | ) | const [pure virtual] |
Get the type of derived Quantum (using QuantumType).
All should have: static uInt myType();
Implemented in casa::Quantum< Qtype >, casa::Quantum< double >, casa::Quantum< Double >, and casa::Quantum< Vector< Double > >.
Unit casa::QBase::qUnit [protected] |