casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | List of all members
casacore::LatticeBase Class Referenceabstract

A non-templated, abstract base class for array-like objects. More...

#include <LatticeBase.h>

Inheritance diagram for casacore::LatticeBase:
casacore::Lattice< T > casacore::Lattice< Bool > casacore::Lattice< Complex > casacore::Lattice< Float > casacore::Lattice< typename casacore::NumericTraits< T >::ConjugateType > casacore::ArrayLattice< T > casacore::HDF5Lattice< T > casacore::MaskedLattice< T > casacore::PagedArray< T > casacore::TempLattice< T > casacore::ArrayLattice< Bool > casacore::FITSMask casacore::FITSQualityMask casacore::LatticeRegion casacore::LCRegion casacore::HDF5Lattice< Bool > casacore::PagedArray< Bool > casacore::TempLattice< Complex > casacore::TempLattice< Float > casacore::TempLattice< typename casacore::NumericTraits< T >::ConjugateType >

Public Member Functions

virtual ~LatticeBase ()
 A virtual destructor is needed so that it will use the actual destructor in the derived class. More...
 
virtual LatticeBaseclone () const =0
 Make a copy of the derived object (reference semantics). More...
 
virtual String imageType () const
 Get the image type (returns name of derived class). More...
 
virtual DataType dataType () const =0
 Get the data type of the lattice. More...
 
virtual Bool isPersistent () const
 Is the lattice persistent and can it be loaded by other processes as well? That is the case for a PagedArray or PagedImage and for an ImageExpr which does not use transient lattices or regions. More...
 
virtual Bool isPaged () const
 Is the lattice paged to disk?
The default implementation returns False. More...
 
virtual Bool canReferenceArray () const
 Can the lattice data be referenced as an array section? That is the case for an ArrayLattice or a Temp/SubLattice using it. More...
 
virtual Bool isWritable () const
 Is the lattice writable?
The default implementation returns True. More...
 
virtual void save (const String &fileName) const
 Save the image in an AipsIO file with the given name. More...
 
virtual Bool lock (FileLocker::LockType, uInt nattempts)
 It is strongly recommended to use class LatticeLocker to handle lattice locking. More...
 
virtual void unlock ()
 
virtual Bool hasLock (FileLocker::LockType) const
 
virtual void resync ()
 Resynchronize the Lattice object with the lattice file. More...
 
virtual void flush ()
 Flush the data (but do not unlock). More...
 
virtual void tempClose ()
 Temporarily close the lattice. More...
 
virtual void reopen ()
 Explicitly reopen the temporarily closed lattice. More...
 
virtual String name (Bool stripPath=False) const
 Return the name of the current Lattice object. More...
 
virtual IPosition shape () const =0
 Return the shape of the Lattice including all degenerate axes (ie. More...
 
virtual uInt ndim () const
 Return the number of axes in this Lattice. More...
 
virtual size_t nelements () const
 Return the total number of elements in this Lattice. More...
 
size_t size () const
 
Bool conform (const LatticeBase &other) const
 Return a value of "True" if this instance of Lattice and 'other' have the same shape, otherwise returns a value of "False". More...
 
virtual LELCoordinates lelCoordinates () const
 Return the coordinates of the lattice. More...
 
virtual uInt advisedMaxPixels () const =0
 This function returns the recommended maximum number of pixels to include in the cursor of an iterator. More...
 
IPosition niceCursorShape (uInt maxPixels) const
 Returns a recommended cursor shape for iterating through all the pixels in the Lattice. More...
 
IPosition niceCursorShape () const
 
virtual Bool ok () const
 Check class internals - used for debugging. More...
 
virtual IPosition doNiceCursorShape (uInt maxPixels) const
 The function (in the derived classes) doing the actual work. More...
 
virtual uInt maximumCacheSize () const
 Maximum cache size - not necessarily all used. More...
 
virtual void setMaximumCacheSize (uInt howManyPixels)
 Set the maximum (allowed) cache size as indicated. More...
 
virtual void setCacheSizeInTiles (uInt howManyTiles)
 Set the actual cache size for this Array to be big enough for the indicated number of tiles. More...
 
virtual void setCacheSizeFromPath (const IPosition &sliceShape, const IPosition &windowStart, const IPosition &windowLength, const IPosition &axisPath)
 Set the cache size as to "fit" the indicated path. More...
 
virtual void clearCache ()
 Clears and frees up the caches, but the maximum allowed cache size is unchanged from when setCacheSize was called. More...
 
virtual void showCacheStatistics (ostream &os) const
 Report on cache success. More...
 

Protected Member Functions

 LatticeBase ()
 Define default constructor to be used by derived classes. More...
 
 LatticeBase (const LatticeBase &)
 Copy constructor and assignment can only be used by derived classes. More...
 
LatticeBaseoperator= (const LatticeBase &)
 
void throwBoolMath () const
 Throw an exception for arithmetic on a Bool Lattice. More...
 

Detailed Description

A non-templated, abstract base class for array-like objects.

Intended use:

Public interface

Review Status

Reviewed By:
Bob Garwood
Date Reviewed:
2000/01/18
Test programs:
tArrayLattice
Demo programs:
dLattice

Synopsis

This pure abstract base class defines the operations which may be performed on a lattice of any type.
See class Lattice for a detailed description of a lattice.

Motivation

It is very useful to be able to keep a pointer to a non-templated base class. Furthermore it gives the opportunity to factor out some non-templated code.


Note: The cache functions (maximumCacheSize, setMaximumCacheSize, setCacheSizeInTiles, setCacheSizeFromPath, clearCache, and showCacheStatistics) should all be over-ridden together as in PagedArray;

Definition at line 80 of file LatticeBase.h.

Constructor & Destructor Documentation

virtual casacore::LatticeBase::~LatticeBase ( )
virtual

A virtual destructor is needed so that it will use the actual destructor in the derived class.

casacore::LatticeBase::LatticeBase ( )
inlineprotected

Define default constructor to be used by derived classes.

Definition at line 259 of file LatticeBase.h.

casacore::LatticeBase::LatticeBase ( const LatticeBase )
inlineprotected

Copy constructor and assignment can only be used by derived classes.

Definition at line 263 of file LatticeBase.h.

Member Function Documentation

virtual uInt casacore::LatticeBase::advisedMaxPixels ( ) const
pure virtual
virtual Bool casacore::LatticeBase::canReferenceArray ( ) const
virtual
virtual void casacore::LatticeBase::clearCache ( )
virtual
virtual LatticeBase* casacore::LatticeBase::clone ( ) const
pure virtual
Bool casacore::LatticeBase::conform ( const LatticeBase other) const
inline

Return a value of "True" if this instance of Lattice and 'other' have the same shape, otherwise returns a value of "False".

Definition at line 183 of file LatticeBase.h.

References casacore::IPosition::isEqual(), and shape().

virtual DataType casacore::LatticeBase::dataType ( ) const
pure virtual
virtual IPosition casacore::LatticeBase::doNiceCursorShape ( uInt  maxPixels) const
virtual
virtual void casacore::LatticeBase::flush ( )
virtual
virtual Bool casacore::LatticeBase::hasLock ( FileLocker::LockType  ) const
virtual
virtual String casacore::LatticeBase::imageType ( ) const
virtual
virtual Bool casacore::LatticeBase::isPaged ( ) const
virtual
virtual Bool casacore::LatticeBase::isPersistent ( ) const
virtual
virtual Bool casacore::LatticeBase::isWritable ( ) const
virtual
virtual LELCoordinates casacore::LatticeBase::lelCoordinates ( ) const
virtual
virtual Bool casacore::LatticeBase::lock ( FileLocker::LockType  ,
uInt  nattempts 
)
virtual
virtual uInt casacore::LatticeBase::maximumCacheSize ( ) const
virtual
virtual String casacore::LatticeBase::name ( Bool  stripPath = False) const
virtual
virtual uInt casacore::LatticeBase::ndim ( ) const
virtual

Return the number of axes in this Lattice.

This includes all degenerate axes.
The default implementation returns shape().nelements().

Reimplemented in casacore::SubImage< T >, casacore::LCRegion, and casacore::LatticeRegion.

virtual size_t casacore::LatticeBase::nelements ( ) const
virtual

Return the total number of elements in this Lattice.


The default implementation returns shape().product().

Reimplemented in casacore::SubImage< T >, and casacore::LatticeRegion.

Referenced by size().

IPosition casacore::LatticeBase::niceCursorShape ( uInt  maxPixels) const
inline

Returns a recommended cursor shape for iterating through all the pixels in the Lattice.

The default implementation sets up a shape that completely fills as many axes as possible, but always at least the first axis. For example, given a 10x20x30 Lattice

maxPixels = 1 --> niceCursorShape = [10,1,1]
100 --> niceCursorShape = [10,1,1]
300 --> niceCursorShape = [10,20,1]
10000 --> niceCursorShape = [10,20,30]

The default argument is the result of advisedMaxPixels().

Definition at line 208 of file LatticeBase.h.

References doNiceCursorShape().

IPosition casacore::LatticeBase::niceCursorShape ( ) const
inline

Definition at line 210 of file LatticeBase.h.

References advisedMaxPixels(), and doNiceCursorShape().

virtual Bool casacore::LatticeBase::ok ( ) const
virtual
LatticeBase& casacore::LatticeBase::operator= ( const LatticeBase )
inlineprotected

Definition at line 264 of file LatticeBase.h.

virtual void casacore::LatticeBase::reopen ( )
virtual
virtual void casacore::LatticeBase::resync ( )
virtual

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.
By default the function does not do anything at all.

Reimplemented in casacore::PagedArray< T >, casacore::PagedArray< Bool >, casacore::PagedImage< T >, casacore::SubImage< T >, casacore::CurvedImage2D< T >, casacore::ImageExpr< T >, casacore::ImageExpr< Bool >, casacore::ImageConcat< T >, casacore::SubLattice< T >, casacore::LatticeExpr< T >, casacore::LatticeExpr< Bool >, casacore::RebinImage< T >, casacore::LatticeConcat< T >, casacore::ExtendImage< T >, casacore::LCMask, casacore::LCPagedMask, casacore::CurvedLattice2D< T >, casacore::ExtendLattice< T >, casacore::RebinLattice< T >, casacore::LatticeRegion, and casacore::LCLELMask.

virtual void casacore::LatticeBase::save ( const String fileName) const
virtual

Save the image in an AipsIO file with the given name.

Its purpose is to make ImageConcat and ImageExpr objects persistent.
The default implementation throws an exception.

Reimplemented in casacore::ImageConcat< T >, casacore::ImageExpr< T >, and casacore::ImageExpr< Bool >.

virtual void casacore::LatticeBase::setCacheSizeFromPath ( const IPosition sliceShape,
const IPosition windowStart,
const IPosition windowLength,
const IPosition axisPath 
)
virtual
virtual void casacore::LatticeBase::setCacheSizeInTiles ( uInt  howManyTiles)
virtual

Set the actual cache size for this Array to be big enough for the indicated number of tiles.

This cache is not shared with PagedArrays in other rows and is always clipped to be less than the maximum value set using the setMaximumCacheSize member function. Tiles are cached using a first in first out algorithm.
The default implementation does nothing.

Reimplemented in casacore::PagedArray< T >, casacore::PagedArray< Bool >, casacore::PagedImage< T >, casacore::TempImage< T >, casacore::FITSImage, casacore::MIRIADImage, casacore::TempLattice< T >, casacore::TempLattice< Float >, casacore::TempLattice< typename casacore::NumericTraits< T >::ConjugateType >, casacore::TempLattice< Complex >, casacore::FITSQualityImage, casacore::HDF5Lattice< T >, casacore::HDF5Lattice< Bool >, casacore::LatticeRegion, casacore::LCMask, and casacore::LCPagedMask.

virtual void casacore::LatticeBase::setMaximumCacheSize ( uInt  howManyPixels)
virtual
virtual IPosition casacore::LatticeBase::shape ( ) const
pure virtual
virtual void casacore::LatticeBase::showCacheStatistics ( ostream &  os) const
virtual
size_t casacore::LatticeBase::size ( ) const
inline

Definition at line 177 of file LatticeBase.h.

References nelements().

virtual void casacore::LatticeBase::tempClose ( )
virtual
void casacore::LatticeBase::throwBoolMath ( ) const
protected

Throw an exception for arithmetic on a Bool Lattice.

virtual void casacore::LatticeBase::unlock ( )
virtual

The documentation for this class was generated from the following file: