casacore
Loading...
Searching...
No Matches
HDF5LattIter.h
Go to the documentation of this file.
1//# HDF5LattIter.h: a concrete iterator for use with HDF5Lattices.
2//# Copyright (C) 2009
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_HDF5LATTITER_H
27#define LATTICES_HDF5LATTITER_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <casacore/lattices/Lattices/LatticeIterInterface.h>
32#include <casacore/lattices/Lattices/HDF5Lattice.h>
33
34
35namespace casacore { //# NAMESPACE CASACORE - BEGIN
36
37// <summary>
38// A read/write Lattice iterator for PagedArrays.
39// </summary>
40
41// <use visibility=local>
42
43// <reviewed reviewer="Peter Barnes" date="1999/10/30" tests="tLatticeIterator.cc" 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 HDF5LattIter 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// HDF5LattIter 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
89
90template <class T> class HDF5LattIter : public LatticeIterInterface<T>
91{
92friend class HDF5Lattice<T>;
93
94 //# Make members of parent class known.
95protected:
98
99protected:
100 // Construct the Iterator with the supplied data, and iteration strategy
101 HDF5LattIter (const HDF5Lattice<T>& data, const LatticeNavigator& method,
102 Bool useRef);
103
104 // The copy constructor uses reference sematics for the PagedArray and
105 // copy semantics for the cursor and Navigator. This way the newly
106 // constructed HDF5LattIter can independently iterate through the same
107 // data set. (with the same cursor shape etc.)
109
110 // Destructor (cleans up dangling references and releases cursor memory)
111 virtual ~HDF5LattIter();
112
113 // The assignment operator uses reference sematics for the PagedArray and
114 // copy semantics for the cursor and Navigator. This way the
115 // HDF5LattIter objects share the same data set but independently iterate
116 // with cursors of the same size.
118
119 // Clone the object.
121
122private:
123 // Setup the cache in the tiled storage manager.
125
126
127 // reference to the PagedArray
129};
130
131
132
133} //# NAMESPACE CASACORE - END
134
135#ifndef CASACORE_NO_AUTO_TEMPLATES
136#include <casacore/lattices/Lattices/HDF5LattIter.tcc>
137#endif //# CASACORE_NO_AUTO_TEMPLATES
138#endif
virtual LatticeIterInterface< T > * clone() const
Clone the object.
void setupTileCache()
Setup the cache in the tiled storage manager.
HDF5LattIter< T > & operator=(const HDF5LattIter< T > &other)
The assignment operator uses reference sematics for the PagedArray and copy semantics for the cursor ...
HDF5LattIter(const HDF5Lattice< T > &data, const LatticeNavigator &method, Bool useRef)
Construct the Iterator with the supplied data, and iteration strategy.
virtual ~HDF5LattIter()
Destructor (cleans up dangling references and releases cursor memory)
HDF5LattIter(const HDF5LattIter< T > &other)
The copy constructor uses reference sematics for the PagedArray and copy semantics for the cursor and...
HDF5Lattice< T > itsData
reference to the PagedArray
LatticeNavigator * itsNavPtr
Pointer to the method of Lattice transversal.
virtual void rewriteData()
Rewrite the cursor data and clear the rewrite flag.
this file contains all the compiler specific defines
Definition mainpage.dox:28
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40