casacore
Loading...
Searching...
No Matches
LELLattice.h
Go to the documentation of this file.
1// # LELLattice.h: LELLattice
2// # Copyright (C) 1997,1998,1999,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// #
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_LELLATTICE_H
27#define LATTICES_LELLATTICE_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/lattices/LEL/LELInterface.h>
32
33namespace casacore { // # NAMESPACE CASACORE - BEGIN
34
35// # Forward Declarations
36template <class T>
37class Lattice;
38template <class T>
39class MaskedLattice;
40
41// <summary> This LEL class handles access to Lattices </summary>
42//
43// <use visibility=local>
44//
45// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
46// </reviewed>
47//
48// <prerequisite>
49// <li> <linkto class="Lattice"> Lattice</linkto>
50// <li> <linkto class="LatticeExpr"> LatticeExpr</linkto>
51// <li> <linkto class="LatticeExprNode"> LatticeExprNode</linkto>
52// <li> <linkto class="LELInterface"> LELInterface</linkto>
53// </prerequisite>
54//
55// <etymology>
56// This derived LEL letter class handles access to the pixels in a Lattice
57// </etymology>
58//
59// <synopsis>
60// This LEL letter class is derived from LELInterface. It
61// is used to construct LEL objects that access the pixels in
62// a Lattice. It works with Lattices of type
63// Float,Double,Complex,DComplex and Bool.
64//
65// A description of the implementation details of the LEL classes can
66// be found in
67// <a href="../notes/216.html">Note 216</a>
68// </synopsis>
69//
70// <example>
71// Examples are not very useful as the user would never use
72// these classes directly. Look in LatticeExprNode.cc to see
73// how it invokes these classes. An example of how the user
74// would indirectly use this class (through the envelope) is:
75// <srcblock>
76// IPosition shape(2,5,10);
77// ArrayLattice<Float> x(shape); x.set(1.0);
78// ArrayLattice<Float> y(shape);
79// y.copyData(x); // y = x
80// </srcblock>
81// </example>
82//
83// <motivation>
84// Accessing Lattices is fundamental to manipulating their pixel values
85// </motivation>
86//
87// <todo asof="1998/01/20">
88// </todo>
89
90template <class T>
91class LELLattice : public LELInterface<T> {
92 // # Make members of parent class known.
93 public:
95
96 protected:
97 using LELInterface<T>::setAttr;
98
99 public:
100 // Constructor takes lattice to fetch from it
101 // <group>
102 LELLattice(const Lattice<T>& lattice);
104 // </group>
105
106 // Destructor does nothing
108
109 // Evaluate the expression; this means get the chunk of the lattice.
110 virtual void eval(LELArray<T>& result, const Slicer& section) const;
111 virtual void evalRef(LELArrayRef<T>& result, const Slicer& section) const;
112
113 // Getting a scalar value is not possible (throws exception).
114 virtual LELScalar<T> getScalar() const;
115
116 // Do further preparations (e.g. optimization) on the expression.
118
119 // Get class name
120 virtual String className() const;
121
122 // Handle locking/syncing of a lattice in a lattice expression.
123 // <group>
124 virtual Bool lock(FileLocker::LockType, uInt nattempts);
125 virtual void unlock();
127 virtual void resync();
128 // </group>
129
130 private:
132};
133
134} // namespace casacore
135
136#ifndef CASACORE_NO_AUTO_TEMPLATES
137#include <casacore/lattices/LEL/LELLattice.tcc>
138#endif // # CASACORE_NO_AUTO_TEMPLATES
139#endif
LockType
Define the possible lock types.
Definition FileLocker.h:89
This LEL class holds a possible referenced array with a mask.
Definition LELArray.h:119
const LELAttribute & getAttribute() const
Get expression attribute.
void setAttr(const LELAttribute &attrib)
Set the expression attributes of this object.
virtual void evalRef(LELArrayRef< T > &result, const Slicer &section) const
~LELLattice()
Destructor does nothing.
virtual String className() const
Get class name.
virtual Bool prepareScalarExpr()
Do further preparations (e.g.
virtual void resync()
virtual Bool lock(FileLocker::LockType, uInt nattempts)
Handle locking/syncing of a lattice in a lattice expression.
virtual void unlock()
LELLattice(const Lattice< T > &lattice)
Constructor takes lattice to fetch from it.
LELLattice(const MaskedLattice< T > &lattice)
virtual void eval(LELArray< T > &result, const Slicer &section) const
Evaluate the expression; this means get the chunk of the lattice.
virtual LELScalar< T > getScalar() const
Getting a scalar value is not possible (throws exception).
virtual Bool hasLock(FileLocker::LockType) const
MaskedLattice< T > * pLattice_p
Definition LELLattice.h:131
String: the storage and methods of handling collections of characters.
Definition String.h:355
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40