casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSStateIndex.h
Go to the documentation of this file.
1 //# MSStateIndex: index or lookup in a MeasurementSet FIELD subtable
2 //# Copyright (C) 2000,2001
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: aips2-request@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 //#
27 //# $Id$
28 
29 #ifndef MS_MSSTATEINDEX_H
30 #define MS_MSSTATEINDEX_H
31 
32 //# includes
33 #include <casacore/casa/aips.h>
39 
40 namespace casacore { //# NAMESPACE CASACORE - BEGIN
41 
42 //# forward declarations
43 
44 // <summary>
45 // Class to handle lookup or indexing into a MS FIELD subtable
46 // </summary>
47 
48 // <use visibility=export>
49 //
50 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
51 // </reviewed>
52 
53 // <prerequisite>
54 // <li> MeasurementSet
55 // <li> MSState
56 // </prerequisite>
57 //
58 // <etymology>
59 // From "MeasurementSet", "FIELD subtable" and "index".
60 // </etymology>
61 //
62 // <synopsis>
63 // This class provides lookup and indexing into an MS FIELD
64 // subtable. These services include returning rows numbers
65 // (which for the FIELD subtable are FIELD_ID's) associated
66 // with specific data in the subtable.
67 // </synopsis>
68 //
69 // <example>
70 // </example>
71 //
72 // <motivation>
73 // Collect together all subtable indexing and lookup for the
74 // FIELD subtable, for encapsulation and efficiency.
75 // </motivation>
76 //
77 // <thrown>
78 // <li>
79 // <li>
80 // </thrown>
81 //
82 
84 {
85 public:
86  // Construct from an MS FIELD subtable
87  MSStateIndex(const MSState &state);
88 
89  // Null destructor
90  virtual ~MSStateIndex() {}
91 
94 
95  //ADD for file name wildcard selection
98 
99  // Look up FIELD_ID's for a given pattern/regex for source name/code
101  const Bool regex=False);
103  const Bool regex=False);
104  // Look up FIELD_ID's for a given source id
105  Vector<Int> matchStateId(const Int& sourceId);
106  Vector<Int> matchStateId(const Vector<Int>& sourceIds);
107 
109 
110  Vector<Int> matchStateIDLT(const Int n);
111  Vector<Int> matchStateIDGT(const Int n);
112  Vector<Int> matchStateIDGTAndLT(const Int n0, const int n1);
113 private:
114  // Disallow null constructor
115  MSStateIndex();
116 
117  // FIELD subtable column accessor
119 
120  // Vector cache of field id's
123  Int matchAnyRegex(const Vector<String>& strList, const Regex& regex, const Int pos=0);
124 };
125 
126 
127 } //# NAMESPACE CASACORE - END
128 
129 #endif
130 
int Int
Definition: aipstype.h:50
Vector< Int > matchStateObsModeRegexOrPattern(const String &pattern, const Bool regex=False)
Vector< Int > matchStateIntent(const String &name)
Vector< Int > matchStateObsMode(const String &name)
ADD for file name wildcard selection.
Vector< Int > matchStateIDGTAndLT(const Int n0, const int n1)
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
Vector< Int > matchStateIDLT(const Int n)
Vector< Int > matchStateIDGT(const Int n)
A class to provide easy read-only access to MSState columns.
TableExprNode pattern(const TableExprNode &node)
Definition: ExprNode.h:1444
Int matchAnyRegex(const Vector< String > &strList, const Regex &regex, const Int pos=0)
Vector< Int > matchStateId(const Int &sourceId)
Look up FIELD_ID&#39;s for a given source id.
ROMSStateColumns msStateCols_p
FIELD subtable column accessor.
Definition: MSStateIndex.h:118
A Table intended to hold a MeasurementSet STATE table.
Definition: MSState.h:79
Regular expression class.
Definition: Regex.h:198
Vector< Int > maskStateIDs(const Vector< Int > &ids)
Vector< Int > stateIds_p
Vector cache of field id&#39;s.
Definition: MSStateIndex.h:121
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
Class to handle lookup or indexing into a MS FIELD subtable.
Definition: MSStateIndex.h:83
const Bool False
Definition: aipstype.h:44
MSStateIndex()
Disallow null constructor.
TableExprNode regex(const TableExprNode &node)
Functions for regular expression matching and pattern matching.
Definition: ExprNode.h:1440
virtual ~MSStateIndex()
Null destructor.
Definition: MSStateIndex.h:90
String: the storage and methods of handling collections of characters.
Definition: String.h:223
Vector< Int > matchStateRegexOrPattern(const String &pattern, const Bool regex=False)
Look up FIELD_ID&#39;s for a given pattern/regex for source name/code.
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42