Go to the documentation of this file.
28 #ifndef CASA_QUANTUM_H
29 #define CASA_QUANTUM_H
31 #include <casacore/casa/aips.h>
32 #include <casacore/casa/Quanta/QBase.h>
33 #include <casacore/casa/iosstrfwd.h>
38 template <
class T>
class Quantum;
367 void scale(
const Qtype &factor);
420 virtual void print(ostream &os)
const;
450 #ifndef CASACORE_NO_AUTO_TEMPLATES
451 #include <casacore/casa/Quanta/Quantum.tcc>
452 #endif //# CASACORE_NO_AUTO_TEMPLATES
Quantum< Qtype > operator*(const Quantum< Qtype > &other) const
Quantum< Qtype > & operator/=(const Quantum< Qtype > &other)
Qtype getBaseValue() const
Get value in canonical base units.
void scale(const Qtype &factor)
Re-specify parts of a quantum.
Bool readQuantity(Quantity &res, MUString &in)
const Qtype & getValue() const
Get value of quantum in current units (i.e.
Qtype qVal
Actual quantum value.
Bool check(const UnitVal &uv) const
Check if of specified type.
virtual uInt type() const
Get the type (using QuantumType) of derived Quantum (faster than Strings)
void convert(const Unit &s)
Convert to specified units; any remainder will be expressed in canonical units.
istream & operator>>(istream &is, Quantity &ku)
only Quantity is supported on input
describes any valid unit as a factor and a dimenion of SI units
Quantum()
Default constructor, generates '0'.
Quantum< Qtype > operator+(const Quantum< Qtype > &other) const
Arithmetic operators: return Quantum<T>
static Bool read(Quantity &res, const String &in)
Set the value and unit deduced from input string Caution: At the moment the implementation can only ...
const Quantum< Qtype > & operator+() const
Unary operations.
AipsIO & operator>>(AipsIO &os, Record &rec)
virtual void print(ostream &os) const
Print a Quantum.
Bool readQuantity(Quantity &res, const String &in)
Quantum(const Qtype &factor)
Construct undimensioned quantum (i.e.
Quantum< Qtype > & operator*=(const Qtype &other)
Quantum< Qtype > get() const
Return a Quantum converted to specified units.
Quantum< Qtype > & operator/=(const Qtype &other)
Quantum< Qtype > & operator-=(const Qtype &other)
Quantum< Qtype > operator-(const Quantum< Qtype > &other) const
Quantum< Qtype > get(const Quantum< Qtype > &other) const
Convert a Quantum to units from specified quantum (ibid example)
virtual QBase * clone() const
Get a copy of Quantum.
Quantum< Qtype > operator/(const Quantum< Qtype > &other) const
friend istream & operator>>(istream &is, Quantity &ku)
Input, only quantity is supported now.
Base for Quantities (i.e. dimensioned values)
Quantum< Qtype > & operator*=(const Quantum< Qtype > &other)
Quantum< Double > Quantity
this file contains all the compiler specific defines
Quantum< Qtype > operator-() const
void convert(const Quantum< Qtype > &other)
Convert a Quantum to units from specified quantum (ibid example)
Pointed String class to aid analysis of quantity strings.
Quantum(const Qtype &factor, const Unit &s)
Construct dimensioned quantum (e.g.
Quantum< Qtype > & operator-=(const Quantum< Qtype > &other)
String: the storage and methods of handling collections of characters.
bool Bool
Define the standard types used by Casacore.
virtual const Unit & getFullUnit() const
Get the unit (as Unit) that is attached to the Quantum.
void setValue(const Qtype &val)
Set the value without changing units.
Qtype getValue(const Unit &other, Bool requireConform=False) const
Get value in specified units.
Quantum< Qtype > & operator=(const Quantum< Qtype > &other)
Assignment (deep copy)
Quantum< Qtype > get(const Unit &s) const
Convert to specified units; any remainder will be expressed in canonical units.
Quantum< Qtype > & operator+=(const Qtype &other)
Quantum(const Quantum< Qtype > &other)
Copy constructor (deep copy)
Quantum< Qtype > & operator+=(const Quantum< Qtype > &other)
In place arithmetic functions: left hand side changed in place.
Quantum(const Qtype &factor, const QBase &other)
Construct quantum with unit copied from existing quantum.
void assure(const UnitVal &uv) const
Assert correct kind.
static Bool read(Quantity &res, MUString &in)
void convert()
Convert a Quantum to specified units.