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{
75public:
76 // Create a columns object that accesses the data in the specified Table
77 MSFlagCmdColumns(const MSFlagCmd& msFlagCmd);
78
79 // The destructor does nothing special
81
82 // Access to required columns
83 // <group>
95 // </group>
96
97 // Const access to required columns
98 // <group>
99 const ScalarColumn<Bool>& applied() const {return applied_p;}
100 const ScalarColumn<String>& command() const {return command_p;}
101 const ScalarColumn<Double>& interval() const {return interval_p;}
103 const ScalarColumn<Int>& level() const {return level_p;}
104 const ScalarColumn<String>& reason() const {return reason_p;}
105 const ScalarColumn<Int>& severity() const {return severity_p;}
106 const ScalarColumn<Double>& time() const {return time_p;}
109 const ScalarColumn<String>& type() const {return type_p;}
110 // </group>
111
112 // Convenience function that returns the number of rows in any of the columns
113 rownr_t nrow() const {return applied_p.nrow();}
114
115 // set the epoch type for the FLAG_CMD column.
116 // <note role=tip>
117 // In principle this function can only be used if the table is empty,
118 // otherwise already written values may thereafter have an incorrect
119 // reference, offset, or unit. However, it is possible that part of the
120 // table gets written before these values are known. In that case the
121 // reference, offset, or units can be set by using a False
122 // <src>tableMustBeEmpty</src> argument.
123 // </note>
124 void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True);
125
126protected:
127 //# default constructor creates a object that is not usable. Use the attach
128 //# function correct this.
130
131 //# attach this object to the supplied table.
132 void attach(const MSFlagCmd& msFlagCmd);
133
134private:
135 //# Make the assignment operator and the copy constructor private to prevent
136 //# any compiler generated one from being used.
139
140 //# required columns
149
150 //# Access to Measure columns
152
153 //# Access to Quantum columns
156};
157
158//# Define the RO version for backward compatibility.
160
161} //# NAMESPACE CASACORE - END
162
163#endif
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition MEpoch.h:114
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 &)
rownr_t nrow() const
Get the number of rows in the column.
this file contains all the compiler specific defines
Definition mainpage.dox:28
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