ExtendLattice.h
Classes
- ExtendLattice -- An extension of a Lattice or MaskedLattice (full description)
Interface
- Public Members
- ExtendLattice()
- ExtendLattice (const Lattice<T>& lattice, const IPosition& newShape, const IPosition& extendAxes, const IPosition& stretchAxes)
- ExtendLattice (const MaskedLattice<T>& lattice, const IPosition& newShape, const IPosition& newAxes, const IPosition& stretchAxes)
- ExtendLattice (const ExtendLattice<T>& other)
- virtual ~ExtendLattice()
- ExtendLattice<T>& operator= (const ExtendLattice<T>& other)
- virtual MaskedLattice<T>* cloneML() const
- virtual Bool isMasked() const
- virtual Bool isPersistent() const
- virtual Bool isPaged() const
- virtual Bool isWritable() const
- virtual Bool lock (FileLocker::LockType, uInt nattempts)
- virtual void unlock()
- virtual Bool hasLock (FileLocker::LockType) const
- virtual void resync()
- virtual void flush()
- virtual void tempClose()
- virtual void reopen()
- virtual Bool hasPixelMask() const
- virtual const Lattice<Bool>& pixelMask() const
- virtual Lattice<Bool>& pixelMask()
- virtual const LatticeRegion* getRegionPtr() const
- virtual IPosition shape() const
- virtual String name (Bool stripPath=False) const
- virtual uInt advisedMaxPixels() const
- virtual Bool ok() const
- virtual Bool doGetSlice (Array<T>& buffer, const Slicer& section)
- virtual void doPutSlice (const Array<T>& sourceBuffer, const IPosition& where, const IPosition& stride)
- virtual Bool doGetMaskSlice (Array<Bool>& buffer, const Slicer& section)
- virtual IPosition doNiceCursorShape (uInt maxPixels) const
- Private Members
- void setPtr (Lattice<T>* latticePtr, MaskedLattice<T>* maskLatPtr)
- Bool getMaskDataSlice (Array<Bool>& buffer, const Slicer& section)
Review Status
- Date Reviewed:
- yyyy/mm/dd
Prerequisite
Synopsis
An ExtendLattice is a lattice virtually extending another lattice
by stretching axes with length 1 and/or by adding new axes.
It is useful for e.g. LEL to have the same shapes for lattices.
An ExtendLattice is not writable (since many pixels map to the same
underlying pixel).
Example
Template Type Argument Requirements (T)
Any type that can be used by the Tables System can also be used by
this class.
Member Description
The default constructor creates a ExtendLattice that is useless for just
about everything, except that it can be assigned to with the assignment
operator.
ExtendLattice (const Lattice<T>& lattice, const IPosition& newShape, const IPosition& extendAxes, const IPosition& stretchAxes)
ExtendLattice (const MaskedLattice<T>& lattice, const IPosition& newShape, const IPosition& newAxes, const IPosition& stretchAxes)
Create a ExtendLattice from a Lattice.
newShape gives the new shape.
newAxes gives the new axes in newShape.
stretchAxes gives the stretched axes in newShape.
E.g. lattice has shape [32,1,5,1], newShape=[32,1,4,5,10],
newAxes=[2], and stretchAxes=[4]. It means that axes 2 in the newShape
is a new axes and that axes 4 in the new shape is stretched. The other
axes in the new shape have to match the other axes in the old shape.
Note that stretched axes have to have length 1 in the old shape.
ExtendLattice (const ExtendLattice<T>& other)
Copy constructor (reference semantics).
ExtendLattice<T>& operator= (const ExtendLattice<T>& other)
Assignment (reference semantics).
Make a copy of the object (reference semantics).
virtual Bool isMasked() const
Is the lattice masked?
It is if its parent lattice is masked.
An ExtendLattice is not persistent.
virtual Bool isPaged() const
Is the ExtendLattice paged to disk?
virtual Bool isWritable() const
An ExtendLattice is not writable.
virtual Bool lock (FileLocker::LockType, uInt nattempts)
virtual void unlock()
virtual Bool hasLock (FileLocker::LockType) const
Handle locking of the ExtendLattice which is delegated to its parent.
It is strongly recommended to use class
LatticeLocker to
handle lattice locking. It also contains a more detailed
explanation of the locking process.
virtual void resync()
Resynchronize the Lattice object with the lattice file.
This function is only useful if no read-locking is used, ie.
if the table lock option is UserNoReadLocking or AutoNoReadLocking.
In that cases the table system does not acquire a read-lock, thus
does not synchronize itself automatically.
virtual void flush()
Flush the data.
Close the Lattice temporarily (if it is paged to disk).
It'll be reopened automatically when needed or when
reopen is called explicitly.
virtual void reopen()
If needed, reopen a temporarily closed Lattice.
Does the ExtendLattice have a pixelmask?
Get access to the pixelmask.
An exception is thrown if the ExtendLattice does not have a pixelmask.
Get the region used (always returns 0).
Returns the shape of the ExtendLattice.
virtual String name (Bool stripPath=False) const
Return the name of the parent lattice.
This function returns the recommended maximum number of pixels to
include in the cursor of an iterator.
virtual Bool ok() const
Check class internals - used for debugging. Should always return True
virtual Bool doGetSlice (Array<T>& buffer, const Slicer& section)
Do the actual getting of an array of values.
virtual void doPutSlice (const Array<T>& sourceBuffer, const IPosition& where, const IPosition& stride)
Putting data is not possible.
Get a section of the mask.
Get the best cursor shape.
void setPtr (Lattice<T>* latticePtr, MaskedLattice<T>* maskLatPtr)
Set the various pointer needed to construct the object.
One of the pointers should be zero.
It takes over the pointer and deletes the object in the destructor.
Get mask data from mask.