casacore
Loading...
Searching...
No Matches
MSProcessorColumns.h
Go to the documentation of this file.
1// # MSProcessorColumns.h: provides easy access to MSProcessor 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: 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 MS_MSPROCESSORCOLUMNS_H
27#define MS_MSPROCESSORCOLUMNS_H
28
29#include <casacore/casa/aips.h>
30#include <casacore/ms/MeasurementSets/MSProcessor.h>
31#include <casacore/tables/Tables/ScalarColumn.h>
32
33namespace casacore { // # NAMESPACE CASACORE - BEGIN
34
35class MSProcessor;
36
37// <summary>
38// A class to provide easy access to MSProcessor columns
39// </summary>
40
41// <use visibility=export>
42
43// <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
44// </reviewed>
45
46// <prerequisite>
47// <li> MSProcessor
48// <li> ScalarColumn
49// </prerequisite>
50//
51// <etymology>
52// MSProcessorColumns stands for MeasurementSet Processor Table columns.
53// </etymology>
54//
55// <synopsis>
56// This class provides access to the columns in the MSProcessor Table,
57// it does the declaration of all the Scalar and ArrayColumns with the
58// correct types, so the application programmer doesn't have to
59// worry about getting those right. There is an access function
60// for every predefined column. Access to non-predefined columns will still
61// have to be done with explicit declarations.
62// See <linkto class=MSColumns> MSColumns</linkto> for an example.
63// </synopsis>
64//
65// <motivation>
66// See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
67// </motivation>
68
70 public:
71 // Create a columns object that accesses the data in the specified Table
72 MSProcessorColumns(const MSProcessor& msProcessor);
73
74 // The destructor does nothing special
76
77 // Access to required columns
78 // <group>
84 // </group>
85
86 // Access to optional columns
87 // <group>
89 // </group>
90
91 // Const access to required columns
92 // <group>
93 const ScalarColumn<Bool>& flagRow() const { return flagRow_p; }
94 const ScalarColumn<Int>& modeId() const { return modeId_p; }
95 const ScalarColumn<String>& type() const { return type_p; }
96 const ScalarColumn<Int>& typeId() const { return typeId_p; }
97 const ScalarColumn<String>& subType() const { return subType_p; }
98 // </group>
99
100 // Const access to optional columns
101 // <group>
102 const ScalarColumn<Int>& passId() const { return passId_p; }
103 // </group>
104
105 // Convenience function that returns the number of rows in any of the columns
106 rownr_t nrow() const { return flagRow_p.nrow(); }
107
108 protected:
109 // # default constructor creates a object that is not usable. Use the attach
110 // # function correct this.
112
113 // # attach this object to the supplied table.
114 void attach(const MSProcessor& msProcessor);
115
116 private:
117 // # Make the assignment operator and the copy constructor private to prevent
118 // # any compiler generated one from being used.
121
122 // # Check if any optional columns exist and if so attach them.
123 void attachOptionalCols(const MSProcessor& msProcessor);
124
125 // # required columns
131 // # optional columns
133};
134
135// # Define the RO version for backward compatibility.
137
138} // namespace casacore
139
140#endif
ScalarColumn< String > subType_p
const ScalarColumn< Int > & passId() const
Const access to optional columns.
ScalarColumn< Bool > & flagRow()
Access to required columns.
const ScalarColumn< String > & type() const
MSProcessorColumns(const MSProcessor &msProcessor)
Create a columns object that accesses the data in the specified Table.
~MSProcessorColumns()
The destructor does nothing special.
ScalarColumn< Int > & typeId()
ScalarColumn< Int > & passId()
Access to optional columns.
const ScalarColumn< Int > & modeId() const
rownr_t nrow() const
Convenience function that returns the number of rows in any of the columns.
void attachOptionalCols(const MSProcessor &msProcessor)
ScalarColumn< String > type_p
ScalarColumn< String > & subType()
MSProcessorColumns(const MSProcessorColumns &)
ScalarColumn< String > & type()
const ScalarColumn< Bool > & flagRow() const
Const access to required columns.
void attach(const MSProcessor &msProcessor)
const ScalarColumn< Int > & typeId() const
ScalarColumn< Int > & modeId()
const ScalarColumn< String > & subType() const
MSProcessorColumns & operator=(const MSProcessorColumns &)
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
MSProcessorColumns ROMSProcessorColumns
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44