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;
363 void scale(
const Qtype &factor);
416 virtual void print(ostream &os)
const;
446 #ifndef CASACORE_NO_AUTO_TEMPLATES
447 #include <casacore/casa/Quanta/Quantum.tcc>
Quantum(const Quantum< Qtype > &other)
Copy constructor (deep copy)
Quantum< Qtype > get() const
Return a Quantum converted to specified units
Quantum< Qtype > get(const Quantum< Qtype > &other) const
Convert a Quantum to units from specified quantum (ibid example)
Quantum(const Qtype &factor, const Unit &s)
Construct dimensioned quantum (e.g.
friend istream & operator>>(istream &is, Quantity &ku)
Input, only quantity is supported now.
Quantum(const Qtype &factor, const QBase &other)
Construct quantum with unit copied from existing quantum.
void convert()
Convert a Quantum to specified units.
void convert(const Quantum< Qtype > &other)
Convert a Quantum to units from specified quantum (ibid example)
Qtype qVal
Actual quantum value.
Quantum< Qtype > & operator+=(const Quantum< Qtype > &other)
In place arithmetic functions: left hand side changed in place.
virtual const Unit & getFullUnit() const
Get the unit (as Unit) that is attached to the Quantum.
Quantum< Qtype > operator+(const Quantum< Qtype > &other) const
Arithmetic operators: return Quantum<T>
Bool check(const UnitVal &uv) const
Check if of specified type.
Quantum< Qtype > operator-(const Quantum< Qtype > &other) const
virtual QBase * clone() const
Get a copy of Quantum.
Quantum< Qtype > operator-() const
void convert(const Unit &s)
Convert to specified units; any remainder will be expressed in canonical units.
Quantum< Qtype > & operator*=(const Quantum< Qtype > &other)
void scale(const Qtype &factor)
Re-specify parts of a quantum
Quantum< Qtype > operator*(const Quantum< Qtype > &other) const
Quantum< Qtype > & operator/=(const Quantum< Qtype > &other)
virtual void print(ostream &os) const
Print a Quantum.
Qtype getValue(const Unit &other, Bool requireConform=False) const
Get value in specified units.
Quantum< Qtype > & operator-=(const Qtype &other)
const Quantum< Qtype > & operator+() const
Unary operations.
Qtype getBaseValue() const
Get value in canonical base units.
Quantum< Qtype > & operator+=(const Qtype &other)
Quantum< Qtype > operator/(const Quantum< Qtype > &other) const
Quantum< Qtype > get(const Unit &s) const
Convert to specified units; any remainder will be expressed in canonical units.
Quantum< Qtype > & operator=(const Quantum< Qtype > &other)
Assignment (deep copy)
virtual uInt type() const
Get the type (using QuantumType) of derived Quantum (faster than Strings)
Quantum(const Qtype &factor)
Construct undimensioned quantum (i.e.
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 ...
void assure(const UnitVal &uv) const
Assert correct kind.
void setValue(const Qtype &val)
Set the value without changing units.
Quantum()
Default constructor, generates '0'.
const Qtype & getValue() const
Get value of quantum in current units (i.e.
static Bool read(Quantity &res, MUString &in)
Quantum< Qtype > & operator/=(const Qtype &other)
Quantum< Qtype > & operator-=(const Quantum< Qtype > &other)
Quantum< Qtype > & operator*=(const Qtype &other)
String: the storage and methods of handling collections of characters.
this file contains all the compiler specific defines
bool Bool
Define the standard types used by Casacore.
Quantum< Double > Quantity
AipsIO & operator>>(AipsIO &os, Record &rec)