casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Vi2StatsFlagsIterator.h
Go to the documentation of this file.
1 // -*- mode: c++ -*-
2 //# Copyright (C) 1996,1997,1998,1999,2000,2002,2003,2015
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 // casacore::Data provider mask iterators, based on a flag column.
28 //
29 #ifndef MSVIS_STATISTICS_VI2_STATS_FLAGS_ITERATOR_H_
30 #define MSVIS_STATISTICS_VI2_STATS_FLAGS_ITERATOR_H_
31 
32 #include <casacore/casa/aips.h>
35 #include <msvis/MSVis/VisBuffer2.h>
36 #include <memory>
37 #include <iterator>
38 
39 namespace casa {
40 
41 // Vi2StatsFlagsIterator has the form of a CRTP base class to promote
42 // efficiency in iterator operations.
43 //
44 template <class T>
46  : public std::iterator<std::input_iterator_tag,casacore::Bool> {
47 
48 public:
50 
52 
53  bool operator==(const Vi2StatsFlagsIterator& rhs);
54 
55  bool operator!=(const Vi2StatsFlagsIterator& rhs);
56 
58 
59  bool atEnd();
60 
61 protected:
66 
68 
70 
72 
74 };
75 
76 template <class T>
78 
79 // Mask iterator over flag cube. If the flag cube column is not present, this
80 // iterator will provide values as if the flag cube were present by replicating
81 // flag row values in order to mimic the shape of the flag cube.
83  : public Vi2StatsFlagsIterator<Vi2StatsFlagsCubeIterator> {
84 public:
86 
88 
90 
92 
93  bool operator==(const Vi2StatsFlagsCubeIterator& rhs);
94 
95  bool operator!=(const Vi2StatsFlagsCubeIterator& rhs);
96 
98 
99  bool atEnd();
100 
101 protected:
103 
104 private:
106 };
107 
108 // Mask iterator over row flags. If the row flags column is not present, this
109 // iterator will provide values as if the row flags column were present by
110 // reducing the flag cube values to mimic the shape of the flag row column.
112  : public Vi2StatsFlagsIterator<Vi2StatsFlagsRowIterator> {
113 public:
115 
117 
119 
121 
122  bool operator==(const Vi2StatsFlagsRowIterator& rhs);
123 
124  bool operator!=(const Vi2StatsFlagsRowIterator& rhs);
125 
127 
128  bool atEnd();
129 
130 protected:
132 
133 private:
135  void prepareNextRow();
136 };
137 
138 } // namespace casa
139 
140 
141 #endif // MSVIS_STATISTICS_VI2_STATS_FLAGS_ITERATOR_H_
bool operator==(const Vi2StatsFlagsCubeIterator &rhs)
bool operator==(const Vi2StatsFlagsIterator &rhs)
Mask iterator over row flags.
Vi2StatsFlagsIterator has the form of a CRTP base class to promote efficiency in iterator operations...
static const casacore::Array< casacore::Bool > empty_array
const_iterator end() const
bool operator!=(const Vi2StatsFlagsIterator &rhs)
const_iterator begin() const
Vi2StatsFlagsRowIterator & operator++()
casacore::Array< casacore::Bool >::const_iterator end_iter
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
bool operator!=(const Vi2StatsFlagsRowIterator &rhs)
bool operator!=(const Vi2StatsFlagsCubeIterator &rhs)
casacore::Bool operator*()
Mask iterator over flag cube.
casacore::Array< casacore::Bool >::const_iterator flags_iter
VisBuffer2s encapsulate one chunk of visibility data for processing.
Definition: VisBuffer2.h:141
Vi2StatsFlagsIterator & operator++()
Vi2StatsFlagsCubeIterator & operator++()
const casacore::Array< casacore::Bool > * flags_array
bool operator==(const Vi2StatsFlagsRowIterator &rhs)
unsigned int uInt
Definition: aipstype.h:51