28 #ifndef CASA_QUANTUMHOLDER_H
29 #define CASA_QUANTUMHOLDER_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/casa/Arrays/ArrayFwd.h>
34 #include <casacore/casa/Utilities/PtrHolder.h>
35 #include <casacore/casa/Utilities/RecordTransformable.h>
36 #include <casacore/casa/BasicSL/Complexfwd.h>
43 class RecordInterface;
45 template <
class Qtype>
class Quantum;
const Quantum< Vector< Int > > & asQuantumVectorInt()
const Quantum< Double > & asQuantumDouble()
Bool isQuantumDouble() const
Bool isQuantumDComplex() const
Bool isQuantumVectorComplex() const
Bool isQuantumArrayDComplex() const
Bool isQuantumArrayFloat() const
void toComplex(const uInt &tp)
Convert to a different complex scalar quantum.
Bool isEmpty() const
Check if it holds a Quantity.
QuantumHolder(const QuantumHolder &other)
Copy a holder (copy semantics)
Bool isQuantumVectorDouble() const
Bool isQuantumComplex() const
const Quantum< Complex > & asQuantumComplex()
const Quantum< Array< DComplex > > & asQuantumArrayDComplex()
void toArray()
Convert scalar to Array.
Int nelements() const
Get number of numeric elements (1 if scalar, else vector length) or dimensions (0 if scalar)
const Quantum< Array< Complex > > & asQuantumArrayComplex()
QuantumHolder(const QBase &in)
Create from a Quantum (copy semantics)
virtual const String & ident() const
Return identification.
Bool isQuantumArrayInt() const
const Quantum< Array< Double > > & asQuantumArrayDouble()
void toReal(const uInt &tp)
Convert to a different real scalar quantum.
const Quantum< Double > & asQuantity()
QuantumHolder()
Creates an empty holder.
const Quantum< Vector< DComplex > > & asQuantumVectorDComplex()
Bool isQuantumVectorDComplex() const
QuantumHolder & operator=(const QuantumHolder &other)
Assignment (copy semantics)
virtual Bool toRecord(String &error, RecordInterface &out) const
Create a record from a Quantum.
const Quantum< Vector< Double > > & asQuantumVectorDouble()
virtual Bool fromString(String &error, const String &in)
Initialise the class from a String representation.
PtrHolder< QBase > hold_p
Pointer to a Quantity.
const Quantum< Vector< Float > > & asQuantumVectorFloat()
virtual Record toRecord() const
this version throws an exception or returns the result Record.
const Quantum< Array< Int > > & asQuantumArrayInt()
virtual Bool fromRecord(String &error, const RecordInterface &in)
Create a Quantum from a record or a string.
Bool isQuantumFloat() const
const Quantum< Vector< Complex > > & asQuantumVectorComplex()
void toVector()
Convert scalar to Vector.
Bool isQuantumVectorInt() const
const Quantum< Int > & asQuantumInt()
Bool isQuantumArrayDouble() const
Bool isQuantumInt() const
Bool isQuantumVectorFloat() const
const Quantum< Float > & asQuantumFloat()
const Quantum< DComplex > & asQuantumDComplex()
const Quantum< Array< Float > > & asQuantumArrayFloat()
virtual void toRecord(RecordInterface &out) const
this version throws an exception rather than returning false
const QBase & asQuantum() const
Get a Quantum from the holder (with lifetime as long as holder exists).
Bool isQuantumArrayComplex() const
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.