casacore::TSMCubeMMap Class Reference

Tiled hypercube in a table. More...

#include <TSMCubeMMap.h>

Inheritance diagram for casacore::TSMCubeMMap:
casacore::TSMCube

List of all members.

Public Member Functions

 TSMCubeMMap (TiledStMan *stman, TSMFile *file, const IPosition &cubeShape, const IPosition &tileShape, const Record &values, Int64 fileOffset)
 Construct the hypercube using the given file with the given shape.
 TSMCubeMMap (TiledStMan *stman, AipsIO &ios)
 Reconstruct the hypercube by reading its data from the AipsIO stream.
virtual ~TSMCubeMMap ()
virtual void flushCache ()
 Flush the data in the cache.
virtual void showCacheStatistics (ostream &os) const
 Show the cache statistics.
virtual void setShape (const IPosition &cubeShape, const IPosition &tileShape)
 Set the hypercube shape.
virtual void extend (uInt nr, const Record &coordValues, const TSMColumn *lastCoordColumn)
 Extend the last dimension of the cube with the given number.
virtual void accessSection (const IPosition &start, const IPosition &end, char *section, uInt colnr, uInt localPixelSize, uInt externalPixelSize, Bool writeFlag)
 Read or write a section in the cube.
virtual void accessStrided (const IPosition &start, const IPosition &end, const IPosition &stride, char *section, uInt colnr, uInt localPixelSize, uInt externalPixelSize, Bool writeFlag)
 Read or write a section in a strided way.
virtual void setCacheSize (const IPosition &sliceShape, const IPosition &windowStart, const IPosition &windowLength, const IPosition &axisPath, Bool forceSmaller, Bool userSet)
 Set the cache size for the given slice and access path.
virtual void setCacheSize (uInt cacheSize, Bool forceSmaller, Bool userSet)
 Resize the cache object.

Private Member Functions

 TSMCubeMMap (const TSMCubeMMap &)
 Forbid copy constructor.
TSMCubeMMapoperator= (const TSMCubeMMap &)
 Forbid assignment.
BucketMappedgetCache ()
 Get the cache object.
virtual void makeCache ()
 Construct the cache object (if not constructed yet).
virtual void resyncCache ()
 Resync the cache object.
virtual void deleteCache ()
 Delete the cache object.

Private Attributes

BucketMappedcache_p
 The bucket cache.

Detailed Description

Tiled hypercube in a table.

Intended use:

Internal

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Prerequisite

Etymology

TSMCubeMMap represents a hypercube in the Tiled Storage Manager.

Synopsis

TSMCubeMMap defines a tiled hypercube. The data is stored in a TSMFile object and accessed using a BucketMapped object. The hypercube can be extensible in its last dimension to support tables with a size which is not known in advance.
Normally hypercubes share the same TSMFile object, but extensible hypercubes have their own TSMFile object (to be extensible). If the hypercolumn has multiple data columns, their cells share the same tiles. Per tile data column A appears first, thereafter B, etc.\.
The data in the cache is held in external format and is converted when accessed. The alternative would be to hold it in the cache in local format and convert it when read/written from the file. It was felt that the latter approach would generate more needless conversions.

The possible id and coordinate values are stored in a Record object. They are written in the main hypercube AipsIO file.

TSMCubeMMap uses the maximum cache size set for a Tiled Storage manager. The description of class ROTiledStManAccessor contains a discussion about the effect of setting the maximum cache size.

Motivation

TSMCubeMMap encapsulates all operations on a hypercube.

Definition at line 97 of file TSMCubeMMap.h.


Constructor & Destructor Documentation

casacore::TSMCubeMMap::TSMCubeMMap ( TiledStMan stman,
TSMFile file,
const IPosition cubeShape,
const IPosition tileShape,
const Record values,
Int64  fileOffset 
)

Construct the hypercube using the given file with the given shape.

The record contains the id and possible coordinate values.
If the cubeshape is empty, the hypercube is still undefined and can be added later with setShape. That is only used by TiledCellStMan.
The fileOffset argument is meant for class TiledFileAccess.

casacore::TSMCubeMMap::TSMCubeMMap ( TiledStMan stman,
AipsIO ios 
)

Reconstruct the hypercube by reading its data from the AipsIO stream.

It will link itself to the correct TSMFile. The TSMFile objects must have been reconstructed in advance.

virtual casacore::TSMCubeMMap::~TSMCubeMMap (  )  [virtual]
casacore::TSMCubeMMap::TSMCubeMMap ( const TSMCubeMMap  )  [private]

Forbid copy constructor.


Member Function Documentation

virtual void casacore::TSMCubeMMap::accessSection ( const IPosition start,
const IPosition end,
char *  section,
uInt  colnr,
uInt  localPixelSize,
uInt  externalPixelSize,
Bool  writeFlag 
) [virtual]

Read or write a section in the cube.

It is assumed that the section buffer is long enough.

Reimplemented from casacore::TSMCube.

virtual void casacore::TSMCubeMMap::accessStrided ( const IPosition start,
const IPosition end,
const IPosition stride,
char *  section,
uInt  colnr,
uInt  localPixelSize,
uInt  externalPixelSize,
Bool  writeFlag 
) [virtual]

Read or write a section in a strided way.

It is assumed that the section buffer is long enough.

Reimplemented from casacore::TSMCube.

virtual void casacore::TSMCubeMMap::deleteCache (  )  [private, virtual]

Delete the cache object.

Reimplemented from casacore::TSMCube.

virtual void casacore::TSMCubeMMap::extend ( uInt  nr,
const Record coordValues,
const TSMColumn lastCoordColumn 
) [virtual]

Extend the last dimension of the cube with the given number.

The record can contain the coordinates of the elements added.

Reimplemented from casacore::TSMCube.

virtual void casacore::TSMCubeMMap::flushCache (  )  [virtual]

Flush the data in the cache.

Reimplemented from casacore::TSMCube.

BucketMapped * casacore::TSMCubeMMap::getCache (  )  [inline, private]

Get the cache object.

This will construct the cache object if not present yet.

Reimplemented from casacore::TSMCube.

Definition at line 192 of file TSMCubeMMap.h.

References cache_p, and makeCache().

virtual void casacore::TSMCubeMMap::makeCache (  )  [private, virtual]

Construct the cache object (if not constructed yet).

Reimplemented from casacore::TSMCube.

Referenced by getCache().

TSMCubeMMap& casacore::TSMCubeMMap::operator= ( const TSMCubeMMap  )  [private]

Forbid assignment.

Reimplemented from casacore::TSMCube.

virtual void casacore::TSMCubeMMap::resyncCache (  )  [private, virtual]

Resync the cache object.

Reimplemented from casacore::TSMCube.

virtual void casacore::TSMCubeMMap::setCacheSize ( uInt  cacheSize,
Bool  forceSmaller,
Bool  userSet 
) [virtual]

Resize the cache object.

If forceSmaller is False, the cache will only be resized when it grows. If the given size exceeds the maximum size with more than 10%, the maximum size will be used. The cacheSize has to be given in buckets.
The flag userSet inidicates if the cache size is set by the user (by an Accessor object) or automatically (by TSMDataColumn).

Reimplemented from casacore::TSMCube.

virtual void casacore::TSMCubeMMap::setCacheSize ( const IPosition sliceShape,
const IPosition windowStart,
const IPosition windowLength,
const IPosition axisPath,
Bool  forceSmaller,
Bool  userSet 
) [virtual]

Set the cache size for the given slice and access path.

Reimplemented from casacore::TSMCube.

virtual void casacore::TSMCubeMMap::setShape ( const IPosition cubeShape,
const IPosition tileShape 
) [virtual]

Set the hypercube shape.

This is only possible if the shape was not defined yet.

Reimplemented from casacore::TSMCube.

virtual void casacore::TSMCubeMMap::showCacheStatistics ( ostream &  os  )  const [virtual]

Show the cache statistics.

Reimplemented from casacore::TSMCube.


Member Data Documentation

The bucket cache.

Reimplemented from casacore::TSMCube.

Definition at line 187 of file TSMCubeMMap.h.

Referenced by getCache().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1