Go to the documentation of this file.
28 #ifndef TABLES_TSMCUBE_H
29 #define TABLES_TSMCUBE_H
33 #include <casacore/casa/aips.h>
34 #include <casacore/tables/DataMan/TSMShape.h>
35 #include <casacore/casa/Containers/Record.h>
36 #include <casacore/casa/Arrays/IPosition.h>
37 #include <casacore/casa/OS/Conversion.h>
38 #include <casacore/casa/iosfwd.h>
47 template<
class T>
class Block;
219 char* section,
uInt colnr,
220 uInt localPixelSize,
uInt externalPixelSize,
227 char* section,
uInt colnr,
228 uInt localPixelSize,
uInt externalPixelSize,
333 uInt endPixelInLastTile,
338 static char*
readCallBack (
void* owner,
const char* external);
348 char*
readTile (
const char* external);
349 void writeTile (
char* external,
const char* local);
Bool userSetCache_p
Did the user set the cache size?
TiledStMan * stmanPtr_p
Pointer to the parent storage manager.
Record values_p
The values of the possible id and coordinate columns.
A Vector of integers, for indexing into Array<T> objects.
uInt calcCacheSize(const IPosition &sliceShape, const IPosition &windowStart, const IPosition &windowLength, const IPosition &axisPath) const
Calculate the cache size (in buckets) for the given slice and access path.
AipsIO is the object persistency mechanism of Casacore
IPosition lastColSlice_p
The slice shape of the last column access to a slice.
A drop-in replacement for Block<T*>.
virtual void resync(AipsIO &ios)
Resync the object with the data file.
static char * initCallBack(void *owner)
char * readTile(const char *external)
Define the functions doing the actual read and write of the data in the tile and converting it to/fro...
void putObject(AipsIO &ios)
Put the data of the object into the AipsIO stream.
IPosition endTile_p
Last tile needed.
const IPosition & getLastColSlice() const
Cache for buckets in a part of a file.
uInt bucketSize() const
Get the bucket size (bytes).
Tiled hypercube in a table.
TSMShape expandedTilesPerDim_p
Precomputed tilesPerDim information.
const Record & valueRecord() const
Get the record containing the id and coordinate values.
Bool isExtensible() const
Is the hypercube extensible?
IPosition cellShape() const
Get the shape of the data cells in the cube.
virtual void makeCache()
Construct the cache object (if not constructed yet).
uInt nrTilesSubCube_p
Number of tiles in all but last dimension (used when extending).
const IPosition & cubeShape() const
Get the shape of the hypercube.
TSMFile * filePtr_p
Pointer to the TSMFile object holding the data.
Expanded IPosition for shapes.
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.
Int getObject(AipsIO &ios)
Get the data of the object from the AipsIO stream.
virtual void resyncCache()
Resync the cache object.
static void writeCallBack(void *owner, char *external, const char *local)
Block< uInt > localOffset_p
Offset for each data column in a tile (in local format).
IPosition tilesPerDim_p
The number of tiles in each hypercube dimension.
static char * readCallBack(void *owner, const char *external)
Define the callback functions for the BucketCache.
AccessType lastColAccess_p
Was the last column access to a cell, slice, or column?
IPosition adjustTileShape(const IPosition &cubeShape, const IPosition &tileShape) const
Adjust the tile shape to the hypercube shape.
void writeTile(char *external, const char *local)
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.
Base class for Tiled Storage Manager classes.
void clearCache(Bool doFlush=True)
Clear the cache, so data will be reread.
IPosition endPixelInLastTile_p
Last pixel in last tile.
virtual void deleteCache()
Delete the cache object.
AccessType
Define the possible access types for TSMDataColumn.
uInt validateCacheSize(uInt cacheSize) const
Validate the cache size (in buckets).
File object for Tiled Storage Manager.
uInt cacheSize() const
Get the current cache size (in buckets).
uInt coordinateSize(const String &coordinateName) const
Get the size of a coordinate (i.e.
virtual void extend(uInt nr, const Record &coordValues, const TSMColumn *lastCoordColumn)
Extend the last dimension of the cube with the given number.
uInt localTileLength() const
Get the length of a tile (in bytes) in local format.
void emptyCache()
Empty the cache.
void accessLine(char *section, uInt pixelOffset, uInt localPixelSize, Bool writeFlag, BucketCache *cachePtr, const IPosition &startTile, uInt endTile, const IPosition &startPixelInFirstTile, uInt endPixelInLastTile, uInt lineIndex)
Access a line in a more optimized way.
void resizeTileSections()
Resize the IPosition member variables used in accessSection() if nrdim_p changes value.
Bool matches(const PtrBlock< TSMColumn * > &idColSet, const Record &idValues)
Test if the id values match.
AccessType getLastColAccess() const
Functions for TSMDataColumn to keep track of the last type of access to a hypercube.
this file contains all the compiler specific defines
Bool useDerived_p
Is the class used directly or only by a derived class only?
Bool userSetCache() const
Determine if the user set the cache size (using setCacheSize).
uInt bucketSize_p
The bucket size in bytes (is equal to tile size in bytes).
void setup()
Initialize the various variables.
Block< uInt > externalOffset_p
Offset for each data column in a tile (in external format).
LatticeExprNode length(const LatticeExprNode &expr, const LatticeExprNode &axis)
2-argument function to get the length of an axis.
uInt nelements() const
The number of elements in this IPosition.
IPosition endPixelInFirstTile_p
Last pixel in first tile.
Bool extensible_p
Is the hypercube extensible?
void setLastColAccess(AccessType type)
virtual void showCacheStatistics(ostream &os) const
Show the cache statistics.
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
void extendCoordinates(const Record &coordValues, const String &coordName, uInt length)
Extend the coordinates vector for the given coordinate to the given length with the given coordValues...
A column in the Tiled Storage Manager.
uInt nrTiles_p
Number of tiles in the hypercube.
virtual void setShape(const IPosition &cubeShape, const IPosition &tileShape)
Set the hypercube shape.
String: the storage and methods of handling collections of characters.
BucketCache * getCache()
Get the cache object.
bool Bool
Define the standard types used by Casacore.
TSMCube(TiledStMan *stman, TSMFile *file, const IPosition &cubeShape, const IPosition &tileShape, const Record &values, Int64 fileOffset, Bool useDerived=False)
Construct the hypercube using the given file with the given shape.
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.
BucketCache * cache_p
The bucket cache.
A hierarchical collection of named fields of various types.
TSMCube & operator=(const TSMCube &)
Forbid assignment.
IPosition startPixelInFirstTile_p
First pixel in first tile.
uInt nrdim_p
Dimensionality of the hypercube.
uInt tileSize_p
The tilesize in bytes.
const IPosition & tileShape() const
Get the shape of the tiles.
Int64 fileOffset_p
Offset in the TSMFile object where the data of this hypercube starts.
uInt localTileLength_p
The tile size in bytes in local format.
void resize(uInt newSize, Bool copy=True)
Old values are copied on resize if copy==True.
void setLastColSlice(const IPosition &slice)
IPosition startTile_p
First tile needed.
static void deleteCallBack(void *owner, char *buffer)
IPosition cubeShape_p
The shape of the hypercube.
virtual void flushCache()
Flush the data in the cache.
TSMShape expandedTileShape_p
Precomputed tileShape information.
IPosition tileShape_p
The shape of the tiles in the hypercube.
IPosition nrTileSection_p
IPosition variables used in accessSection(); declared here as member variables to avoid significant c...