28 #ifndef TABLES_ISMBUCKET_H
29 #define TABLES_ISMBUCKET_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/casa/Containers/Block.h>
34 #include <casacore/casa/BasicSL/String.h>
35 #include <casacore/casa/iosfwd.h>
159 const char* data,
uInt leng);
172 const char*
get (
uInt offset)
const;
282 uInt fromIndex,
uInt toIndex)
const;
285 void read (
const char* bucketStorage);
288 void write (
char* bucketStorage)
const;
void read(const char *bucketStorage)
Read the data from the storage into this bucket.
uInt & indexUsed(uInt colnr)
Return the number of values stored.
ISMBase * stmanPtr_p
Pointer to the parent storage manager.
const char * get(uInt offset) const
Get a pointer to the data for the given offset.
Block< rownr_t > & rowIndex(uInt colnr)
Get access to the index information for the given column.
uInt uIntSize_p
The size (in bytes) of an uInt and rownr_t (used in index, etc.).
uInt getInterval(uInt colnr, rownr_t rownr, rownr_t bucketNrrow, rownr_t &start, rownr_t &end, uInt &offset) const
Get the row-interval for given column and row.
void removeData(uInt offset, uInt leng)
Remove a data item with the given length.
Block< uInt > indexUsed_p
Nr of used elements in each index; i.e.
uInt copyData(ISMBucket &other, uInt colnr, rownr_t toRownr, uInt fromIndex, uInt toIndex) const
Copy a data item from this bucket to the other bucket.
Bool canReplaceData(uInt newLeng, uInt oldLeng) const
Is the bucket large enough to replace a value?
PtrBlock< Block< uInt > * > offIndex_p
The offset index per column; each index contains the offset (in bytes) of each value stored in the bu...
Bool check(uInt &offendingCol, uInt &offendingIndex, rownr_t &offendingRow, rownr_t &offendingPrevRow) const
Check that there are no repeated rowIds in the bucket.
Block< uInt > & offIndex(uInt colnr)
Return the offsets of the values stored in the data part.
void copy(const ISMBucket &that)
Copy the contents of that bucket to this bucket.
char * data_p
The data space (in external (e.g.
ISMBucket(const ISMBucket &)
Forbid copy constructor.
void shiftLeft(uInt index, uInt nr, Block< rownr_t > &rowIndex, Block< uInt > &offIndex, uInt &nused, uInt leng)
Remove nr items from data and index part by shifting to the left.
Bool simpleSplit(ISMBucket *left, ISMBucket *right, Block< Bool > &duplicated, rownr_t &splitRownr, rownr_t rownr)
Determine whether a simple split is possible.
uInt & getOffset(uInt colnr, rownr_t rownr)
Get access to the offset of the data for given column and row.
uInt dataLeng_p
The size (in bytes) of the data.
void addData(uInt colnr, rownr_t rownr, uInt index, const char *data, uInt leng)
Add the data to the data part.
void write(char *bucketStorage) const
Write the bucket into the storage.
void show(ostream &os) const
Show the layout of the bucket.
uInt insertData(const char *data, uInt leng)
Insert a data value by appending it to the end.
static void deleteCallBack(void *, char *bucket)
Callback function when BucketCache removes a bucket from the cache.
static char * initCallBack(void *owner)
Callback function when BucketCache adds a new bucket to the data file.
uInt getLength(uInt fixedLength, const char *data) const
Get the length of the data value.
void replaceData(uInt &offset, const char *data, uInt newLeng, uInt fixedLength)
Replace a data item.
uInt indexLeng_p
The size (in bytes) of the index.
static void writeCallBack(void *owner, char *bucketStorage, const char *bucket)
Callback function when BucketCache writes a bucket.
Bool canAddData(uInt leng) const
Is the bucket large enough to add a value?
ISMBucket & operator=(const ISMBucket &)
Forbid assignment.
static char * readCallBack(void *owner, const char *bucketStorage)
Callback function when BucketCache reads a bucket.
PtrBlock< Block< rownr_t > * > rowIndex_p
The row index per column; each index contains the row number of each value stored in the bucket (for ...
rownr_t split(ISMBucket *&left, ISMBucket *&right, Block< Bool > &duplicated, rownr_t bucketStartRow, rownr_t bucketNrrow, uInt colnr, rownr_t rownr, uInt lengToAdd)
Split the bucket in the middle.
uInt getSplit(uInt totLeng, const Block< uInt > &rowLeng, const Block< uInt > &cumLeng)
Return the index where the bucket should be split to get two parts with almost identical length.
ISMBucket(ISMBase *parent, const char *bucketStorage)
Create a bucket with the given parent.
A drop-in replacement for Block<T*>.
this file contains all the compiler specific defines
bool Bool
Define the standard types used by Casacore.
uInt64 rownr_t
Define the type of a row number in a table.