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
30//# Includes
31#include <casacore/casa/aips.h>
32#include <casacore/lattices/LEL/LELInterface.h>
33
34namespace casacore { //# NAMESPACE CASACORE - BEGIN
35
36//# Forward Declarations
37template <class T> class Lattice;
38template <class T> class MaskedLattice;
39
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
90
91
92
93template <class T> class LELLattice : public LELInterface<T>
94{
95 //# Make members of parent class known.
96public:
98protected:
99 using LELInterface<T>::setAttr;
100
101public:
102// Constructor takes lattice to fetch from it
103// <group>
104 LELLattice (const Lattice<T>& lattice);
105 LELLattice (const MaskedLattice<T>& lattice);
106// </group>
107
108// Destructor does nothing
110
111// Evaluate the expression; this means get the chunk of the lattice.
112 virtual void eval(LELArray<T>& result,
113 const Slicer& section) const;
114 virtual void evalRef(LELArrayRef<T>& result,
115 const Slicer& section) const;
116
117// Getting a scalar value is not possible (throws exception).
118 virtual LELScalar<T> getScalar() const;
119
120// Do further preparations (e.g. optimization) on the expression.
122
123// Get class name
124 virtual String className() const;
125
126 // Handle locking/syncing of a lattice in a lattice expression.
127 // <group>
128 virtual Bool lock (FileLocker::LockType, uInt nattempts);
129 virtual void unlock();
131 virtual void resync();
132 // </group>
133
134private:
136};
137
138
139
140} //# NAMESPACE CASACORE - END
141
142#ifndef CASACORE_NO_AUTO_TEMPLATES
143#include <casacore/lattices/LEL/LELLattice.tcc>
144#endif //# CASACORE_NO_AUTO_TEMPLATES
145#endif
LockType
Define the possible lock types.
Definition FileLocker.h:93
This LEL class holds a possible referenced array with a mask.
Definition LELArray.h:131
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:135
String: the storage and methods of handling collections of characters.
Definition String.h:223
this file contains all the compiler specific defines
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40