casacore
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>
32 #include <casacore/measures/Measures/MEpoch.h>
33 #include <casacore/measures/Measures/MCEpoch.h>
34 #include <casacore/measures/TableMeasures/ScalarMeasColumn.h>
35 #include <casacore/measures/TableMeasures/ScalarQuantColumn.h>
36 #include <casacore/tables/Tables/ScalarColumn.h>
37 #include <casacore/casa/BasicSL/String.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  uInt 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
casacore::MSFlagCmdColumns::type_p
ScalarColumn< String > type_p
Definition: MSFlagCmdColumns.h:150
casacore::MSFlagCmdColumns::intervalQuant_p
ScalarQuantColumn< Double > intervalQuant_p
Definition: MSFlagCmdColumns.h:156
casacore::MSFlagCmdColumns
Definition: MSFlagCmdColumns.h:76
casacore::MSFlagCmdColumns::level
const ScalarColumn< Int > & level() const
Definition: MSFlagCmdColumns.h:105
casacore::MSFlagCmdColumns::type
ScalarColumn< String > & type()
Definition: MSFlagCmdColumns.h:96
casacore::MSFlagCmdColumns::applied_p
ScalarColumn< Bool > applied_p
Definition: MSFlagCmdColumns.h:143
casacore::MSFlagCmdColumns::reason
const ScalarColumn< String > & reason() const
Definition: MSFlagCmdColumns.h:106
casacore::MSFlagCmdColumns::MSFlagCmdColumns
MSFlagCmdColumns(const MSFlagCmdColumns &)
casacore::MSFlagCmdColumns::timeMeas
const ScalarMeasColumn< MEpoch > & timeMeas() const
Definition: MSFlagCmdColumns.h:110
casacore::MSFlagCmdColumns::timeQuant
const ScalarQuantColumn< Double > & timeQuant() const
Definition: MSFlagCmdColumns.h:109
casacore::MSFlagCmdColumns::timeMeas
ScalarMeasColumn< MEpoch > & timeMeas()
Definition: MSFlagCmdColumns.h:95
casacore::MSFlagCmdColumns::severity_p
ScalarColumn< Int > severity_p
Definition: MSFlagCmdColumns.h:148
casacore::MSFlagCmdColumns::interval
ScalarColumn< Double > & interval()
Definition: MSFlagCmdColumns.h:88
casacore::ScalarColumn< Bool >
casacore::MSFlagCmdColumns::nrow
uInt nrow() const
Convenience function that returns the number of rows in any of the columns.
Definition: MSFlagCmdColumns.h:115
casacore::MSFlagCmdColumns::severity
ScalarColumn< Int > & severity()
Definition: MSFlagCmdColumns.h:92
casacore::MSFlagCmdColumns::command
ScalarColumn< String > & command()
Definition: MSFlagCmdColumns.h:87
casacore::MSFlagCmdColumns::time
ScalarColumn< Double > & time()
Definition: MSFlagCmdColumns.h:93
casacore::MSFlagCmdColumns::timeMeas_p
ScalarMeasColumn< MEpoch > timeMeas_p
Definition: MSFlagCmdColumns.h:153
casacore::MEpoch::Types
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition: MEpoch.h:117
casacore::MSFlagCmdColumns::MSFlagCmdColumns
MSFlagCmdColumns()
casacore::MSFlagCmdColumns::severity
const ScalarColumn< Int > & severity() const
Definition: MSFlagCmdColumns.h:107
casacore::uInt
unsigned int uInt
Definition: aipstype.h:51
casacore::MSFlagCmdColumns::setEpochRef
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
set the epoch type for the FLAG_CMD column.
casacore::MSFlagCmdColumns::attach
void attach(const MSFlagCmd &msFlagCmd)
casacore::MSFlagCmdColumns::~MSFlagCmdColumns
~MSFlagCmdColumns()
The destructor does nothing special.
casacore::MSFlagCmdColumns::applied
ScalarColumn< Bool > & applied()
Access to required columns.
Definition: MSFlagCmdColumns.h:86
casacore::MSFlagCmdColumns::interval
const ScalarColumn< Double > & interval() const
Definition: MSFlagCmdColumns.h:103
casacore::MSFlagCmdColumns::intervalQuant
const ScalarQuantColumn< Double > & intervalQuant() const
Definition: MSFlagCmdColumns.h:104
casacore::MSFlagCmdColumns::time
const ScalarColumn< Double > & time() const
Definition: MSFlagCmdColumns.h:108
casacore::MSFlagCmdColumns::time_p
ScalarColumn< Double > time_p
Definition: MSFlagCmdColumns.h:149
casacore
this file contains all the compiler specific defines
Definition: mainpage.dox:28
casacore::MSFlagCmdColumns::reason_p
ScalarColumn< String > reason_p
Definition: MSFlagCmdColumns.h:147
casacore::MSFlagCmdColumns::interval_p
ScalarColumn< Double > interval_p
Definition: MSFlagCmdColumns.h:145
casacore::MSFlagCmdColumns::operator=
MSFlagCmdColumns & operator=(const MSFlagCmdColumns &)
casacore::MSFlagCmdColumns::type
const ScalarColumn< String > & type() const
Definition: MSFlagCmdColumns.h:111
casacore::True
const Bool True
Definition: aipstype.h:43
casacore::ROMSFlagCmdColumns
MSFlagCmdColumns ROMSFlagCmdColumns
Definition: MSFlagCmdColumns.h:161
casacore::MSFlagCmdColumns::timeQuant_p
ScalarQuantColumn< Double > timeQuant_p
Definition: MSFlagCmdColumns.h:157
casacore::MSFlagCmdColumns::applied
const ScalarColumn< Bool > & applied() const
Const access to required columns.
Definition: MSFlagCmdColumns.h:101
casacore::ScalarQuantColumn< Double >
casacore::MSFlagCmdColumns::level
ScalarColumn< Int > & level()
Definition: MSFlagCmdColumns.h:90
casacore::MSFlagCmdColumns::command_p
ScalarColumn< String > command_p
Definition: MSFlagCmdColumns.h:144
casacore::ScalarMeasColumn< MEpoch >
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::MSFlagCmd
Definition: MSFlagCmd.h:80
casacore::MSFlagCmdColumns::MSFlagCmdColumns
MSFlagCmdColumns(const MSFlagCmd &msFlagCmd)
Create a columns object that accesses the data in the specified Table.
casacore::MSFlagCmdColumns::reason
ScalarColumn< String > & reason()
Definition: MSFlagCmdColumns.h:91
casacore::MSFlagCmdColumns::timeQuant
ScalarQuantColumn< Double > & timeQuant()
Definition: MSFlagCmdColumns.h:94
casacore::MSFlagCmdColumns::level_p
ScalarColumn< Int > level_p
Definition: MSFlagCmdColumns.h:146
casacore::MSFlagCmdColumns::intervalQuant
ScalarQuantColumn< Double > & intervalQuant()
Definition: MSFlagCmdColumns.h:89
casacore::MSFlagCmdColumns::command
const ScalarColumn< String > & command() const
Definition: MSFlagCmdColumns.h:102