casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSDopplerColumns.h
Go to the documentation of this file.
1 //# MSDopplerColumns.h: provides easy access to MSDoppler columns
2 //# Copyright (C) 1999,2000
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$
27 
28 #ifndef MS_MSDOPPLERCOLUMNS_H
29 #define MS_MSDOPPLERCOLUMNS_H
30 
31 #include <casacore/casa/aips.h>
37 
38 namespace casacore { //# NAMESPACE CASACORE - BEGIN
39 
40 class MSDoppler;
41 
42 // <summary>
43 // A class to provide easy read-only access to MSDoppler columns
44 // </summary>
45 
46 // <use visibility=export>
47 
48 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
49 // </reviewed>
50 
51 // <prerequisite>
52 // <li> MSDoppler
53 // <li> ScalarColumn
54 // </prerequisite>
55 //
56 // <etymology>
57 // ROMSDopplerColumns stands for Read-Only MeasurementSet Doppler Table
58 // columns.
59 // </etymology>
60 //
61 // <synopsis>
62 // This class provides read-only access to the columns in the MSDoppler
63 // Table. It does the declaration of all the Scalar and ArrayColumns with the
64 // correct types, so the application programmer doesn't have to worry about
65 // getting those right. There is an access function for every predefined
66 // column. Access to non-predefined columns will still have to be done with
67 // explicit declarations. See <linkto class=ROMSColumns>
68 // ROMSColumns</linkto> for an example.
69 // </synopsis>
70 //
71 // <motivation>
72 // See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
73 // </motivation>
74 
76 {
77 public:
78  // Create a columns object that accesses the data in the specified Table
79  ROMSDopplerColumns(const MSDoppler& msDoppler);
80 
81  // The destructor does nothing special
83 
84  // Is this object defined? (MSDoppler table is optional)
85  Bool isNull() const {return isNull_p;}
86 
87  // Access to columns
88  // <group>
89  const ROScalarColumn<Int>& dopplerId() const {return dopplerId_p;}
90  const ROScalarColumn<Int>& sourceId() const {return sourceId_p;}
91  const ROScalarColumn<Int>& transitionId() const {return transitionId_p;}
92  const ROScalarColumn<Double>& velDef() const {return velDef_p;}
93  const ROScalarQuantColumn<Double>& velDefQuant() const {return velDefQuant_p;}
94  const ROScalarMeasColumn<MDoppler>& velDefMeas() const {return velDefMeas_p;}
95  // </group>
96 
97  // Convenience function that returns the number of rows in any of the
98  // columns. Returns zero if the object is null.
99  uInt nrow() const {return isNull() ? 0 : dopplerId_p.nrow();}
100 
101 protected:
102  //# default constructor creates a object that is not usable. Use the attach
103  //# function correct this.
105 
106  //# attach this object to the supplied table.
107  void attach(const MSDoppler& msDoppler);
108 
109 private:
110  //# Make the assignment operator and the copy constructor private to prevent
111  //# any compiler generated one from being used.
114 
115  //# Is the object not attached to a Table.
117 
118  //# required columns
119  ROScalarColumn<Int> dopplerId_p;
120  ROScalarColumn<Int> sourceId_p;
121  ROScalarColumn<Int> transitionId_p;
122  ROScalarColumn<Double> velDef_p;
123 
124  //# Access to Measure columns
125  ROScalarMeasColumn<MDoppler> velDefMeas_p;
126 
127  //# Access to Quantum columns
128  ROScalarQuantColumn<Double> velDefQuant_p;
129 
130 };
131 
132 // <summary>
133 // A class to provide easy read-write access to MSDoppler columns
134 // </summary>
135 
136 // <use visibility=export>
137 
138 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
139 // </reviewed>
140 
141 // <prerequisite>
142 // <li> MSDoppler
143 // <li> ScalarColumn
144 // </prerequisite>
145 //
146 // <etymology>
147 // MSDopplerColumns stands for MeasurementSet Doppler Table columns.
148 // </etymology>
149 //
150 // <synopsis>
151 // This class provides access to the columns in the MSDoppler Table,
152 // it does the declaration of all the Scalar and ArrayColumns with the
153 // correct types, so the application programmer doesn't have to
154 // worry about getting those right. There is an access function
155 // for every predefined column. Access to non-predefined columns will still
156 // have to be done with explicit declarations.
157 // See <linkto class=MSColumns> MSColumns</linkto> for an example.
158 // </synopsis>
159 //
160 // <motivation>
161 // See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
162 // </motivation>
163 
165 {
166 public:
167  // Create a columns object that accesses the data in the specified Table
168  MSDopplerColumns(MSDoppler& msDoppler);
169 
170  // The destructor does nothing special
172 
173  // Read-write access to required columns
174  // <group>
181  // </group>
182 
183  // Read-only access to required columns
184  // <group>
185  const ROScalarColumn<Int>& dopplerId() const {
187  const ROScalarColumn<Int>& sourceId() const {
189  const ROScalarColumn<Int>& transitionId() const {
191  const ROScalarColumn<Double>& velDef() const {
192  return ROMSDopplerColumns::velDef();}
193  const ROScalarQuantColumn<Double>& velDefQuant() const {
195  const ROScalarMeasColumn<MDoppler>& velDefMeas() const {
197  // </group>
198 
199  // set the DOPPLER type for the VELDEF column.
200  void setVelDefRef(MDoppler::Types ref);
201 
202 protected:
203  //# default constructor creates a object that is not usable. Use the attach
204  //# function correct this.
206 
207  //# attach this object to the supplied table.
208  void attach(MSDoppler& msDoppler);
209 
210 private:
211  //# Make the assignment operator and the copy constructor private to prevent
212  //# any compiler generated one from being used.
215 
216  //# required columns
221 
222  //# Access to Measure columns
224 
225  //# Access to Quantum columns
227 };
228 
229 
230 } //# NAMESPACE CASACORE - END
231 
232 #endif
ScalarQuantColumn< Double > & velDefQuant()
A Table intended to hold a MeasurementSet DOPPLER table.
Definition: MSDoppler.h:79
const ROScalarColumn< Int > & sourceId() const
ScalarColumn< Int > transitionId_p
const ROScalarQuantColumn< Double > & velDefQuant() const
ScalarColumn< Int > sourceId_p
const ROScalarColumn< Double > & velDef() const
MSDopplerColumns & operator=(const MSDopplerColumns &)
const ROScalarColumn< Double > & velDef() const
ScalarMeasColumn< MDoppler > & velDefMeas()
const ROScalarQuantColumn< Double > & velDefQuant() const
const ROScalarColumn< Int > & dopplerId() const
Read-only access to required columns.
const ROScalarMeasColumn< MDoppler > & velDefMeas() const
ROScalarQuantColumn< Double > velDefQuant_p
ROScalarColumn< Int > dopplerId_p
ScalarQuantColumn< Double > velDefQuant_p
ScalarColumn< Double > & velDef()
ROScalarColumn< Int > transitionId_p
ROScalarMeasColumn< MDoppler > velDefMeas_p
ScalarColumn< Int > & sourceId()
void setVelDefRef(MDoppler::Types ref)
set the DOPPLER type for the VELDEF column.
ScalarColumn< Double > velDef_p
void attach(const MSDoppler &msDoppler)
A class to provide easy read-only access to MSDoppler columns.
Bool isNull() const
Is this object defined? (MSDoppler table is optional)
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
A class to provide easy read-write access to MSDoppler columns.
ScalarColumn< Int > dopplerId_p
ScalarColumn< Int > & dopplerId()
Read-write access to required columns.
Types
Types of known MDopplers Warning: The order defines the order in the translation matrix FromTo in th...
Definition: MDoppler.h:149
void attach(MSDoppler &msDoppler)
ROScalarColumn< Int > sourceId_p
ScalarMeasColumn< MDoppler > velDefMeas_p
const ROScalarColumn< Int > & transitionId() const
const ROScalarColumn< Int > & sourceId() const
~ROMSDopplerColumns()
The destructor does nothing special.
ScalarColumn< Int > & transitionId()
~MSDopplerColumns()
The destructor does nothing special.
const ROScalarColumn< Int > & dopplerId() const
Access to columns.
ROScalarColumn< Double > velDef_p
const ROScalarMeasColumn< MDoppler > & velDefMeas() const
uInt nrow() const
Convenience function that returns the number of rows in any of the columns.
ROMSDopplerColumns & operator=(const ROMSDopplerColumns &)
unsigned int uInt
Definition: aipstype.h:51
const ROScalarColumn< Int > & transitionId() const
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42