casacore
Loading...
Searching...
No Matches
QuantumType.h
Go to the documentation of this file.
1// # QuantumType.h: Get an integer type for a Qunatum<T>
2// # Copyright (C) 2010
3// # Associated Universities, Inc. Washington DC, USA.
4// #
5// # This library is free software; you can redistribute it and/or modify it
6// # under the terms of the GNU Library General Public License as published by
7// # the Free Software Foundation; either version 2 of the License, or (at your
8// # option) any later version.
9// #
10// # This library is distributed in the hope that it will be useful, but WITHOUT
11// # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12// # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13// # License for more details.
14// #
15// # You should have received a copy of the GNU Library General Public License
16// # along with this library; if not, write to the Free Software Foundation,
17// # Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18// #
19// # Correspondence concerning AIPS++ should be addressed as follows:
20// # Internet email: casa-feedback@nrao.edu.
21// # Postal address: AIPS++ Project Office
22// # National Radio Astronomy Observatory
23// # 520 Edgemont Road
24// # Charlottesville, VA 22903-2475 USA
25
26#ifndef CASA_QUANTUMTYPE_H
27#define CASA_QUANTUMTYPE_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/casa/Arrays/ArrayFwd.h>
32#include <casacore/casa/BasicSL/Complex.h>
33
34namespace casacore { // # NAMESPACE CASACORE - BEGIN
35
36// # Forward Declarations
37template <class T>
38class Quantum;
39
40// <summary> Get an integer type for a Qunatum<T> </summary>
41
42// <use visibility=export>
43
44// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tQuantumHolder" demos="">
45// </reviewed>
46
47// <synopsis>
48// The old way of getting a type number for a Quantum<T> uses the Register
49// class. This did not work well with shared libraries, because each shared
50// library gets its own static type data. Hence a type generated in one
51// python module sometimes mismatched the type for the same Quantum in
52// another module. For instance, it appeared that whem first loading
53// pyrap.tables and thereafter pyrap.quanta, things went wrong.
54//
55// Therefore this class has been developed that returns the type for the
56// Quantum template types used by QuantumHolder.
57// </synopsis>
58
59// <group name=QuantumType>
61inline uInt quantumType(const Quantum<Double>*) { return 1; }
62inline uInt quantumType(const Quantum<Float>*) { return 2; }
63inline uInt quantumType(const Quantum<Int>*) { return 3; }
64inline uInt quantumType(const Quantum<DComplex>*) { return 4; }
65inline uInt quantumType(const Quantum<Complex>*) { return 5; }
66inline uInt quantumType(const Quantum<Vector<Double>>*) { return 6; }
67inline uInt quantumType(const Quantum<Vector<Float>>*) { return 7; }
68inline uInt quantumType(const Quantum<Vector<Int>>*) { return 8; }
69inline uInt quantumType(const Quantum<Vector<DComplex>>*) { return 9; }
70inline uInt quantumType(const Quantum<Vector<Complex>>*) { return 10; }
71inline uInt quantumType(const Quantum<Array<Double>>*) { return 11; }
72inline uInt quantumType(const Quantum<Array<Float>>*) { return 12; }
73inline uInt quantumType(const Quantum<Array<Int>>*) { return 13; }
74inline uInt quantumType(const Quantum<Array<DComplex>>*) { return 14; }
75inline uInt quantumType(const Quantum<Array<Complex>>*) { return 15; }
76inline uInt quantumType(const Quantum<Matrix<Double>>*) { return 16; }
77inline uInt quantumType(const Quantum<Matrix<Float>>*) { return 17; }
78inline uInt quantumType(const Quantum<Matrix<Int>>*) { return 18; }
79inline uInt quantumType(const Quantum<Matrix<DComplex>>*) { return 19; }
80inline uInt quantumType(const Quantum<Matrix<Complex>>*) { return 20; }
81
82// </group>
83
84} // namespace casacore
85
86#endif
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
uInt quantumType(const Quantum< Matrix< DComplex > > *)
Definition QuantumType.h:79
uInt quantumType(const Quantum< DComplex > *)
Definition QuantumType.h:64
uInt quantumType(const Quantum< Array< Complex > > *)
Definition QuantumType.h:75
uInt quantumType(const Quantum< Vector< Float > > *)
Definition QuantumType.h:67
uInt quantumType(const Quantum< Matrix< Int > > *)
Definition QuantumType.h:78
uInt quantumType(const Quantum< Matrix< Double > > *)
Definition QuantumType.h:76
uInt quantumType(const Quantum< Vector< Int > > *)
Definition QuantumType.h:68
uInt quantumType(const Quantum< Vector< DComplex > > *)
Definition QuantumType.h:69
uInt quantumType(const Quantum< Vector< Double > > *)
Definition QuantumType.h:66
uInt quantumType(const Quantum< Array< Float > > *)
Definition QuantumType.h:72
uInt quantumType(const Quantum< Float > *)
Definition QuantumType.h:62
uInt quantumType(const Quantum< Double > *)
Definition QuantumType.h:61
uInt quantumType(const Quantum< Matrix< Float > > *)
Definition QuantumType.h:77
uInt quantumType(const Quantum< Array< DComplex > > *)
Definition QuantumType.h:74
uInt quantumType(const Quantum< Array< Int > > *)
Definition QuantumType.h:73
uInt quantumType(const Quantum< Matrix< Complex > > *)
Definition QuantumType.h:80
uInt quantumType(const Quantum< Array< Double > > *)
Definition QuantumType.h:71
uInt quantumType(const Quantum< Vector< Complex > > *)
Definition QuantumType.h:70
uInt quantumType(const Quantum< Complex > *)
Definition QuantumType.h:65