casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
casa::TSMCubeBuff Class Reference

Tiled hypercube in a table. More...

#include <TSMCubeBuff.h>

Inheritance diagram for casa::TSMCubeBuff:
casa::TSMCube

List of all members.

Public Member Functions

 TSMCubeBuff (TiledStMan *stman, TSMFile *file, const IPosition &cubeShape, const IPosition &tileShape, const Record &values, Int64 fileOffset, uInt bufferSize)
 Construct the hypercube using the given file with the given shape.
 TSMCubeBuff (TiledStMan *stman, AipsIO &ios, uInt bufferSize)
 Reconstruct the hypercube by reading its data from the AipsIO stream.
virtual ~TSMCubeBuff ()
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

 TSMCubeBuff (const TSMCubeBuff &)
 Forbid copy constructor.
TSMCubeBuffoperator= (const TSMCubeBuff &)
 Forbid assignment.
BucketBufferedgetCache ()
 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

BucketBufferedcache_p
 The bucket cache.
uInt bufferSize_p
 The buffer size to use.

Detailed Description

Tiled hypercube in a table.

Intended use:

Internal

Review Status

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

Prerequisite

Etymology

TSMCubeBuff represents a hypercube in the Tiled Storage Manager.

Synopsis

TSMCubeBuff defines a tiled hypercube. The data is stored in a TSMFile object and accessed using a BucketBuffered 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.

TSMCubeBuff 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

TSMCubeBuff encapsulates all operations on a hypercube.

Definition at line 97 of file TSMCubeBuff.h.


Constructor & Destructor Documentation

casa::TSMCubeBuff::TSMCubeBuff ( TiledStMan stman,
TSMFile file,
const IPosition cubeShape,
const IPosition tileShape,
const Record values,
Int64  fileOffset,
uInt  bufferSize 
)

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.

casa::TSMCubeBuff::TSMCubeBuff ( TiledStMan stman,
AipsIO ios,
uInt  bufferSize 
)

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 casa::TSMCubeBuff::~TSMCubeBuff ( ) [virtual]

Forbid copy constructor.


Member Function Documentation

virtual void casa::TSMCubeBuff::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 casa::TSMCube.

virtual void casa::TSMCubeBuff::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 casa::TSMCube.

virtual void casa::TSMCubeBuff::deleteCache ( ) [private, virtual]

Delete the cache object.

Reimplemented from casa::TSMCube.

virtual void casa::TSMCubeBuff::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 casa::TSMCube.

virtual void casa::TSMCubeBuff::flushCache ( ) [virtual]

Flush the data in the cache.

Reimplemented from casa::TSMCube.

Get the cache object.

This will construct the cache object if not present yet.

Reimplemented from casa::TSMCube.

Definition at line 193 of file TSMCubeBuff.h.

References cache_p, and makeCache().

virtual void casa::TSMCubeBuff::makeCache ( ) [private, virtual]

Construct the cache object (if not constructed yet).

Reimplemented from casa::TSMCube.

Referenced by getCache().

TSMCubeBuff& casa::TSMCubeBuff::operator= ( const TSMCubeBuff ) [private]

Forbid assignment.

virtual void casa::TSMCubeBuff::resyncCache ( ) [private, virtual]

Resync the cache object.

Reimplemented from casa::TSMCube.

virtual void casa::TSMCubeBuff::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 casa::TSMCube.

virtual void casa::TSMCubeBuff::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 casa::TSMCube.

virtual void casa::TSMCubeBuff::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 casa::TSMCube.

virtual void casa::TSMCubeBuff::showCacheStatistics ( ostream &  os) const [virtual]

Show the cache statistics.

Reimplemented from casa::TSMCube.


Member Data Documentation

The buffer size to use.

Definition at line 188 of file TSMCubeBuff.h.

The bucket cache.

Reimplemented from casa::TSMCube.

Definition at line 186 of file TSMCubeBuff.h.

Referenced by getCache().


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