casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VLAObsModeFilter.h
Go to the documentation of this file.
1 //# VLAObsModeFilter.h:
2 //# Copyright (C) 2000
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 //#casapy.log-2007-11-02T20:55:50
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 NRAO_VLAOBSMODEFILTER_H
30 #define NRAO_VLAOBSMODEFILTER_H
31 
32 #include <casa/aips.h>
33 #include <nrao/VLA/VLAFilter.h>
34 #include <casa/Arrays/Vector.h>
35 
36 #include <unordered_map>
37 #include <string>
38 
39 #include <casa/namespace.h>
41 
42 // used in error reporting: mode description string and a boolean indicating whether the warning has been done
43 typedef std::pair<std::string,bool> modeDescWarn;
44 
45 // <summary>
46 // </summary>
47 
48 // <use visibility=export>
49 
50 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
51 // </reviewed>
52 
53 // <prerequisite>
54 // <li> SomeClass
55 // <li> SomeOtherClass
56 // <li> some concept
57 // </prerequisite>
58 //
59 // <etymology>
60 // </etymology>
61 //
62 // <synopsis>
63 // </synopsis>
64 //
65 // <example>
66 // </example>
67 //
68 // <motivation>
69 // </motivation>
70 //
71 // <templating arg=T>
72 // <li>
73 // <li>
74 // </templating>
75 //
76 // <thrown>
77 // <li>
78 // <li>
79 // </thrown>
80 //
81 // <todo asof="yyyy/mm/dd">
82 // <li> add this feature
83 // <li> fix this bug
84 // <li> start discussion of this possible extension
85 // </todo>
86 
88 {
89 public:
90  // The default constructor creats a filter that filters out all
91  // but standard, holography, solar, and phasing modes
93 
94  // Creates a filter that filters all records except those with
95  // user-specified observing modes
97 
98  // The copy constructor uses copy semantics.
99  VLAObsModeFilter(const VLAObsModeFilter& other);
100 
101  // The destructor is trivial
102  virtual ~VLAObsModeFilter();
103 
104  // The assignment operator uses copy semantics.
106 
107  // returns true if the supplied record has an obs mode that matches
108  // one of the obs modes specified (or implicit) in the constructor.
109  virtual casacore::Bool passThru(const VLALogicalRecord& record) const;
110 
111  // Return a pointer to a copy of the VLAObsModeFilter object upcast to a
112  // VLAFilter object. The class that uses this function is responsible for
113  // deleting the pointer. This is used to implement a virtual copy
114  // constructor.
115  virtual VLAFilter* clone() const;
116 
117  // casacore::Function which checks the internal data of this class for correct
118  // dimensionality and consistant values. Returns true if everything is fine
119  // otherwise returns false.
120  virtual casacore::Bool ok() const;
121 
122 private:
124  mutable std::unordered_map<std::string, modeDescWarn> itsUnsupportedModes;
126 
127  void setModeInternals();
128 };
129 #endif
130 
131 
casacore::Vector< casacore::String > itsSupportedModes
This class interprets a VLA logical record.
VLAObsModeFilter()
The default constructor creats a filter that filters out all but standard, holography, solar, and phasing modes.
std::pair< std::string, bool > modeDescWarn
used in error reporting: mode description string and a boolean indicating whether the warning has bee...
VLAObsModeFilter & operator=(const VLAObsModeFilter &other)
The assignment operator uses copy semantics.
void setModeInternals()
virtual ~VLAObsModeFilter()
The destructor is trivial.
virtual VLAFilter * clone() const
Return a pointer to a copy of the VLAObsModeFilter object upcast to a VLAFilter object.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
virtual casacore::Bool passThru(const VLALogicalRecord &record) const
returns true if the supplied record has an obs mode that matches one of the obs modes specified (or i...
std::unordered_map< std::string, modeDescWarn > itsUnsupportedModes
virtual casacore::Bool ok() const
casacore::Function which checks the internal data of this class for correct dimensionality and consis...
casacore::Vector< casacore::String > itsObsModes