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