casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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: aips2-request@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 //# $Id: QuantumHolder.h 20551 2009-03-25 00:11:33Z Malte.Marquarding $
27 
28 #ifndef CASA_QUANTUMTYPE_H
29 #define CASA_QUANTUMTYPE_H
30 
31 //# Includes
32 #include <casacore/casa/aips.h>
35 
36 namespace casacore { //# NAMESPACE CASACORE - BEGIN
37 
38 //# Forward Declarations
39 template <class T> class Quantum;
40 
41 // <summary> Get an integer type for a Qunatum<T> </summary>
42 
43 // <use visibility=export>
44 
45 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tQuantumHolder" demos="">
46 // </reviewed>
47 
48 // <synopsis>
49 // The old way of getting a type number for a Quantum<T> uses the Register
50 // class. This did not work well with shared libraries, because each shared
51 // library gets its own static type data. Hence a type generated in one
52 // python module sometimes mismatched the type for the same Quantum in
53 // another module. For instance, it appeared that whem first loading
54 // pyrap.tables and thereafter pyrap.quanta, things went wrong.
55 //
56 // Therefore this class has been developed that returns the type for the
57 // Quantum template types used by QuantumHolder.
58 // </synopsis>
59 
60 // <group name=QuantumType>
61 
63  { return 1; }
65  { return 2; }
66  inline uInt quantumType (const Quantum<Int>*)
67  { return 3; }
69  { return 4; }
71  { return 5; }
73  { return 6; }
75  { return 7; }
76  inline uInt quantumType (const Quantum< Vector<Int> >*)
77  { return 8; }
79  { return 9; }
81  { return 10; }
83  { return 11; }
84  inline uInt quantumType (const Quantum< Array<Float> >*)
85  { return 12; }
86  inline uInt quantumType (const Quantum< Array<Int> >*)
87  { return 13; }
89  { return 14; }
91  { return 15; }
93  { return 16; }
95  { return 17; }
96  inline uInt quantumType (const Quantum< Matrix<Int> >*)
97  { return 18; }
99  { return 19; }
101  { return 20; }
102 
103 // </group>
104 
105 } //# NAMESPACE CASACORE - END
106 
107 #endif
uInt quantumType(const Quantum< Array< DComplex > > *)
Definition: QuantumType.h:88
uInt quantumType(const Quantum< Array< Float > > *)
Definition: QuantumType.h:84
uInt quantumType(const Quantum< DComplex > *)
Definition: QuantumType.h:68
uInt quantumType(const Quantum< Matrix< Int > > *)
Definition: QuantumType.h:96
uInt quantumType(const Quantum< Array< Complex > > *)
Definition: QuantumType.h:90
uInt quantumType(const Quantum< Vector< Float > > *)
Definition: QuantumType.h:74
uInt quantumType(const Quantum< Matrix< Double > > *)
Definition: QuantumType.h:92
uInt quantumType(const Quantum< Vector< Double > > *)
Definition: QuantumType.h:72
uInt quantumType(const Quantum< Matrix< DComplex > > *)
Definition: QuantumType.h:98
uInt quantumType(const Quantum< Vector< Int > > *)
Definition: QuantumType.h:76
uInt quantumType(const Quantum< Matrix< Float > > *)
Definition: QuantumType.h:94
uInt quantumType(const Quantum< Float > *)
Definition: QuantumType.h:64
uInt quantumType(const Quantum< Vector< Complex > > *)
Definition: QuantumType.h:80
uInt quantumType(const Quantum< Array< Double > > *)
Definition: QuantumType.h:82
uInt quantumType(const Quantum< Array< Int > > *)
Definition: QuantumType.h:86
uInt quantumType(const Quantum< Matrix< Complex > > *)
Definition: QuantumType.h:100
uInt quantumType(const Quantum< Vector< DComplex > > *)
Definition: QuantumType.h:78
uInt quantumType(const Quantum< Double > *)
Definition: QuantumType.h:62
unsigned int uInt
Definition: aipstype.h:51
uInt quantumType(const Quantum< Complex > *)
Definition: QuantumType.h:70