casacore
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
casacore::MSObservationParse Class Reference

More...

#include <MSObservationParse.h>

Public Member Functions

 MSObservationParse ()
 Default constructor. More...
 
 MSObservationParse (const MeasurementSet *ms, const MSObservation &obsSubtable, const TableExprNode &colAsTEN)
 Associate the ms and the shorthand. More...
 
 ~MSObservationParse ()
 
const TableExprNodeselectRangeGTAndLT (const Int &n0, const Int &n1)
 
const TableExprNodeselectRangeGEAndLE (const Int &n0, const Int &n1)
 
const TableExprNodeselectObservationIds (const Vector< Int > &scanids)
 
const TableExprNodeselectObservationIds ()
 
const TableExprNodeselectObservationIdsGT (const Vector< Int > &scanids)
 
const TableExprNodeselectObservationIdsLT (const Vector< Int > &scanids)
 
const TableExprNodeselectObservationIdsGTEQ (const Vector< Int > &scanids)
 
const TableExprNodeselectObservationIdsLTEQ (const Vector< Int > &scanids)
 
std::vector< Int > & accumulateIDs (const Int id0, const Int id1=-1)
 
const TableExprNode node ()
 Get table expression node object. More...
 
Vector< IntselectedIDs ()
 
void reset ()
 
void cleanup ()
 
void setMaxObs (const Int &n)
 
- Public Member Functions inherited from casacore::MSParse
 MSParse ()
 Default constructor for List container class. More...
 
 MSParse (const MSParse &)
 Copy constructor (copy semantics). More...
 
 ~MSParse ()
 
MSParseoperator= (const MSParse &)
 Assignment (copy semantics). More...
 
 MSParse (const MeasurementSet *ms, const String &shorthand)
 Associate the ms and the shorthand. More...
 
 MSParse (const MSSelectableTable *ms, const String &shorthand)
 Associate the ms and the shorthand. More...
 
Bool test (const String &shortHand) const
 Test if shorthand matches. More...
 
Stringshorthand ()
 Get the shorthand. More...
 
MeasurementSetms ()
 Get ms object. More...
 
MSSelectableTablemsInterface ()
 Get ms object. More...
 
void setMS (MeasurementSet *ms)
 
void setMSInterface (MSSelectableTable *msI)
 
void addCondition (TableExprNode &target, TableExprNode &source)
 

Static Public Attributes

static MSObservationParsethisMSObsParser
 
- Static Public Attributes inherited from casacore::MSParse
static MeasurementSetms_p
 
static MSSelectableTablemsInterface_p
 

Private Member Functions

void appendToIDList (const Vector< Int > &v)
 

Private Attributes

TableExprNode node_p
 
Vector< IntidList
 
Vector< IntobsIDList_p
 
std::vector< IntparsedIDList_p
 
const String colName
 
Int maxObs_p
 

Static Private Attributes

static TableExprNode columnAsTEN_p
 

Detailed Description

Class to hold values from scan grammar parser

Intended use:

Internal

Etymology

MSObservationParse is the class used to parse a scan command.

Synopsis

MSObservationParse is used by the parser of scan sub-expression statements. The parser is written in Bison and Flex in files MSObservationGram.y and.l. The statements in there use the routines in this file to act upon a reduced rule. Since multiple tables can be given (with a shorthand), the table names are stored in a list. The variable names can be qualified by the table name and will be looked up in the appropriate table.

The class MSObservationParse only contains information about a table used in the table command. Global variables (like a list and a vector) are used in MSObservationParse.cc to hold further information.

Global functions are used to operate on the information. The main function is the global function msScanCommand. It executes the given STaQL command and returns the resulting ms. This is, in fact, the only function to be used by a user.

Motivation

It is necessary to be able to give a ms command in ASCII. This can be used in a CLI or in the table browser to get a subset of a table or to sort a table.

Definition at line 87 of file MSObservationParse.h.

Constructor & Destructor Documentation

◆ MSObservationParse() [1/2]

casacore::MSObservationParse::MSObservationParse ( )

Default constructor.

◆ MSObservationParse() [2/2]

casacore::MSObservationParse::MSObservationParse ( const MeasurementSet ms,
const MSObservation obsSubtable,
const TableExprNode colAsTEN 
)

Associate the ms and the shorthand.

◆ ~MSObservationParse()

casacore::MSObservationParse::~MSObservationParse ( )
inline

Definition at line 97 of file MSObservationParse.h.

References columnAsTEN_p.

Member Function Documentation

◆ accumulateIDs()

std::vector<Int>& casacore::MSObservationParse::accumulateIDs ( const Int  id0,
const Int  id1 = -1 
)

◆ appendToIDList()

void casacore::MSObservationParse::appendToIDList ( const Vector< Int > &  v)
private

◆ cleanup()

void casacore::MSObservationParse::cleanup ( )
inline

Definition at line 115 of file MSObservationParse.h.

◆ node()

const TableExprNode casacore::MSObservationParse::node ( )

Get table expression node object.

◆ reset()

void casacore::MSObservationParse::reset ( )
inline

Definition at line 114 of file MSObservationParse.h.

References idList, and casacore::Vector< T, Alloc >::resize().

◆ selectedIDs()

Vector<Int> casacore::MSObservationParse::selectedIDs ( )

◆ selectObservationIds() [1/2]

const TableExprNode* casacore::MSObservationParse::selectObservationIds ( )
inline

Definition at line 102 of file MSObservationParse.h.

References parsedIDList_p, and selectObservationIds().

Referenced by selectObservationIds().

◆ selectObservationIds() [2/2]

const TableExprNode* casacore::MSObservationParse::selectObservationIds ( const Vector< Int > &  scanids)

◆ selectObservationIdsGT()

const TableExprNode* casacore::MSObservationParse::selectObservationIdsGT ( const Vector< Int > &  scanids)

◆ selectObservationIdsGTEQ()

const TableExprNode* casacore::MSObservationParse::selectObservationIdsGTEQ ( const Vector< Int > &  scanids)

◆ selectObservationIdsLT()

const TableExprNode* casacore::MSObservationParse::selectObservationIdsLT ( const Vector< Int > &  scanids)

◆ selectObservationIdsLTEQ()

const TableExprNode* casacore::MSObservationParse::selectObservationIdsLTEQ ( const Vector< Int > &  scanids)

◆ selectRangeGEAndLE()

const TableExprNode* casacore::MSObservationParse::selectRangeGEAndLE ( const Int n0,
const Int n1 
)

◆ selectRangeGTAndLT()

const TableExprNode* casacore::MSObservationParse::selectRangeGTAndLT ( const Int n0,
const Int n1 
)

◆ setMaxObs()

void casacore::MSObservationParse::setMaxObs ( const Int n)
inline

Definition at line 117 of file MSObservationParse.h.

References maxObs_p.

Member Data Documentation

◆ colName

const String casacore::MSObservationParse::colName
private

Definition at line 125 of file MSObservationParse.h.

◆ columnAsTEN_p

TableExprNode casacore::MSObservationParse::columnAsTEN_p
staticprivate

Definition at line 128 of file MSObservationParse.h.

Referenced by ~MSObservationParse().

◆ idList

Vector<Int> casacore::MSObservationParse::idList
private

Definition at line 123 of file MSObservationParse.h.

Referenced by reset().

◆ maxObs_p

Int casacore::MSObservationParse::maxObs_p
private

Definition at line 127 of file MSObservationParse.h.

Referenced by setMaxObs().

◆ node_p

TableExprNode casacore::MSObservationParse::node_p
private

Definition at line 122 of file MSObservationParse.h.

◆ obsIDList_p

Vector<Int> casacore::MSObservationParse::obsIDList_p
private

Definition at line 123 of file MSObservationParse.h.

◆ parsedIDList_p

std::vector<Int> casacore::MSObservationParse::parsedIDList_p
private

Definition at line 124 of file MSObservationParse.h.

Referenced by selectObservationIds().

◆ thisMSObsParser

MSObservationParse* casacore::MSObservationParse::thisMSObsParser
static

Definition at line 119 of file MSObservationParse.h.


The documentation for this class was generated from the following file: