casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSFlagCmdColumns.h
Go to the documentation of this file.
1 //# MSFlagCmdColumns.h: provides easy access to MSFlagCmd 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_MSFLAGCMDCOLUMNS_H
29 #define MS_MSFLAGCMDCOLUMNS_H
30 
31 #include <casacore/casa/aips.h>
38 
39 namespace casacore { //# NAMESPACE CASACORE - BEGIN
40 
41 class MSFlagCmd;
42 
43 // <summary>
44 // A class to provide easy read-only access to MSFlagCmd columns
45 // </summary>
46 
47 // <use visibility=export>
48 
49 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
50 // </reviewed>
51 
52 // <prerequisite>
53 // <li> MSFlagCmd
54 // <li> ScalarColumn
55 // </prerequisite>
56 //
57 // <etymology>
58 // ROMSFlagCmdColumns stands for Read-Only MeasurementSet FlagCmd Table columns.
59 // </etymology>
60 //
61 // <synopsis>
62 // This class provides read-only access to the columns in the MSFlagCmd
63 // Table. It does the declaration of all the ScalarColumns with the correct
64 // types, so the application programmer doesn't have to worry about getting
65 // those right. There is an access function for every predefined column. Access
66 // to non-predefined columns will still have to be done with explicit
67 // declarations. See <linkto class=ROMSColumns> ROMSColumns</linkto> for
68 // 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  ROMSFlagCmdColumns(const MSFlagCmd& msFlagCmd);
80 
81  // The destructor does nothing special
83 
84  // Access to required columns
85  // <group>
86  const ROScalarColumn<Bool>& applied() const {return applied_p;}
87  const ROScalarColumn<String>& command() const {return command_p;}
88  const ROScalarQuantColumn<Double>& intervalQuant() const {
89  return intervalQuant_p;}
90  const ROScalarColumn<Double>& interval() const {return interval_p;}
91  const ROScalarColumn<Int>& level() const {return level_p;}
92  const ROScalarColumn<String>& reason() const {return reason_p;}
93  const ROScalarColumn<Int>& severity() const {return severity_p;}
94  const ROScalarColumn<Double>& time() const {return time_p;}
95  const ROScalarQuantColumn<Double>& timeQuant() const { return timeQuant_p;}
96  const ROScalarMeasColumn<MEpoch>& timeMeas() const { return timeMeas_p;}
97  const ROScalarColumn<String>& type() const {return type_p;}
98  // </group>
99 
100  // Convenience function that returns the number of rows in any of the columns
101  uInt nrow() const {return applied_p.nrow();}
102 
103 protected:
104  //# default constructor creates a object that is not usable. Use the attach
105  //# function correct this.
107 
108  //# attach this object to the supplied table.
109  void attach(const MSFlagCmd& msFlagCmd);
110 
111 private:
112  //# Make the assignment operator and the copy constructor private to prevent
113  //# any compiler generated one from being used.
116 
117  //# required columns
118  ROScalarColumn<Bool> applied_p;
119  ROScalarColumn<String> command_p;
120  ROScalarColumn<Double> interval_p;
121  ROScalarColumn<Int> level_p;
122  ROScalarColumn<String> reason_p;
123  ROScalarColumn<Int> severity_p;
124  ROScalarColumn<Double> time_p;
125  ROScalarColumn<String> type_p;
126 
127  //# Access to Measure columns
128  ROScalarMeasColumn<MEpoch> timeMeas_p;
129 
130  //# Access to Quantum columns
131  ROScalarQuantColumn<Double> intervalQuant_p;
132  ROScalarQuantColumn<Double> timeQuant_p;
133 };
134 
135 // <summary>
136 // A class to provide easy read-write access to MSFlagCmd columns
137 // </summary>
138 
139 // <use visibility=export>
140 
141 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
142 // </reviewed>
143 
144 // <prerequisite>
145 // <li> MSFlagCmd
146 // <li> ScalarColumn
147 // </prerequisite>
148 //
149 // <etymology>
150 // MSFlagCmdColumns stands for MeasurementSet FlagCmd Table columns.
151 // </etymology>
152 //
153 // <synopsis>
154 // This class provides access to the columns in the MSFlagCmd Table, it does
155 // the declaration of all the ScalarColumns with the correct types, so the
156 // application programmer doesn't have to worry about getting those
157 // right. There is an access function for every predefined column. Access to
158 // non-predefined columns will still have to be done with explicit
159 // declarations. See <linkto class=MSColumns> MSColumns</linkto> for an
160 // example.
161 // </synopsis>
162 //
163 // <motivation>
164 // See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
165 // </motivation>
166 
168 {
169 public:
170  // Create a columns object that accesses the data in the specified Table
171  MSFlagCmdColumns(MSFlagCmd& msFlagCmd);
172 
173  // The destructor does nothing special
175 
176  // Read-write access to required columns
177  // <group>
189  // </group>
190 
191  // Read-only access to required columns
192  // <group>
193  const ROScalarColumn<Bool>& applied() const {
194  return ROMSFlagCmdColumns::applied();}
195  const ROScalarColumn<String>& command() const {
196  return ROMSFlagCmdColumns::command();}
197  const ROScalarQuantColumn<Double>& intervalQuant() const {
199  const ROScalarColumn<Double>& interval() const {
201  const ROScalarColumn<Int>& level() const {
202  return ROMSFlagCmdColumns::level();}
203  const ROScalarColumn<String>& reason() const {
204  return ROMSFlagCmdColumns::reason();}
205  const ROScalarColumn<Int>& severity() const {
207  const ROScalarColumn<Double>& time() const {
208  return ROMSFlagCmdColumns::time();}
209  const ROScalarQuantColumn<Double>& timeQuant() const {
211  const ROScalarMeasColumn<MEpoch>& timeMeas() const {
213  const ROScalarColumn<String>& type() const {
214  return ROMSFlagCmdColumns::type();}
215  // </group>
216 
217  // set the epoch type for the FLAG_CMD column.
218  // <note role=tip>
219  // In principle this function can only be used if the table is empty,
220  // otherwise already written values may thereafter have an incorrect
221  // reference, offset, or unit. However, it is possible that part of the
222  // table gets written before these values are known. In that case the
223  // reference, offset, or units can be set by using a False
224  // <src>tableMustBeEmpty</src> argument.
225  // </note>
226  void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True);
227 
228 protected:
229  //# default constructor creates a object that is not usable. Use the attach
230  //# function correct this.
232 
233  //# attach this object to the supplied table.
234  void attach(MSFlagCmd& msFlagCmd);
235 
236 private:
237  //# Make the assignment operator and the copy constructor private to prevent
238  //# any compiler generated one from being used.
241 
242  //# required columns
251 
252  //# Access to Measure columns
254 
255  //# Access to Quantum columns
258 };
259 
260 } //# NAMESPACE CASACORE - END
261 
262 #endif
MSFlagCmdColumns & operator=(const MSFlagCmdColumns &)
const ROScalarQuantColumn< Double > & intervalQuant() const
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
set the epoch type for the FLAG_CMD column.
ROScalarColumn< Int > severity_p
ROScalarQuantColumn< Double > intervalQuant_p
const ROScalarQuantColumn< Double > & timeQuant() const
ScalarColumn< Double > interval_p
const ROScalarColumn< String > & reason() const
const ROScalarColumn< Double > & interval() const
~ROMSFlagCmdColumns()
The destructor does nothing special.
const ROScalarColumn< String > & command() const
ScalarColumn< String > command_p
const ROScalarColumn< Bool > & applied() const
Access to required columns.
const ROScalarColumn< Int > & level() const
void attach(MSFlagCmd &msFlagCmd)
ScalarColumn< String > reason_p
ScalarQuantColumn< Double > timeQuant_p
ScalarColumn< Int > level_p
ROScalarColumn< String > type_p
const ROScalarColumn< String > & type() const
const ROScalarMeasColumn< MEpoch > & timeMeas() const
ROScalarColumn< String > command_p
const ROScalarColumn< Double > & time() const
ScalarColumn< Int > & level()
const ROScalarColumn< Int > & level() const
ROScalarColumn< Bool > applied_p
ScalarColumn< String > & reason()
ROScalarMeasColumn< MEpoch > timeMeas_p
ROScalarColumn< Int > level_p
ScalarQuantColumn< Double > intervalQuant_p
uInt nrow() const
Convenience function that returns the number of rows in any of the columns.
ScalarQuantColumn< Double > & timeQuant()
ScalarQuantColumn< Double > & intervalQuant()
ScalarColumn< String > type_p
ScalarColumn< Bool > applied_p
const ROScalarColumn< Int > & severity() const
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
const ROScalarColumn< Double > & time() const
const ROScalarMeasColumn< MEpoch > & timeMeas() const
ScalarMeasColumn< MEpoch > & timeMeas()
const ROScalarColumn< String > & type() const
const ROScalarColumn< String > & command() const
ScalarColumn< String > & type()
const ROScalarQuantColumn< Double > & intervalQuant() const
ROScalarColumn< String > reason_p
ScalarColumn< String > & command()
ROMSFlagCmdColumns & operator=(const ROMSFlagCmdColumns &)
const ROScalarQuantColumn< Double > & timeQuant() const
const ROScalarColumn< Int > & severity() const
ScalarColumn< Int > & severity()
const ROScalarColumn< String > & reason() const
const ROScalarColumn< Bool > & applied() const
Read-only access to required columns.
ScalarColumn< Double > & interval()
A Table intended to hold a MeasurementSet FLAG_CMD table.
Definition: MSFlagCmd.h:78
ScalarColumn< Int > severity_p
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition: MEpoch.h:117
ROScalarColumn< Double > interval_p
ROScalarColumn< Double > time_p
A class to provide easy read-only access to MSFlagCmd columns.
const Bool True
Definition: aipstype.h:43
ROScalarQuantColumn< Double > timeQuant_p
A class to provide easy read-write access to MSFlagCmd columns.
ScalarColumn< Double > & time()
ScalarMeasColumn< MEpoch > timeMeas_p
~MSFlagCmdColumns()
The destructor does nothing special.
void attach(const MSFlagCmd &msFlagCmd)
ScalarColumn< Bool > & applied()
Read-write access to required columns.
const ROScalarColumn< Double > & interval() const
unsigned int uInt
Definition: aipstype.h:51
ScalarColumn< Double > time_p
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42