casacore
Loading...
Searching...
No Matches
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: 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_MSFLAGCMDCOLUMNS_H
27#define MS_MSFLAGCMDCOLUMNS_H
28
29#include <casacore/casa/aips.h>
30#include <casacore/measures/Measures/MEpoch.h>
31#include <casacore/measures/Measures/MCEpoch.h>
32#include <casacore/measures/TableMeasures/ScalarMeasColumn.h>
33#include <casacore/measures/TableMeasures/ScalarQuantColumn.h>
34#include <casacore/tables/Tables/ScalarColumn.h>
35#include <casacore/casa/BasicSL/String.h>
36
37namespace casacore { // # NAMESPACE CASACORE - BEGIN
38
39class MSFlagCmd;
40
41// <summary>
42// A class to provide easy access to MSFlagCmd columns
43// </summary>
44
45// <use visibility=export>
46
47// <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
48// </reviewed>
49
50// <prerequisite>
51// <li> MSFlagCmd
52// <li> ScalarColumn
53// </prerequisite>
54//
55// <etymology>
56// MSFlagCmdColumns stands for MeasurementSet FlagCmd Table columns.
57// </etymology>
58//
59// <synopsis>
60// This class provides access to the columns in the MSFlagCmd Table, it does
61// the declaration of all the ScalarColumns with the correct types, so the
62// application programmer doesn't have to worry about getting those
63// right. There is an access function for every predefined column. Access to
64// non-predefined columns will still have to be done with explicit
65// declarations. See <linkto class=MSColumns> MSColumns</linkto> for an
66// example.
67// </synopsis>
68//
69// <motivation>
70// See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
71// </motivation>
72
74 public:
75 // Create a columns object that accesses the data in the specified Table
76 MSFlagCmdColumns(const MSFlagCmd& msFlagCmd);
77
78 // The destructor does nothing special
80
81 // Access to required columns
82 // <group>
94 // </group>
95
96 // Const access to required columns
97 // <group>
98 const ScalarColumn<Bool>& applied() const { return applied_p; }
99 const ScalarColumn<String>& command() const { return command_p; }
100 const ScalarColumn<Double>& interval() const { return interval_p; }
102 const ScalarColumn<Int>& level() const { return level_p; }
103 const ScalarColumn<String>& reason() const { return reason_p; }
104 const ScalarColumn<Int>& severity() const { return severity_p; }
105 const ScalarColumn<Double>& time() const { return time_p; }
108 const ScalarColumn<String>& type() const { return type_p; }
109 // </group>
110
111 // Convenience function that returns the number of rows in any of the columns
112 rownr_t nrow() const { return applied_p.nrow(); }
113
114 // set the epoch type for the FLAG_CMD column.
115 // <note role=tip>
116 // In principle this function can only be used if the table is empty,
117 // otherwise already written values may thereafter have an incorrect
118 // reference, offset, or unit. However, it is possible that part of the
119 // table gets written before these values are known. In that case the
120 // reference, offset, or units can be set by using a False
121 // <src>tableMustBeEmpty</src> argument.
122 // </note>
123 void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty = True);
124
125 protected:
126 // # default constructor creates a object that is not usable. Use the attach
127 // # function correct this.
129
130 // # attach this object to the supplied table.
131 void attach(const MSFlagCmd& msFlagCmd);
132
133 private:
134 // # Make the assignment operator and the copy constructor private to prevent
135 // # any compiler generated one from being used.
138
139 // # required columns
148
149 // # Access to Measure columns
151
152 // # Access to Quantum columns
155};
156
157// # Define the RO version for backward compatibility.
159
160} // namespace casacore
161
162#endif
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition MEpoch.h:116
ScalarColumn< String > & command()
const ScalarColumn< String > & command() const
~MSFlagCmdColumns()
The destructor does nothing special.
ScalarColumn< Int > level_p
ScalarColumn< Int > & level()
ScalarColumn< String > & reason()
ScalarQuantColumn< Double > & intervalQuant()
ScalarColumn< String > type_p
const ScalarMeasColumn< MEpoch > & timeMeas() const
const ScalarColumn< String > & reason() const
const ScalarColumn< Int > & level() const
ScalarColumn< Bool > & applied()
Access to required columns.
const ScalarColumn< String > & type() const
ScalarColumn< String > & type()
ScalarColumn< Double > & time()
const ScalarColumn< Int > & severity() const
ScalarMeasColumn< MEpoch > & timeMeas()
const ScalarQuantColumn< Double > & timeQuant() const
void attach(const MSFlagCmd &msFlagCmd)
const ScalarColumn< Double > & interval() const
ScalarColumn< Double > interval_p
ScalarColumn< Bool > applied_p
const ScalarColumn< Double > & time() const
ScalarColumn< Double > time_p
ScalarQuantColumn< Double > intervalQuant_p
ScalarQuantColumn< Double > timeQuant_p
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
set the epoch type for the FLAG_CMD column.
ScalarQuantColumn< Double > & timeQuant()
const ScalarColumn< Bool > & applied() const
Const access to required columns.
const ScalarQuantColumn< Double > & intervalQuant() const
ScalarColumn< String > reason_p
ScalarColumn< Int > severity_p
ScalarColumn< Double > & interval()
ScalarMeasColumn< MEpoch > timeMeas_p
MSFlagCmdColumns(const MSFlagCmd &msFlagCmd)
Create a columns object that accesses the data in the specified Table.
ScalarColumn< String > command_p
MSFlagCmdColumns & operator=(const MSFlagCmdColumns &)
rownr_t nrow() const
Convenience function that returns the number of rows in any of the columns.
ScalarColumn< Int > & severity()
MSFlagCmdColumns(const MSFlagCmdColumns &)
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
const RecordRep & ref() const
Return a const reference to the underlying RecordRep.
MSFlagCmdColumns ROMSFlagCmdColumns
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
const Bool True
Definition aipstype.h:41
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44