casacore
 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 
44 // <summary>
45 // A class to provide easy access to MSHistory columns
46 // </summary>
47 
48 // <use visibility=export>
49 
50 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
51 // </reviewed>
52 
53 // <prerequisite>
54 // <li> MSHistory
55 // <li> ArrayColumn
56 // <li> ScalarColumn
57 // </prerequisite>
58 //
59 // <etymology>
60 // MSHistoryColumns stands for MeasurementSet History Table columns.
61 // </etymology>
62 //
63 // <synopsis>
64 // This class provides access to the columns in the MSHistory Table,
65 // it does the declaration of all the Scalar and ArrayColumns with the
66 // correct types, so the application programmer doesn't have to
67 // worry about getting those right. There is an access function
68 // for every predefined column. Access to non-predefined columns will still
69 // have to be done with explicit declarations.
70 // See <linkto class=MSColumns> MSColumns</linkto> for an example.
71 //
72 // Note by GvD 28-Jan-2010:
73 // According to note 229 the OBJECTID column should contain Strings.
74 // It is, however, defined as Int. It has to be left as such, otherwise older
75 // MeasurementSets cannot be read anymore.
76 // </synopsis>
77 //
78 // <motivation>
79 // See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
80 // </motivation>
81 
83 {
84 public:
85  // Create a columns object that accesses the data in the specified Table
86  MSHistoryColumns(const MSHistory& msHistory);
87 
88  // The destructor does nothing special
90 
91  // Access to required columns
92  // <group>
104  // </group>
105 
106  // Const access to required columns
107  // <group>
109  const ArrayColumn<String>& appParams() const {return appParams_p;}
110  const ArrayColumn<String>& cliCommand() const {return cliCommand_p;}
111  const ScalarColumn<String>& message() const {return message_p;}
112  const ScalarColumn<Int>& objectId() const {return objectId_p;}
114  const ScalarColumn<String>& origin() const {return origin_p;}
115  const ScalarColumn<String>& priority() const {return priority_p;}
116  const ScalarColumn<Double>& time() const {return time_p;}
119  // </group>
120 
121  // Convenience function that returns the number of rows in any of the columns
122  rownr_t nrow() const {return application_p.nrow();}
123 
124  // set the epoch type for the TIME column.
125  // <note role=tip>
126  // In principle this function can only be used if the table is empty,
127  // otherwise already written values may thereafter have an incorrect
128  // reference, offset, or unit. However, it is possible that part of the
129  // table gets written before these values are known. In that case the
130  // reference, offset, or units can be set by using a False
131  // <src>tableMustBeEmpty</src> argument.
132  // </note>
133  void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True);
134 
135 protected:
136  //# default constructor creates a object that is not usable. Use the attach
137  //# function correct this.
139 
140  //# attach this object to the supplied table.
141  void attach(const MSHistory& msHistory);
142 
143 private:
144  //# Make the assignment operator and the copy constructor private to prevent
145  //# any compiler generated one from being used.
148 
149  //# required columns
159 
160  //# Access to Measure columns
162 
163  //# Access to Quantum columns
165 };
166 
167 //# Define the RO version for backward compatibility.
169 
170 } //# NAMESPACE CASACORE - END
171 
172 #endif
A Table intended to hold a MeasurementSet OBSERVATIONLOG table.
Definition: MSHistory.h:78
void attach(const MSHistory &msHistory)
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
set the epoch type for the TIME column.
~MSHistoryColumns()
The destructor does nothing special.
ScalarColumn< String > & origin()
ScalarMeasColumn< MEpoch > timeMeas_p
ScalarQuantColumn< Double > timeQuant_p
ArrayColumn< String > & appParams()
MSHistoryColumns ROMSHistoryColumns
ScalarColumn< String > message_p
const ScalarColumn< String > & origin() const
A class to provide easy access to MSHistory columns.
ScalarColumn< String > & application()
Access to required columns.
rownr_t nrow() const
Convenience function that returns the number of rows in any of the columns.
ScalarColumn< String > & message()
const ScalarColumn< Double > & time() const
ScalarColumn< String > application_p
const ScalarColumn< String > & priority() const
ScalarColumn< String > & priority()
ScalarColumn< Double > time_p
ScalarMeasColumn< MEpoch > & timeMeas()
const ScalarColumn< String > & application() const
Const access to required columns.
ScalarColumn< String > priority_p
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
Read and write access to an array table column with arbitrary data type.
Definition: CopyRecord.h:48
ArrayColumn< String > & cliCommand()
ScalarColumn< Int > objectId_p
const ScalarColumn< Int > & objectId() const
MSHistoryColumns & operator=(const MSHistoryColumns &)
const ArrayColumn< String > & appParams() const
const ScalarMeasColumn< MEpoch > & timeMeas() const
ScalarColumn< Int > observationId_p
const ScalarColumn< String > & message() const
uInt64 rownr_t
Define the type of a row number in a table.
Definition: aipsxtype.h:46
const ScalarColumn< Int > & observationId() const
const ScalarQuantColumn< Double > & timeQuant() const
ScalarColumn< Int > & objectId()
Access to a scalar table column with arbitrary data type.
Definition: CopyRecord.h:47
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()
const ArrayColumn< String > & cliCommand() const
const Bool True
Definition: aipstype.h:43
ArrayColumn< String > appParams_p
ScalarColumn< Int > & observationId()
ScalarColumn< String > origin_p
ScalarColumn< Double > & time()
ArrayColumn< String > cliCommand_p