- NoAccess
- CellAccess
- SliceAccess
- ColumnAccess
- ColumnSliceAccess
The possible id and coordinate values are stored in a Record object. They are written in the main hypercube AipsIO file.
TSMCube 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.
Construct the hypercube using the given file with the given shape. The record contains the id and possible coordinate values.
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.
Construct a TSMCube object for an existing array in a file.
It is meant to be used by
Flush the data in the cache.
Clear the cache, so data will be reread.
If wanted, the data is flushed before the cache is cleared.
Empty the cache.
It will flush the cache as needed and remove all buckets from it
resulting in a possibly large drop in memory used.
It'll also clear the userSetCache_p flag.
Show the cache statistics.
Put the data of the object into the AipsIO stream.
Get the data of the object from the AipsIO stream.
It returns the data manager sequence number, which is -1 if
no file is attached to the cube (for cells without a value).
Resync the object with the data file.
It reads the object, and adjusts the cache.
Is the hypercube extensible?
Get the bucket size (which is the length of a tile in external format).
Get the lenghth of a tile in local format.
Set the hypercube shape.
This is only possible when the shape was not defined yet.
Get the shape of the hypercube.
Get the shape of the tiles.
Get the shape of the data cells in the cube.
Get the size of a coordinate (i.e. the number of values in it).
If not defined, it returns zero.
Get the record containing the id and coordinate values.
It is used by TSMIdColumn and TSMCoordColumn.
Test if the id values match.
Extend the last dimension of the cube with the given number.
The record can contain the coordinates of the elements added.
Extend the coordinates vector for the given coordinate
to the given length with the given coordValues.
It will be initialized to zero if no coordValues are given.
If the coordinate vector does not exist yet, it will be created.
Read or write a section in the cube.
It is assumed that the section buffer is long enough.
Read or write a section in a strided way.
It is assumed that the section buffer is long enough.
Get the current cache size (in buckets).
Calculate the cache size (in buckets) for the given slice
and access path.
Set the cache size for the given slice and access path.
Resize the cache object.
When forceSmaller is False, the cache will only be resized
when it grows.
When 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.
Validate the cache size (in buckets).
This means it will return the given cache size if smaller
than the maximum cache size. Otherwise the maximum is returned.
Determine if the user set the cache size (using setCacheSize).
Functions for TSMDataColumn to keep track of the last type of
access to a hypercube. It uses it to determine if the cache
has to be reset.
Forbid assignment.
Initialize the various variables.
Adjust the tile shape to the hypercube shape.
A size of 0 gets set to 1.
A tile size > cube size gets set to the cube size.
Get the cache object.
This will construct the cache object if not present yet.
Construct the cache object (if not constructed yet).
Access a line in a more optimized way.
Define the callback functions for the BucketCache.
Define the functions doing the actual read and write of the
data in the tile and converting it to/from local format.
Resize the IPosition member variables used in accessSection()
if nrdim_p changes value.
~TSMCube()
void flushCache()
void clearCache (Bool doFlush = True)
void emptyCache()
void showCacheStatistics (ostream& os) const
void putObject (AipsIO& ios)
Int getObject (AipsIO& ios)
void resync (AipsIO& ios)
Bool isExtensible() const
uInt bucketSize() const
uInt localTileLength() const
void setShape (const IPosition& cubeShape, const IPosition& tileShape)
const IPosition& cubeShape() const
const IPosition& tileShape() const
IPosition cellShape() const
uInt coordinateSize (const String& coordinateName) const
const Record& valueRecord() const
Record& rwValueRecord()
Bool matches (const PtrBlock<TSMColumn*>& idColSet, const Record& idValues)
void extend (uInt nr, const Record& coordValues, const TSMColumn* lastCoordColumn)
void extendCoordinates (const Record& coordValues, const String& coordName, uInt length)
void accessSection (const IPosition& start, const IPosition& end, char* section, uInt colnr, uInt localPixelSize, Bool writeFlag)
void accessStrided (const IPosition& start, const IPosition& end, const IPosition& stride, char* section, uInt colnr, uInt localPixelSize, Bool writeFlag)
uInt cacheSize() const
uInt calcCacheSize (const IPosition& sliceShape, const IPosition& windowStart, const IPosition& windowLength, const IPosition& axisPath) const
void setCacheSize (const IPosition& sliceShape, const IPosition& windowStart, const IPosition& windowLength, const IPosition& axisPath, Bool forceSmaller, Bool userSet)
void setCacheSize (uInt cacheSize, Bool forceSmaller, Bool userSet)
The flag userSet inidicates if the cache size is set by
the user (by an Accessor object) or automatically (by TSMDataColumn).
uInt validateCacheSize (uInt cacheSize) const
Bool userSetCache() const
AccessType getLastColAccess() const
const IPosition& getLastColSlice() const
void setLastColAccess (AccessType type)
void setLastColSlice (const IPosition& slice)
TSMCube (const TSMCube&)
Forbid copy constructor.
TSMCube& operator= (const TSMCube&)
void setup()
void setupNrTiles()
IPosition adjustTileShape (const IPosition& cubeShape, const IPosition& tileShape) const
BucketCache* getCache()
void makeCache()
void accessLine (char* section, uInt pixelOffset, uInt localPixelSize, Bool writeFlag, BucketCache* cachePtr, const IPosition& startTile, uInt endTile, const IPosition& startPixelInFirstTile, uInt endPixelInLastTile, uInt lineIndex)
static char* readCallBack (void* owner, const char* external)
static void writeCallBack (void* owner, char* external, const char* local)
static char* initCallBack (void* owner)
static void deleteCallBack (void* owner, char* buffer)
char* readTile (const char* external)
void writeTile (char* external, const char* local)
void resizeTileSections()