casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GroupWorker.h
Go to the documentation of this file.
1 //# GroupWorker.h: Base classes for objects that process VisBuffGroups
2 //# as fed to them by GroupProcessor.
3 //# Copyright (C) 2011
4 //# Associated Universities, Inc. Washington DC, USA.
5 //#
6 //# This library is free software; you can redistribute it and/or modify it
7 //# under the terms of the GNU Library General Public License as published by
8 //# the Free Software Foundation; either version 2 of the License, or (at your
9 //# option) any later version.
10 //#
11 //# This library is distributed in the hope that it will be useful, but WITHOUT
12 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14 //# License for more details.
15 //#
16 //# You should have received a copy of the GNU Library General Public License
17 //# along with this library; if not, write to the Free Software Foundation,
18 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
19 //#
20 //# Correspondence concerning AIPS++ should be addressed as follows:
21 //# Internet email: aips2-request@nrao.edu.
22 //# Postal address: AIPS++ Project Office
23 //# National Radio Astronomy Observatory
24 //# 520 Edgemont Road
25 //# Charlottesville, VA 22903-2475 USA
26 //#
27 
28 #ifndef MSVIS_GROUPWORKER_H
29 #define MSVIS_GROUPWORKER_H
30 
31 #include <casa/aips.h>
36 #include <msvis/MSVis/VBRemapper.h>
37 
38 namespace casa { //# NAMESPACE CASA - BEGIN
39 
40 //# forward decl
41 class VisBuffGroup;
42 
43 //<summary>Abstract base class for GroupWorkers</summary>
44 //
45 // <use visibility=export>
46 //
47 // <reviewed reviewer="" date="" tests="" demos="">
48 
49 // <prerequisite>
50 // <li> <linkto class="VisBuffGroup">VisBuffGroup</linkto>
51 // <li> <linkto class="GroupProcessor">GroupProcessor</linkto>
52 // </prerequisite>
53 //
54 // <etymology>
55 // A GroupWorker works on VisBuffGroups.
56 // </etymology>
57 //
58 //<synopsis>
59 // This class cannot be directly used, but it defines an interface so that its
60 // derived classes may be called by
61 // <linkto class="GroupProcessor">GroupProcessor</linkto>.
62 //
63 // The interface used by GroupProcessor is process(VisBuffGroup&), which
64 // derived classes would define to use or process the given VisBuffGroup.
65 // Any information that process(VisBuffGroup&) needs which is not included
66 // in the VisBuffGroup must be given to the derived class before c'ting the
67 // GroupProcessor.
68 //</synopsis>
69 //
70 //<todo>
71 // <li>
72 //</todo>
74 {
75 public:
76  // Create empty GroupWorkerBase you can assign to or attach.
78 
80  //GroupWorkerBase(const GroupWorkerBase& other) {}
81 
82  // Destructor
83  virtual ~GroupWorkerBase() {}
84 
86  //virtual GroupWorkerBase& operator=(const GroupWorkerBase& gw) {}
87 
88  // // Returns which columns need to be prefetched for process to work.
89  virtual const asyncio::PrefetchColumns *prefetchColumns() const;
90 
91  // This is where all the work gets done!
92  virtual casacore::Bool process(VisBuffGroup& vbg) = 0;
93 
94 protected:
96 };
97 
98 //<summary>ROGroupWorkers process VisBuffGroups without modifying the input casacore::MS(es)</summary>
99 //
100 // <use visibility=export>
101 //
102 // <reviewed reviewer="" date="" tests="" demos="">
103 
104 // <prerequisite>
105 // <li> <linkto class="VisBuffGroup">VisBuffGroup</linkto>
106 // <li> <linkto class="GroupProcessor">GroupProcessor</linkto>
107 // </prerequisite>
108 //
109 // <etymology>
110 // ROGroupWorker works on VisBuffGroups and is readonly W.R.T. the input casacore::MS(es).
111 // </etymology>
112 //
113 //<synopsis>
114 // This class cannot be directly used, but it defines an interface so that its
115 // derived classes may be called by
116 // <linkto class="GroupProcessor">GroupProcessor</linkto>.
117 //
118 // Essentially an alias for GroupWorkerBase, since it is also RO.
119 //</synopsis>
120 //
121 //<todo>
122 // <li>
123 //</todo>
125 {
126 };
127 
128 //<summary>A base class for GroupWorkers that can modify their input MS.</summary>
129 //
130 // <use visibility=export>
131 //
132 // <reviewed reviewer="" date="" tests="" demos="">
133 
134 // <prerequisite>
135 // <li> <linkto class="ROGroupWorker">ROGroupWorker</linkto>
136 // </prerequisite>
137 //
138 // <etymology>
139 // Its derived classes work on VisBuffGroups.
140 // </etymology>
141 //
142 //<synopsis>
143 // This class cannot be directly used, but it provides a starting point for
144 // derived GroupWorkers.
145 //</synopsis>
146 //
147 //<todo>
148 // <li>
149 //</todo>
151 {
152 public:
153  GroupWorker(const ROVisibilityIterator& invi);
154 
156  //GroupWorker(const GroupWorker& gw) {}
157 
158  // Destructor
159  virtual ~GroupWorker() {}
160 
162  //virtual GroupWorker& operator=(const GroupWorker& gw) {}
163 protected:
166 private:
167  // Disable default c'tor.
169 };
170 
171 //<summary>A base class for ROGroupWorkers that write to a new MS.</summary>
172 //
173 // <use visibility=export>
174 //
175 // <reviewed reviewer="" date="" tests="" demos="">
176 
177 // <prerequisite>
178 // <li> <linkto class="ROGroupWorker">ROGroupWorker</linkto>
179 // </prerequisite>
180 //
181 // <etymology>
182 // Its derived classes are ROGroupWorkers that write to a new MS.
183 // </etymology>
184 //
185 //<synopsis>
186 // This class cannot be directly used, but it provides a starting point for
187 // derived ROGroupWorkers that write to a new MS.
188 //</synopsis>
189 //
190 //<todo>
191 // <li>
192 //</todo>
194 {
195 public:
197  const VBRemapper& remapper);
198 
199  //GroupWriteToNewMS(GroupWriteToNewMS& other);
200  virtual ~GroupWriteToNewMS() {}
201 
202  // Writes vb to outms/msc, and returns the number of rows in outms afterwards.
203  // vb's ID columns may be remapped by remapper.
204  // rowsdone: How many rows have been done so far.
205  // doFC: do FLAG_CATEGORY?
206  // doFloat: do FLOAT_DATA?
207  // doSpWeight: do WEIGHT_SPECTRUM?
209  casacore::uInt rowsdone, const VBRemapper& remapper, const casacore::Bool doFC,
210  const casacore::Bool doFloat, const casacore::Bool doSpWeight);
211 protected:
215  casacore::uInt rowsdone_p; // how many rows have been written.
216 
217 private:
218  // Disable default construction.
220 };
221 
222 } //# NAMESPACE CASA - END
223 
224 #endif
225 
GroupWorker()
Disable default c&#39;tor.
Definition: GroupWorker.h:168
Destructor *virtual ~GroupWorkerBase()
Definition: GroupWorker.h:83
VBRemappers remap VisBuffers.
Definition: VBRemapper.h:67
ROGroupWorkers process VisBuffGroups without modifying the input casacore::MS(es) ...
Definition: GroupWorker.h:124
GroupWriteToNewMS()
Disable default construction.
casacore::MeasurementSet outms_p
Definition: GroupWorker.h:212
A class to store a group of VisBuffers.
Definition: VisBuffGroup.h:83
A base class for GroupWorkers that can modify their input MS.
Definition: GroupWorker.h:150
The PrefetchColumns class is used to specify a set of columns that can be prefetched when the (RO)Vis...
virtual casacore::Bool process(VisBuffGroup &vbg)=0
This is where all the work gets done!
Destructor *virtual ~GroupWorker()
Definition: GroupWorker.h:159
VisibilityIterator outvi_p
Definition: GroupWorker.h:165
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
asyncio::PrefetchColumns prefetchColumns_p
Definition: GroupWorker.h:95
casacore::MSColumns * msc_p
Definition: GroupWorker.h:213
A Table intended to hold astronomical data (a set of Measurements).
static casacore::uInt write(casacore::MeasurementSet &outms, casacore::MSColumns *msc, VisBuffer &vb, casacore::uInt rowsdone, const VBRemapper &remapper, const casacore::Bool doFC, const casacore::Bool doFloat, const casacore::Bool doSpWeight)
Writes vb to outms/msc, and returns the number of rows in outms afterwards.
Abstract base class for GroupWorkers.
Definition: GroupWorker.h:73
A base class for ROGroupWorkers that write to a new MS.
Definition: GroupWorker.h:193
A class to provide easy read-write access to MeasurementSet columns.
Definition: MSColumns.h:221
casacore::uInt rowsdone_p
Definition: GroupWorker.h:215
VisBuffers encapsulate one chunk of visibility data for processing.
Definition: VisBuffer.h:153
VisibilityIterator iterates through one or more writable MeasurementSets.
GroupWorkerBase()
Create empty GroupWorkerBase you can assign to or attach.
Definition: GroupWorker.h:77
ROVisibilityIterator invi_p
Definition: GroupWorker.h:164
ROVisibilityIterator iterates through one or more readonly MeasurementSets.
virtual ~GroupWriteToNewMS()
GroupWriteToNewMS(GroupWriteToNewMS&amp; other);.
Definition: GroupWorker.h:200
virtual const asyncio::PrefetchColumns * prefetchColumns() const
unsigned int uInt
Definition: aipstype.h:51