casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSHistoryColumns.h
Go to the documentation of this file.
1 //# MSHistoryColumns.h: provides easy access to MSHistory columns
2 //# Copyright (C) 1996,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_MSHISTORYCOLUMNS_H
29 #define MS_MSHISTORYCOLUMNS_H
30 
31 #include <casacore/casa/aips.h>
39 
40 namespace casacore { //# NAMESPACE CASACORE - BEGIN
41 
42 class MSHistory;
43 // <summary>
44 // A class to provide easy read-only access to MSHistory 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> MSHistory
54 // <li> ArrayColumn
55 // <li> ScalarColumn
56 // </prerequisite>
57 //
58 // <etymology>
59 // ROMSHistoryColumns stands for Read-Only MeasurementSet History Table columns.
60 // </etymology>
61 //
62 // <synopsis>
63 // This class provides read-only access to the columns in the MSHistory
64 // Table. It does the declaration of all the Scalar and ArrayColumns with the
65 // correct types, so the application programmer doesn't have to worry about
66 // getting those right. There is an access function for every predefined
67 // column. Access to non-predefined columns will still have to be done with
68 // explicit declarations. See <linkto class=ROMSColumns>
69 // ROMSColumns</linkto> for an example.
70 // </synopsis>
71 //
72 // <motivation>
73 // See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
74 // </motivation>
75 
77 {
78 public:
79  // Create a columns object that accesses the data in the specified Table
80  ROMSHistoryColumns(const MSHistory& msHistory);
81 
82  // The destructor does nothing special
84 
85  // Access to required columns
86  // <group>
87  const ROScalarColumn<String>& application() const {return application_p;}
88  const ROArrayColumn<String>& appParams() const {return appParams_p;}
89  const ROArrayColumn<String>& cliCommand() const {return cliCommand_p;}
90  const ROScalarColumn<String>& message() const {return message_p;}
91  const ROScalarColumn<Int>& objectId() const {return objectId_p;}
92  const ROScalarColumn<Int>& observationId() const {return observationId_p;}
93  const ROScalarColumn<String>& origin() const {return origin_p;}
94  const ROScalarColumn<String>& priority() const {return priority_p;}
95  const ROScalarColumn<Double>& time() const {return time_p;}
96  const ROScalarQuantColumn<Double>& timeQuant() const {return timeQuant_p;}
97  const ROScalarMeasColumn<MEpoch>& timeMeas() const {return timeMeas_p;}
98  // </group>
99 
100  // Convenience function that returns the number of rows in any of the columns
101  uInt nrow() const {return application_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 MSHistory& msHistory);
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<String> application_p;
119  ROArrayColumn<String> appParams_p;
120  ROArrayColumn<String> cliCommand_p;
121  ROScalarColumn<String> message_p;
122  ROScalarColumn<Int> objectId_p;
123  ROScalarColumn<Int> observationId_p;
124  ROScalarColumn<String> origin_p;
125  ROScalarColumn<String> priority_p;
126  ROScalarColumn<Double> time_p;
127 
128  //# Access to Measure columns
129  ROScalarMeasColumn<MEpoch> timeMeas_p;
130 
131  //# Access to Quantum columns
132  ROScalarQuantColumn<Double> timeQuant_p;
133 };
134 
135 // <summary>
136 // A class to provide easy read-write access to MSHistory 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> MSHistory
146 // <li> ArrayColumn
147 // <li> ScalarColumn
148 // </prerequisite>
149 //
150 // <etymology>
151 // MSHistoryColumns stands for MeasurementSet History Table columns.
152 // </etymology>
153 //
154 // <synopsis>
155 // This class provides access to the columns in the MSHistory Table,
156 // it does the declaration of all the Scalar and ArrayColumns with the
157 // correct types, so the application programmer doesn't have to
158 // worry about getting those right. There is an access function
159 // for every predefined column. Access to non-predefined columns will still
160 // have to be done with explicit declarations.
161 // See <linkto class=MSColumns> MSColumns</linkto> for an example.
162 //
163 // Note by GvD 28-Jan-2010:
164 // According to note 229 the OBJECTID column should contain Strings.
165 // It is, however, defined as Int. It has to be left as such, otherwise older
166 // MeasurementSets cannot be read anymore.
167 // </synopsis>
168 //
169 // <motivation>
170 // See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
171 // </motivation>
172 
174 {
175 public:
176  // Create a columns object that accesses the data in the specified Table
177  MSHistoryColumns(MSHistory& msHistory);
178 
179  // The destructor does nothing special
181 
182  // Read-write access to required columns
183  // <group>
195  // </group>
196 
197  // Read-only access to required columns
198  // <group>
199  const ROScalarColumn<String>& application() const {
201  const ROArrayColumn<String>& appParams() const {
203  const ROArrayColumn<String>& cliCommand() const {
205  const ROScalarColumn<String>& message() const {
206  return ROMSHistoryColumns::message();}
207  const ROScalarColumn<Int>& objectId() const {
209  const ROScalarColumn<Int>& observationId() const {
211  const ROScalarColumn<String>& origin() const {
212  return ROMSHistoryColumns::origin();}
213  const ROScalarColumn<String>& priority() const {
215  const ROScalarColumn<Double>& time() const {
216  return ROMSHistoryColumns::time();}
217  const ROScalarQuantColumn<Double>& timeQuant() const {
219  const ROScalarMeasColumn<MEpoch>& timeMeas() const {
221  // </group>
222 
223  // set the epoch type for the TIME column.
224  // <note role=tip>
225  // In principle this function can only be used if the table is empty,
226  // otherwise already written values may thereafter have an incorrect
227  // reference, offset, or unit. However, it is possible that part of the
228  // table gets written before these values are known. In that case the
229  // reference, offset, or units can be set by using a False
230  // <src>tableMustBeEmpty</src> argument.
231  // </note>
232  void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True);
233 
234 protected:
235  //# default constructor creates a object that is not usable. Use the attach
236  //# function correct this.
238 
239  //# attach this object to the supplied table.
240  void attach(MSHistory& msHistory);
241 
242 private:
243  //# Make the assignment operator and the copy constructor private to prevent
244  //# any compiler generated one from being used.
247 
248  //# required columns
258 
259  //# Access to Measure columns
261 
262  //# Access to Quantum columns
264 };
265 
266 } //# NAMESPACE CASACORE - END
267 
268 #endif
A Table intended to hold a MeasurementSet OBSERVATIONLOG table.
Definition: MSHistory.h:78
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
set the epoch type for the TIME column.
const ROScalarColumn< String > & application() const
Read-only access to required columns.
const ROScalarColumn< Int > & objectId() const
~MSHistoryColumns()
The destructor does nothing special.
ScalarColumn< String > & origin()
ScalarMeasColumn< MEpoch > timeMeas_p
ScalarQuantColumn< Double > timeQuant_p
ROArrayColumn< String > appParams_p
ROScalarColumn< Int > observationId_p
ROScalarColumn< String > application_p
ArrayColumn< String > & appParams()
const ROScalarQuantColumn< Double > & timeQuant() const
ROScalarMeasColumn< MEpoch > timeMeas_p
const ROScalarColumn< Int > & observationId() const
ScalarColumn< String > message_p
const ROScalarMeasColumn< MEpoch > & timeMeas() const
A class to provide easy read-write access to MSHistory columns.
const ROScalarColumn< Double > & time() const
ScalarColumn< String > & application()
Read-write access to required columns.
ROScalarColumn< Double > time_p
ROMSHistoryColumns & operator=(const ROMSHistoryColumns &)
ROScalarQuantColumn< Double > timeQuant_p
ScalarColumn< String > & message()
const ROScalarColumn< String > & origin() const
const ROScalarColumn< String > & message() const
const ROScalarMeasColumn< MEpoch > & timeMeas() const
uInt nrow() const
Convenience function that returns the number of rows in any of the columns.
const ROScalarColumn< String > & priority() const
ScalarColumn< String > application_p
ScalarColumn< String > & priority()
ScalarColumn< Double > time_p
ScalarMeasColumn< MEpoch > & timeMeas()
A class to provide easy read-only access to MSHistory columns.
void attach(const MSHistory &msHistory)
void attach(MSHistory &msHistory)
ScalarColumn< String > priority_p
const ROArrayColumn< String > & cliCommand() const
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
ROScalarColumn< String > priority_p
Read and write access to an array table column with arbitrary data type.
Definition: Reweighter.h:48
const ROScalarQuantColumn< Double > & timeQuant() const
ArrayColumn< String > & cliCommand()
ScalarColumn< Int > objectId_p
const ROArrayColumn< String > & appParams() const
const ROScalarColumn< Int > & observationId() const
MSHistoryColumns & operator=(const MSHistoryColumns &)
ScalarColumn< Int > observationId_p
ROScalarColumn< String > message_p
~ROMSHistoryColumns()
The destructor does nothing special.
const ROScalarColumn< Double > & time() const
const ROScalarColumn< String > & origin() const
const ROScalarColumn< String > & message() const
ScalarColumn< Int > & objectId()
const ROArrayColumn< String > & cliCommand() const
Access to a scalar table column with arbitrary data type.
Definition: MSFitsOutput.h:41
const ROScalarColumn< String > & priority() const
const ROArrayColumn< String > & appParams() const
const ROScalarColumn< String > & application() const
Access to required columns.
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition: MEpoch.h:117
ScalarQuantColumn< Double > & timeQuant()
ROScalarColumn< String > origin_p
ROArrayColumn< String > cliCommand_p
const Bool True
Definition: aipstype.h:43
ArrayColumn< String > appParams_p
ScalarColumn< Int > & observationId()
ROScalarColumn< Int > objectId_p
unsigned int uInt
Definition: aipstype.h:51
ScalarColumn< String > origin_p
ScalarColumn< Double > & time()
const ROScalarColumn< Int > & objectId() const
ArrayColumn< String > cliCommand_p
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42