28 #ifndef TABLES_ISMBUCKET_H
29 #define TABLES_ISMBUCKET_H
172 const char*
get (
uInt offset)
const;
204 uInt bucketStartRow,
uInt bucketNrrow,
241 static char*
readCallBack (
void* owner,
const char* bucketStorage);
259 void show (ostream& os)
const;
263 uInt &offendingRow,
uInt &offendingPrevRow)
const;
282 uInt fromIndex,
uInt toIndex)
const;
285 void read (
const char* bucketStorage);
288 void write (
char* bucketStorage)
const;
PtrBlock< Block< uInt > * > rowIndex_p
The row index per column; each index contains the row number of each value stored in the bucket (for ...
void addData(uInt colnr, uInt rownr, uInt index, const char *data, uInt leng)
Add the data to the data part.
uInt getInterval(uInt colnr, uInt rownr, uInt bucketNrrow, uInt &start, uInt &end, uInt &offset) const
Get the row-interval for given column and row.
static void writeCallBack(void *owner, char *bucketStorage, const char *bucket)
Callback function when BucketCache writes a bucket.
uInt copyData(ISMBucket &other, uInt colnr, uInt toRownr, uInt fromIndex, uInt toIndex) const
Copy a data item from this bucket to the other bucket.
Bool canAddData(uInt leng) const
Is the bucket large enough to add a value?
uInt getLength(uInt fixedLength, const char *data) const
Get the length of the data value.
ISMBase * stmanPtr_p
Pointer to the parent storage manager.
uInt & getOffset(uInt colnr, uInt rownr)
Get access to the offset of the data for given column and row.
Block< uInt > & offIndex(uInt colnr)
Return the offsets of the values stored in the data part.
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...
void read(const char *bucketStorage)
Read the data from the storage into this bucket.
const char * get(uInt offset) const
Get a pointer to the data for the given offset.
Bool canReplaceData(uInt newLeng, uInt oldLeng) const
Is the bucket large enough to replace a value?
const_iterator end() const
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
Base class of the Incremental Storage Manager.
uInt indexLeng_p
The size (in bytes) of the index.
void copy(const ISMBucket &that)
Copy the contents of that bucket to this bucket.
uInt split(ISMBucket *&left, ISMBucket *&right, Block< Bool > &duplicated, uInt bucketStartRow, uInt bucketNrrow, uInt colnr, uInt rownr, uInt lengToAdd)
Split the bucket in the middle.
void shiftLeft(uInt index, uInt nr, Block< uInt > &rowIndex, Block< uInt > &offIndex, uInt &nused, uInt leng)
Remove nr items from data and index part by shifting to the left.
uInt insertData(const char *data, uInt leng)
Insert a data value by appending it to the end.
ISMBucket & operator=(const ISMBucket &)
Forbid assignment.
Block< uInt > indexUsed_p
Nr of used elements in each index; i.e.
uInt dataLeng_p
The size (in bytes) of the data.
uInt & indexUsed(uInt colnr)
Return the number of values stored.
bool Bool
Define the standard types used by Casacore.
A drop-in replacement for Block<T*>.
A bucket in the Incremental Storage Manager.
PtrBlock< Block< uInt > * > offIndex_p
The offset index per column; each index contains the offset (in bytes) of each value stored in the bu...
uInt uIntSize_p
The size (in bytes) of an uInt (used in index, etc.).
void replaceData(uInt &offset, const char *data, uInt newLeng, uInt fixedLength)
Replace a data item.
static char * initCallBack(void *owner)
Callback function when BucketCache adds a new bucket to the data file.
char * data_p
The data space (in external (e.g.
Block< uInt > & rowIndex(uInt colnr)
Get access to the index information for the given column.
Bool check(uInt &offendingCol, uInt &offendingIndex, uInt &offendingRow, uInt &offendingPrevRow) const
Check that there are no repeated rowIds in the bucket.
static char * readCallBack(void *owner, const char *bucketStorage)
Callback function when BucketCache reads a bucket.
void removeData(uInt offset, uInt leng)
Remove a data item with the given length.
static void deleteCallBack(void *, char *bucket)
Callback function when BucketCache removes a bucket from the cache.
Bool simpleSplit(ISMBucket *left, ISMBucket *right, Block< Bool > &duplicated, uInt &splitRownr, uInt rownr)
Determine whether a simple split is possible.
void show(ostream &os) const
Show the layout of the bucket.
ISMBucket(ISMBase *parent, const char *bucketStorage)
Create a bucket with the given parent.
void write(char *bucketStorage) const
Write the bucket into the storage.
#define casacore
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.