casacore
Loading...
Searching...
No Matches
PagedArrIter.h
Go to the documentation of this file.
1// # PagedArrIter.h: A concrete iterator for use with PagedArray's.
2// # Copyright (C) 1994,1995,1996,1997,1998,1999,2000,2003
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: casa-feedback@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#ifndef LATTICES_PAGEDARRITER_H
27#define LATTICES_PAGEDARRITER_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/lattices/Lattices/LatticeIterInterface.h>
32#include <casacore/lattices/Lattices/PagedArray.h>
33
34namespace casacore { // # NAMESPACE CASACORE - BEGIN
35
36// <summary>
37// A read/write Lattice iterator for PagedArrays.
38// </summary>
39
40// <use visibility=local>
41
42// <reviewed reviewer="Peter Barnes" date="1999/10/30" tests="tLatticeIterator.cc"
43// demos="dPagedArray.cc">
44// </reviewed>
45
46// <prerequisite>
47// <li> <linkto class="PagedArray">PagedArray</linkto>
48// <li> <linkto class="LatticeIterator">LatticeIterator</linkto>
49// <li> <linkto class="LatticeIterInterface">LatticeIterInterface
50// </linkto>
51// <li> letter/envelope schemes, eg. Coplien, "Advanced C++", ch 5.5
52// </prerequisite>
53
54// <etymology>
55// The PagedArrIter class name is a contraction of Paged Array Iterator
56// and reflects its role as the methods for iterating through Lattices which
57// are resident on disk.
58// </etymology>
59
60// <synopsis>
61// This class is not meant for general use. Instead class
62// <linkto class="LatticeIterator">LatticeIterator</linkto> should be used
63// to iterate through a <src>PagedArray</src> or any other
64// <linkto class="Lattice">Lattice</linkto> object
65// (like a <linkto class="ArrayLattice">ArrayLattice</linkto>).
66// <p>
67// PagedArrIter is derived from LatticeIterInterface and implements
68// the iterator for a <linkto class=PagedArray>PagedArray</linkto>
69// object. This iterator is somewhat special because it sets the
70// PagedArray cache size at the start of an iteration.
71// </synopsis>
72
73// <motivation>
74// For for each derivation of Lattice to make as efficient an iterator as
75// possible.
76// The letter/envelope scheme allowed us to hide the special bits in
77// classes like the one you see here.
78// </motivation>
79
80// <templating arg=T>
81// <li> Restricted to the type of the PagedArray argument in the
82// constructors
83// </templating>
84
85// # <todo asof="1997/01/31">
86// # <li>
87// # </todo>
88
89template <class T>
91 friend class PagedArray<T>;
92
93 // # Make members of parent class known.
94 protected:
97
98 protected:
99 // Construct the Iterator with the supplied data, and iteration strategy
100 PagedArrIter(const PagedArray<T>& data, const LatticeNavigator& method, Bool useRef);
101
102 // The copy constructor uses reference sematics for the PagedArray and
103 // copy semantics for the cursor and Navigator. This way the newly
104 // constructed PagedArrIter can independently iterate through the same
105 // data set. (with the same cursor shape etc.)
107
108 // Destructor (cleans up dangling references and releases cursor memory)
109 virtual ~PagedArrIter();
110
111 // The assignment operator uses reference sematics for the PagedArray and
112 // copy semantics for the cursor and Navigator. This way the
113 // PagedArrIter objects share the same data set but independently iterate
114 // with cursors of the same size.
116
117 // Clone the object.
119
120 private:
121 // Setup the cache in the tiled storage manager.
123
124 // reference to the PagedArray
126};
127
128} // namespace casacore
129
130#ifndef CASACORE_NO_AUTO_TEMPLATES
131#include <casacore/lattices/Lattices/PagedArrIter.tcc>
132#endif // # CASACORE_NO_AUTO_TEMPLATES
133#endif
LatticeNavigator * itsNavPtr
Pointer to the method of Lattice transversal.
virtual void rewriteData()
Rewrite the cursor data and clear the rewrite flag.
LatticeIterInterface(const Lattice< T > &lattice, const LatticeNavigator &navigator, Bool useRef)
Construct with the given navigator.
virtual LatticeIterInterface< T > * clone() const
Clone the object.
void setupTileCache()
Setup the cache in the tiled storage manager.
PagedArray< T > itsData
reference to the PagedArray
virtual ~PagedArrIter()
Destructor (cleans up dangling references and releases cursor memory).
PagedArrIter(const PagedArray< T > &data, const LatticeNavigator &method, Bool useRef)
Construct the Iterator with the supplied data, and iteration strategy.
PagedArrIter(const PagedArrIter< T > &other)
The copy constructor uses reference sematics for the PagedArray and copy semantics for the cursor and...
PagedArrIter< T > & operator=(const PagedArrIter< T > &other)
The assignment operator uses reference sematics for the PagedArray and copy semantics for the cursor ...
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40