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