Loading...
Searching...
No Matches
MSSelectableMainColumn.h
Go to the documentation of this file.
// -*- C++ -*-
//# MSSelectableMainColumn.h: The generic interface for tables that can be used with MSSelection
//# Copyright (C) 1996,1997,1998,1999,2001
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: casa-feedback@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
#ifndef MS_MSSELECTABLEMAINCOLUMN_H
#define MS_MSSELECTABLEMAINCOLUMN_H
#include <casacore/casa/aips.h>
#include <casacore/casa/BasicSL/String.h>
#include <casacore/casa/Arrays/Vector.h>
#include <casacore/casa/Arrays/Matrix.h>
#include <casacore/casa/Arrays/Cube.h>
#include <casacore/tables/TaQL/ExprNode.h>
#include <casacore/ms/MeasurementSets/MeasurementSet.h>
#include <casacore/ms/MeasurementSets/MSMainEnums.h>
#include <casacore/ms/MSSel/MSSelectionError.h>
#include <casacore/ms/MSSel/MSSelectableTable.h>
#include <casacore/ms/MeasurementSets/MSMainColumns.h>
namespace casacore { //# NAMESPACE CASACORE - BEGIN
class MSSelectableMainColumn
{
public:
MSSelectableMainColumn(const Table& msLikeTable) {init(msLikeTable);}
MSSelectableMainColumn() {table_p=NULL;}
virtual ~MSSelectableMainColumn() {}
virtual void init(const Table& msLikeTable) {table_p=&msLikeTable;}
const Table* table() {return table_p;}
virtual const ArrayColumn<Bool>& flag() = 0;
virtual Bool flagRow(rownr_t i) = 0;
virtual const ScalarQuantColumn<Double>& exposureQuant() = 0;
virtual const ScalarQuantColumn<Double>& timeQuant() = 0;
virtual const MeasurementSet *asMS() = 0;
protected:
const Table *table_p;
};
class MSMainColInterface: public MSSelectableMainColumn
{
public:
MSMainColInterface():MSSelectableMainColumn(), msCols_p(NULL) {}
MSMainColInterface(const Table& msAsTable): MSSelectableMainColumn(msAsTable)
{init(msAsTable);}
virtual ~MSMainColInterface() {if (msCols_p) delete msCols_p;}
virtual void init(const Table& msAsTable)
{MSSelectableMainColumn::init(msAsTable);ms_p = MeasurementSet(msAsTable); msCols_p=new MSMainColumns(ms_p);}
virtual const ArrayColumn<Bool>& flag() {return msCols_p->flag();}
// virtual Bool flagRow(const Int& i) {return allTrue(msCols_p->flag()(i));}
virtual Bool flagRow(rownr_t i) {return msCols_p->flagRow()(i);}
virtual const ScalarQuantColumn<Double>& exposureQuant() {return msCols_p->exposureQuant();}
virtual const ScalarQuantColumn<Double>& timeQuant() {return msCols_p->timeQuant();}
virtual const MeasurementSet *asMS(){return static_cast<const MeasurementSet *>(table());}
private:
MeasurementSet ms_p;
MSMainColumns *msCols_p;
};
} //# NAMESPACE CASACORE - END
#endif
casacore::ArrayColumn
Definition ArrayColumn.h:98
casacore::MSMainColInterface::MSMainColInterface
MSMainColInterface()
Definition MSSelectableMainColumn.h:65
casacore::MSMainColInterface::init
virtual void init(const Table &msAsTable)
Definition MSSelectableMainColumn.h:71
casacore::MSMainColInterface::ms_p
MeasurementSet ms_p
Definition MSSelectableMainColumn.h:82
casacore::MSMainColInterface::flagRow
virtual Bool flagRow(rownr_t i)
virtual Bool flagRow(const Int& i) {return allTrue(msCols_p->flag()(i));}
Definition MSSelectableMainColumn.h:76
casacore::MSMainColInterface::~MSMainColInterface
virtual ~MSMainColInterface()
Definition MSSelectableMainColumn.h:69
casacore::MSMainColInterface::exposureQuant
virtual const ScalarQuantColumn< Double > & exposureQuant()
Definition MSSelectableMainColumn.h:77
casacore::MSMainColInterface::MSMainColInterface
MSMainColInterface(const Table &msAsTable)
Definition MSSelectableMainColumn.h:66
casacore::MSMainColInterface::flag
virtual const ArrayColumn< Bool > & flag()
Definition MSSelectableMainColumn.h:73
casacore::MSMainColInterface::timeQuant
virtual const ScalarQuantColumn< Double > & timeQuant()
Definition MSSelectableMainColumn.h:78
casacore::MSMainColInterface::asMS
virtual const MeasurementSet * asMS()
Definition MSSelectableMainColumn.h:80
casacore::MSMainColInterface::msCols_p
MSMainColumns * msCols_p
Definition MSSelectableMainColumn.h:83
casacore::MSMainColumns
Definition MSMainColumns.h:104
casacore::MSSelectableMainColumn::~MSSelectableMainColumn
virtual ~MSSelectableMainColumn()
Definition MSSelectableMainColumn.h:48
casacore::MSSelectableMainColumn::MSSelectableMainColumn
MSSelectableMainColumn(const Table &msLikeTable)
Definition MSSelectableMainColumn.h:46
casacore::MSSelectableMainColumn::table
const Table * table()
Definition MSSelectableMainColumn.h:51
casacore::MSSelectableMainColumn::flag
virtual const ArrayColumn< Bool > & flag()=0
casacore::MSSelectableMainColumn::flagRow
virtual Bool flagRow(rownr_t i)=0
casacore::MSSelectableMainColumn::init
virtual void init(const Table &msLikeTable)
Definition MSSelectableMainColumn.h:50
casacore::MSSelectableMainColumn::exposureQuant
virtual const ScalarQuantColumn< Double > & exposureQuant()=0
casacore::MSSelectableMainColumn::timeQuant
virtual const ScalarQuantColumn< Double > & timeQuant()=0
casacore::MSSelectableMainColumn::table_p
const Table * table_p
Definition MSSelectableMainColumn.h:59
casacore::MSSelectableMainColumn::MSSelectableMainColumn
MSSelectableMainColumn()
Definition MSSelectableMainColumn.h:47
casacore::MSSelectableMainColumn::asMS
virtual const MeasurementSet * asMS()=0
casacore::MeasurementSet
Definition MeasurementSet.h:278
casacore::ScalarQuantColumn
Definition ScalarQuantColumn.h:118
casacore::Table
Definition Table.h:157
casacore
this file contains all the compiler specific defines
Definition mainpage.dox:28
casacore::init
void init()
Other internal helper function(s).
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
casacore::rownr_t
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44