casacore
 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 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 // MSFlagCmdColumns stands for MeasurementSet FlagCmd Table columns.
59 // </etymology>
60 //
61 // <synopsis>
62 // This class provides access to the columns in the MSFlagCmd Table, it does
63 // the declaration of all the ScalarColumns with the correct types, so the
64 // application programmer doesn't have to worry about getting those
65 // right. There is an access function for every predefined column. Access to
66 // non-predefined columns will still have to be done with explicit
67 // declarations. See <linkto class=MSColumns> MSColumns</linkto> for an
68 // 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  MSFlagCmdColumns(const MSFlagCmd& msFlagCmd);
80 
81  // The destructor does nothing special
83 
84  // Access to required columns
85  // <group>
97  // </group>
98 
99  // Const access to required columns
100  // <group>
101  const ScalarColumn<Bool>& applied() const {return applied_p;}
102  const ScalarColumn<String>& command() const {return command_p;}
103  const ScalarColumn<Double>& interval() const {return interval_p;}
105  const ScalarColumn<Int>& level() const {return level_p;}
106  const ScalarColumn<String>& reason() const {return reason_p;}
107  const ScalarColumn<Int>& severity() const {return severity_p;}
108  const ScalarColumn<Double>& time() const {return time_p;}
111  const ScalarColumn<String>& type() const {return type_p;}
112  // </group>
113 
114  // Convenience function that returns the number of rows in any of the columns
115  rownr_t nrow() const {return applied_p.nrow();}
116 
117  // set the epoch type for the FLAG_CMD column.
118  // <note role=tip>
119  // In principle this function can only be used if the table is empty,
120  // otherwise already written values may thereafter have an incorrect
121  // reference, offset, or unit. However, it is possible that part of the
122  // table gets written before these values are known. In that case the
123  // reference, offset, or units can be set by using a False
124  // <src>tableMustBeEmpty</src> argument.
125  // </note>
126  void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True);
127 
128 protected:
129  //# default constructor creates a object that is not usable. Use the attach
130  //# function correct this.
132 
133  //# attach this object to the supplied table.
134  void attach(const MSFlagCmd& msFlagCmd);
135 
136 private:
137  //# Make the assignment operator and the copy constructor private to prevent
138  //# any compiler generated one from being used.
141 
142  //# required columns
151 
152  //# Access to Measure columns
154 
155  //# Access to Quantum columns
158 };
159 
160 //# Define the RO version for backward compatibility.
162 
163 } //# NAMESPACE CASACORE - END
164 
165 #endif
MSFlagCmdColumns & operator=(const MSFlagCmdColumns &)
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
set the epoch type for the FLAG_CMD column.
rownr_t nrow() const
Convenience function that returns the number of rows in any of the columns.
void attach(const MSFlagCmd &msFlagCmd)
const ScalarColumn< String > & type() const
ScalarColumn< Double > interval_p
const ScalarColumn< Double > & interval() const
ScalarColumn< String > command_p
ScalarColumn< String > reason_p
const ScalarQuantColumn< Double > & intervalQuant() const
ScalarQuantColumn< Double > timeQuant_p
ScalarColumn< Int > level_p
ScalarColumn< Int > & level()
rownr_t nrow() const
Get the number of rows in the column.
Definition: TableColumn.h:197
MSFlagCmdColumns ROMSFlagCmdColumns
ScalarColumn< String > & reason()
ScalarQuantColumn< Double > intervalQuant_p
const ScalarQuantColumn< Double > & timeQuant() const
const ScalarColumn< String > & reason() const
const ScalarMeasColumn< MEpoch > & timeMeas() const
ScalarQuantColumn< Double > & timeQuant()
ScalarQuantColumn< Double > & intervalQuant()
ScalarColumn< String > type_p
ScalarColumn< Bool > applied_p
const ScalarColumn< String > & command() const
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
ScalarMeasColumn< MEpoch > & timeMeas()
const ScalarColumn< Int > & severity() const
ScalarColumn< String > & type()
const ScalarColumn< Double > & time() const
ScalarColumn< String > & command()
uInt64 rownr_t
Define the type of a row number in a table.
Definition: aipsxtype.h:46
ScalarColumn< Int > & severity()
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
const ScalarColumn< Int > & level() const
const ScalarColumn< Bool > & applied() const
Const access to required columns.
const Bool True
Definition: aipstype.h:43
A class to provide easy access to MSFlagCmd columns.
ScalarColumn< Double > & time()
ScalarMeasColumn< MEpoch > timeMeas_p
~MSFlagCmdColumns()
The destructor does nothing special.
ScalarColumn< Bool > & applied()
Access to required columns.
ScalarColumn< Double > time_p