casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
casacore::MSObservationParse Class Reference

Class to hold values from scan grammar parser. More...

#include <MSObservationParse.h>

Inheritance diagram for casacore::MSObservationParse:
casacore::MSParse

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

casacore::MSObservationParse::MSObservationParse ( )

Default constructor.

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

Associate the ms and the shorthand.

casacore::MSObservationParse::~MSObservationParse ( )
inline

Definition at line 97 of file MSObservationParse.h.

References columnAsTEN_p.

Member Function Documentation

std::vector<Int>& casacore::MSObservationParse::accumulateIDs ( const Int  id0,
const Int  id1 = -1 
)
void casacore::MSObservationParse::appendToIDList ( const Vector< Int > &  v)
private
void casacore::MSObservationParse::cleanup ( )
inline

Definition at line 115 of file MSObservationParse.h.

const TableExprNode casacore::MSObservationParse::node ( )

Get table expression node object.

void casacore::MSObservationParse::reset ( )
inline

Definition at line 114 of file MSObservationParse.h.

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

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

Definition at line 102 of file MSObservationParse.h.

References parsedIDList_p, and selectObservationIds().

Referenced by selectObservationIds().

const TableExprNode* casacore::MSObservationParse::selectObservationIdsGT ( const Vector< Int > &  scanids)
const TableExprNode* casacore::MSObservationParse::selectObservationIdsGTEQ ( const Vector< Int > &  scanids)
const TableExprNode* casacore::MSObservationParse::selectObservationIdsLT ( const Vector< Int > &  scanids)
const TableExprNode* casacore::MSObservationParse::selectObservationIdsLTEQ ( const Vector< Int > &  scanids)
const TableExprNode* casacore::MSObservationParse::selectRangeGEAndLE ( const Int n0,
const Int n1 
)
const TableExprNode* casacore::MSObservationParse::selectRangeGTAndLT ( const Int n0,
const Int n1 
)
void casacore::MSObservationParse::setMaxObs ( const Int n)
inline

Definition at line 117 of file MSObservationParse.h.

References maxObs_p.

Member Data Documentation

const String casacore::MSObservationParse::colName
private

Definition at line 125 of file MSObservationParse.h.

TableExprNode casacore::MSObservationParse::columnAsTEN_p
staticprivate

Definition at line 128 of file MSObservationParse.h.

Referenced by ~MSObservationParse().

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

Definition at line 123 of file MSObservationParse.h.

Referenced by reset().

Int casacore::MSObservationParse::maxObs_p
private

Definition at line 127 of file MSObservationParse.h.

Referenced by setMaxObs().

TableExprNode casacore::MSObservationParse::node_p
private

Definition at line 122 of file MSObservationParse.h.

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

Definition at line 123 of file MSObservationParse.h.

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

Definition at line 124 of file MSObservationParse.h.

Referenced by selectObservationIds().

MSObservationParse* casacore::MSObservationParse::thisMSObsParser
static

Definition at line 119 of file MSObservationParse.h.


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