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{
82public:
83 // Create a columns object that accesses the data in the specified Table
84 MSHistoryColumns(const MSHistory& msHistory);
85
86 // The destructor does nothing special
88
89 // Access to required columns
90 // <group>
102 // </group>
103
104 // Const access to required columns
105 // <group>
109 const ScalarColumn<String>& message() const {return message_p;}
110 const ScalarColumn<Int>& objectId() const {return objectId_p;}
112 const ScalarColumn<String>& origin() const {return origin_p;}
113 const ScalarColumn<String>& priority() const {return priority_p;}
114 const ScalarColumn<Double>& time() const {return time_p;}
117 // </group>
118
119 // Convenience function that returns the number of rows in any of the columns
120 rownr_t nrow() const {return application_p.nrow();}
121
122 // set the epoch type for the TIME column.
123 // <note role=tip>
124 // In principle this function can only be used if the table is empty,
125 // otherwise already written values may thereafter have an incorrect
126 // reference, offset, or unit. However, it is possible that part of the
127 // table gets written before these values are known. In that case the
128 // reference, offset, or units can be set by using a False
129 // <src>tableMustBeEmpty</src> argument.
130 // </note>
131 void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True);
132
133protected:
134 //# default constructor creates a object that is not usable. Use the attach
135 //# function correct this.
137
138 //# attach this object to the supplied table.
139 void attach(const MSHistory& msHistory);
140
141private:
142 //# Make the assignment operator and the copy constructor private to prevent
143 //# any compiler generated one from being used.
146
147 //# required columns
157
158 //# Access to Measure columns
160
161 //# Access to Quantum columns
163};
164
165//# Define the RO version for backward compatibility.
167
168} //# NAMESPACE CASACORE - END
169
170#endif
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition MEpoch.h:114
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()
this file contains all the compiler specific defines
Definition mainpage.dox:28
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