casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSSelectableMainColumn.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //# MSSelectableMainColumn.h: The generic interface for tables that can be used with MSSelection
3 //# Copyright (C) 1996,1997,1998,1999,2001
4 //# Associated Universities, Inc. Washington DC, USA.
5 //#
6 //# This library is free software; you can redistribute it and/or modify it
7 //# under the terms of the GNU Library General Public License as published by
8 //# the Free Software Foundation; either version 2 of the License, or (at your
9 //# option) any later version.
10 //#
11 //# This library is distributed in the hope that it will be useful, but WITHOUT
12 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14 //# License for more details.
15 //#
16 //# You should have received a copy of the GNU Library General Public License
17 //# along with this library; if not, write to the Free Software Foundation,
18 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
19 //#
20 //# Correspondence concerning AIPS++ should be addressed as follows:
21 //# Internet email: aips2-request@nrao.edu.
22 //# Postal address: AIPS++ Project Office
23 //# National Radio Astronomy Observatory
24 //# 520 Edgemont Road
25 //# Charlottesville, VA 22903-2475 USA
26 //#
27 //#
28 //# $Id: HostInfoDarwin.h 21521 2014-12-10 08:06:42Z gervandiepen $
29 
30 #ifndef MS_MSSELECTABLEMAINCOLUMN_H
31 #define MS_MSSELECTABLEMAINCOLUMN_H
32 
33 #include <casacore/casa/aips.h>
44 namespace casacore { //# NAMESPACE CASACORE - BEGIN
45 
47  {
48  public:
49  MSSelectableMainColumn(const Table& msLikeTable) {init(msLikeTable);}
52 
53  virtual void init(const Table& msLikeTable) {table_p=&msLikeTable;}
54  const Table* table() {return table_p;}
55  virtual const ROArrayColumn<Bool>& flag() = 0;
56  virtual Bool flagRow(const Int& i) = 0;
57  virtual const ROScalarQuantColumn<Double>& exposureQuant() = 0;
58  virtual const ROScalarQuantColumn<Double>& timeQuant() = 0;
59  virtual const MeasurementSet *asMS() = 0;
60 
61  protected:
62  const Table *table_p;
63  };
64 
66  {
67  public:
69  MSMainColInterface(const Table& msAsTable): MSSelectableMainColumn(msAsTable)
70  {init(msAsTable);}
71 
72  virtual ~MSMainColInterface() {if (msCols_p) delete msCols_p;}
73 
74  virtual void init(const Table& msAsTable)
76  virtual const ROArrayColumn<Bool>& flag() {return msCols_p->flag();}
77 
78  // virtual Bool flagRow(const Int& i) {return allTrue(msCols_p->flag()(i));}
79  virtual Bool flagRow(const Int& i) {return msCols_p->flagRow()(i);}
80  virtual const ROScalarQuantColumn<Double>& exposureQuant() {return msCols_p->exposureQuant();}
81  virtual const ROScalarQuantColumn<Double>& timeQuant() {return msCols_p->timeQuant();}
82 
83  virtual const MeasurementSet *asMS(){return static_cast<const MeasurementSet *>(table());}
84  private:
87 
88  };
89 
90 } //# NAMESPACE CASACORE - END
91 
92 #endif
const ROScalarColumn< Bool > & flagRow() const
int Int
Definition: aipstype.h:50
Main interface class to a read/write table.
Definition: Table.h:153
virtual Bool flagRow(const Int &i)=0
virtual const MeasurementSet * asMS()
const ROScalarQuantColumn< Double > & exposureQuant() const
virtual const MeasurementSet * asMS()=0
virtual const ROScalarQuantColumn< Double > & exposureQuant()=0
const ROArrayColumn< Bool > & flag() const
virtual const ROScalarQuantColumn< Double > & exposureQuant()
virtual const ROScalarQuantColumn< Double > & timeQuant()
virtual void init(const Table &msLikeTable)
virtual const ROArrayColumn< Bool > & flag()
virtual const ROArrayColumn< Bool > & flag()=0
virtual Bool flagRow(const Int &i)
virtual Bool flagRow(const Int&amp; i) {return allTrue(msCols_p-&gt;flag()(i));}
MSMainColInterface(const Table &msAsTable)
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
A Table intended to hold astronomical data (a set of Measurements).
const ROScalarQuantColumn< Double > & timeQuant() const
virtual void init(const Table &msAsTable)
MSSelectableMainColumn(const Table &msLikeTable)
virtual const ROScalarQuantColumn< Double > & timeQuant()=0
A class for easy read-only access to MeasurementSet main table columns.
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42