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{
71public:
72 // Create a columns object that accesses the data in the specified Table
73 MSProcessorColumns(const MSProcessor& msProcessor);
74
75 // The destructor does nothing special
77
78 // Access to required columns
79 // <group>
85 // </group>
86
87 // Access to optional columns
88 // <group>
90 // </group>
91
92 // Const access to required columns
93 // <group>
94 const ScalarColumn<Bool>& flagRow() const {return flagRow_p;}
95 const ScalarColumn<Int>& modeId() const {return modeId_p;}
96 const ScalarColumn<String>& type() const {return type_p;}
97 const ScalarColumn<Int>& typeId() const {return typeId_p;}
98 const ScalarColumn<String>& subType() const {return subType_p;}
99 // </group>
100
101 // Const access to optional columns
102 // <group>
103 const ScalarColumn<Int>& passId() const {return passId_p;}
104 // </group>
105
106 // Convenience function that returns the number of rows in any of the columns
107 rownr_t nrow() const {return flagRow_p.nrow();}
108
109protected:
110 //# default constructor creates a object that is not usable. Use the attach
111 //# function correct this.
113
114 //# attach this object to the supplied table.
115 void attach(const MSProcessor& msProcessor);
116
117private:
118 //# Make the assignment operator and the copy constructor private to prevent
119 //# any compiler generated one from being used.
122
123 //# Check if any optional columns exist and if so attach them.
124 void attachOptionalCols(const MSProcessor& msProcessor);
125
126 //# required columns
132 //# optional columns
134};
135
136//# Define the RO version for backward compatibility.
138
139} //# NAMESPACE CASACORE - END
140
141#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 &)
rownr_t nrow() const
Get the number of rows in the column.
this file contains all the compiler specific defines
Definition mainpage.dox:28
MSProcessorColumns ROMSProcessorColumns
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44