casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CTColumns.h
Go to the documentation of this file.
1 //# CTColumns.h: provides easy access to (new) CalTable columns
2 //# Copyright (C) 2011
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 CALIBRATION_NEWCALTABLECOLUMNS_H
29 #define CALIBRATION_NEWCALTABLECOLUMNS_H
30 
31 #include <casa/aips.h>
40 
41 namespace casa { //# NAMESPACE CASA - BEGIN
42 
43 class NewCalTable;
44 // <summary>
45 // A class to provide easy read-only access to new CalTable columns
46 // </summary>
47 
48 // <use visibility=export>
49 
50 // <reviewed reviewer="" date="" tests="" demos="">
51 // </reviewed>
52 
53 // <prerequisite>
54 // <li> NewCalTable
55 // <li> ArrayColumn
56 // <li> ScalarColumn
57 // </prerequisite>
58 //
59 // <etymology>
60 // ROCTColumns stands for Read-Only NewCalTable casacore::Table columns.
61 // </etymology>
62 //
63 // <synopsis>
64 // This class provides read-only access to the columns in the NewCalTable, similar
65 // to the casacore::ROMSColumns for MeasurementSet.
66 // It does the declaration of all the Scalar and ArrayColumns with the
67 // correct types, so the application programmer doesn't have to
68 // worry about getting those right. There is an access function
69 // for every predefined column. Access to non-predefined columns will still
70 // have to be done with explicit declarations.
71 // </synopsis>
72 //
73 // <example>
74 // <srcblock>
75 // // use as follows
76 // NewCalTable newcalt("mynewcalt");
77 // RONCTColumns nctc(newcalt);
78 // // show time from row 5
79 // cout << nctc.time()(5);
80 // // show name of antenna on row 3 in antenna table
81 // cout << nctc.antenna().name();
82 // </srcblock>
83 // </example>
84 //
85 // <motivation>
86 // See <linkto class=CTColumns> CTColumns</linkto> for the motivation.
87 // </motivation>
88 //
89 // <todo asof="">
90 // </todo>
91 
93 {
94 public:
95  // Create a columns object that accesses the data in the specified MS
96  ROCTColumns(const NewCalTable& caltable);
97 
98  // The destructor does nothing special
99  ~ROCTColumns();
100 
101  // Access to required subtables
102  // <group>
104  const ROCTAntennaColumns& antenna() const {return antenna_p;}
105  const ROCTFieldColumns& field() const {return field_p;}
106  const ROCTHistoryColumns& history() const {return history_p;}
108  return spectralWindow_p;}
109  // </group>
110 
111  // Access to optional subtables
112  // <group>
113  // </group>
114 
115 protected:
116  friend class NewCalTable;
117 private:
118  // Access to subtables
124 
125 };
126 
127 // <summary>
128 // A class to provide easy read-write access to NewCalTable columns
129 // </summary>
130 
131 // <use visibility=export>
132 
133 // <reviewed reviewer="" date="" tests="" demos="">
134 // </reviewed>
135 
136 // <prerequisite>
137 // <li> NewCalTable
138 // <li> ArrayColumn
139 // <li> ScalarColumn
140 // </prerequisite>
141 //
142 // <etymology>
143 // CTColumns stands for NewCalTable columns.
144 // </etymology>
145 //
146 // <synopsis>
147 // This class provides access to all the subtables and direct access to all the
148 // columns in the NewCalTable. It does the declaration of all the Scalar
149 // and ArrayColumns with the correct types, so the application programmer
150 // doesn't have to worry about getting those right. There is an access function
151 // for every predefined column. Access to non-predefined columns will still
152 // have to be done with explicit declarations.
153 // </synopsis>
154 //
155 // <example>
156 // <srcblock>
157 // // use as follows
158 // NewCalTable newcalt("mynewcalt",casacore::Table::Update);
159 // CTColumns nctc(newcalt);
160 // // show time from row 5
161 // cout << nctc.time()(5);
162 // // change name of antenna on row 3 in antenna table
163 // nctc.antenna().name().put(3,"NewAnt-3");
164 // </srcblock>
165 // </example>
166 //
167 // <motivation>
168 // Having to type long lists of Scalar and casacore::Array column declarations gets
169 // very tedious. This class attempts to relieve some of that tedium, while
170 // at the same time concentrating all the declarations in one place,
171 // making Type errors in the column declaration (only caught at run-time) less
172 // probable. Type errors in the use of the columns is caught at compile
173 // time.
174 // </motivation>
175 //
176 // <todo asof="">
177 // </todo>
178 
180 {
181 public:
182  // Create a columns object that accesses the data in the specified caltable
183  CTColumns(NewCalTable& caltable);
184 
185  // The destructor does nothing special
186  ~CTColumns();
187 
188  // Read-write access to required subtables
189  // <group>
195 
196  // </group>
197 
198  // Read-write access to optional subtables
199  // <group>
200  // </group>
201 
202  // Read-only access to required subtables
203  // <group>
205  const ROCTAntennaColumns& antenna() const {return antenna_p;}
206  const ROCTFieldColumns& field() const {return field_p;}
207  const ROCTHistoryColumns& history() const {return history_p;}
209  return spectralWindow_p;}
210 
211 //protected:
212 // friend class NewCalTable;
213 
214 private:
215  // Access to subtables
221 };
222 
223 
224 } //# NAMESPACE CASA - END
225 
226 #endif
227 
const ROCTAntennaColumns & antenna() const
Definition: CTColumns.h:205
const ROCTObservationColumns & observation() const
Read-write access to optional subtables.
Definition: CTColumns.h:204
A class to provide easy read-write access to MSObservation columns.
Definition: MSObsColumns.h:181
const ROCTHistoryColumns & history() const
Definition: CTColumns.h:207
CTObservationColumns & observation()
Read-write access to required subtables.
Definition: CTColumns.h:190
A class to provide easy access to MSField columns.
CTColumns(NewCalTable &caltable)
Create a columns object that accesses the data in the specified caltable.
CTFieldColumns & field()
Definition: CTColumns.h:192
const ROCTAntennaColumns & antenna() const
Definition: CTColumns.h:104
~ROCTColumns()
The destructor does nothing special.
CTObservationColumns observation_p
protected: friend class NewCalTable;
Definition: CTColumns.h:216
A class to provide easy read-write access to NewCalTable columns.
Definition: CTColumns.h:179
ROCTFieldColumns field_p
Definition: CTColumns.h:121
CTSpWindowColumns & spectralWindow()
Definition: CTColumns.h:194
A class to provide easy read-write access to MSHistory columns.
A class to provide easy read-only access to MSASpectralWindow columns.
A class to provide easy read-write access to MSField columns.
ROCTSpWindowColumns spectralWindow_p
Definition: CTColumns.h:123
const ROCTFieldColumns & field() const
Definition: CTColumns.h:105
ROCTObservationColumns observation_p
Access to subtables.
Definition: CTColumns.h:119
A class to provide easy read-only access to MSHistory columns.
A class to provide easy read-write access to MSSpectralWindow columns.
ROCTColumns(const NewCalTable &caltable)
Create a columns object that accesses the data in the specified MS.
ROCTHistoryColumns history_p
Definition: CTColumns.h:122
A class to provide easy read-write access to MSAntenna columns.
const ROCTSpWindowColumns & spectralWindow() const
Definition: CTColumns.h:107
const ROCTHistoryColumns & history() const
Definition: CTColumns.h:106
const ROCTFieldColumns & field() const
Definition: CTColumns.h:206
const ROCTObservationColumns & observation() const
Access to required subtables.
Definition: CTColumns.h:103
CTHistoryColumns history_p
Definition: CTColumns.h:219
CTAntennaColumns & antenna()
Definition: CTColumns.h:191
CTFieldColumns field_p
Definition: CTColumns.h:218
CTHistoryColumns & history()
Definition: CTColumns.h:193
A class to provide easy read-only access to MSObservation columns.
Definition: MSObsColumns.h:80
CTAntennaColumns antenna_p
Definition: CTColumns.h:217
A class to provide easy read-only access to MSAntenna columns.
A class to provide easy read-only access to new CalTable columns.
Definition: CTColumns.h:92
CTSpWindowColumns spectralWindow_p
Definition: CTColumns.h:220
~CTColumns()
The destructor does nothing special.
const ROCTSpWindowColumns & spectralWindow() const
Definition: CTColumns.h:208
ROCTAntennaColumns antenna_p
Definition: CTColumns.h:120