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