Loading...
Searching...
No Matches
casacore::QBase Class Referenceabstract
casa package (libcasa_casa) » Quanta_module

More...

`#include <QBase.h>`

## Public Member Functions

| QBase ()
| Default constructor, generates "".
| QBase (const Unit &s)
| Construct dimensioned QBase (e.g.
virtual | ~QBase ()
| Destructor.
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.
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).

## Protected Attributes

Unit | qUnit

## Detailed Description

Base for Quantities (i.e. dimensioned values)

### Intended use:

Internal

### Review Status

Reviewed By:
  UNKNOWN
Date Reviewed:
  before2004/08/25
Test programs:
  tQuantum

### Prerequisite

- Unit

### Etymology

QBase is the base class for Quantum.

### Synopsis

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
casacore::Quantum
Definition Quantum.h:269
casacore::String
String: the storage and methods of handling collections of characters.
Definition String.h:223
casacore::Quantity
Quantum< Double > Quantity
Definition Quantum.h:39
casacore::value
NewDelAllocator< T > NewDelAllocator< T >::value
Definition Allocator.h:368
casacore::Double
double Double
Definition aipstype.h:53

See Quantum for details.

### Motivation

To provide the possibilty of mixing units from different Quantum<T1>, Quantum<T2>

### To Do

- Some inlining (did not work first go)

Definition at line 78 of file QBase.h.

## Constructor & Destructor Documentation

## QBase() [1/2]

casacore::QBase::QBase | ( |  | ) |

Default constructor, generates "".

Referenced by clone(), casacore::Quantum< Double >::clone(), isConform(), casacore::Quantum< Double >::Quantum(), and setUnit().

## QBase() [2/2]

casacore::QBase::QBase | ( | const Unit & | s | ) |

Construct dimensioned QBase (e.g.

'km/Mpc')

### Thrown Exceptions

- AipsError if non-matching unit dimensions

## ~QBase()

virtual casacore::QBase::~QBase | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## clone()

virtual QBase * casacore::QBase::clone | ( |  | ) | const

pure virtual

Get a copy of Quantum.

Implemented in casacore::Quantum< Qtype >, casacore::Quantum< casacore::Vector< Double > >, casacore::Quantum< Double >, and casacore::Quantum< Vector< T > >.

References QBase().

## getFullUnit()

virtual const Unit & casacore::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 casacore::Quantum< Qtype >, casacore::Quantum< casacore::Vector< Double > >, casacore::Quantum< Double >, and casacore::Quantum< Vector< T > >.

## getUnit()

const String & casacore::QBase::getUnit | ( |  | ) | const

Get units of QBase .

Return the string representation of the current units attached to QBase

## isConform() [1/2]

Bool casacore::QBase::isConform | ( | const QBase & | other | ) | const

Using units specified in QBase.

References QBase().

## isConform() [2/2]

Bool casacore::QBase::isConform | ( | const Unit & | s | ) | const

Check for conformal matching units (e.g.

dam and Mpc) Using specified units

## print()

virtual void casacore::QBase::print | ( | ostream & | os | ) | const

pure virtual

Print a Quantum.

Implemented in casacore::Quantum< Qtype >, casacore::Quantum< casacore::Vector< Double > >, casacore::Quantum< Double >, and casacore::Quantum< Vector< T > >.

## setUnit() [1/2]

void casacore::QBase::setUnit | ( | const QBase & | other | ) |

Set new unit, copied from specified QBase, without changing value.

References QBase().

## setUnit() [2/2]

void casacore::QBase::setUnit | ( | const Unit & | s | ) |

Re-specify parts of a QBase .

Set new unit, without changing value

## type()

virtual uInt casacore::QBase::type | ( |  | ) | const

pure virtual

Get the type of derived Quantum (using QuantumType).

All should have: static uInt myType();

Implemented in casacore::Quantum< Qtype >, casacore::Quantum< casacore::Vector< Double > >, casacore::Quantum< Double >, and casacore::Quantum< Vector< T > >.

## Member Data Documentation

## qUnit

Unit casacore::QBase::qUnit

protected

Definition at line 133 of file QBase.h.

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

- casa/Quanta/QBase.h