28 #ifndef TABLES_COLUMNSINDEXARRAY_H
29 #define TABLES_COLUMNSINDEXARRAY_H
33 #include <casacore/casa/aips.h>
34 #include <casacore/tables/Tables/Table.h>
35 #include <casacore/casa/Arrays/Vector.h>
36 #include <casacore/casa/Containers/Block.h>
37 #include <casacore/casa/Containers/Record.h>
242 Bool lowerInclusive,
Bool upperInclusive,
size_t nelements() const
How many elements does this array have? Product of all axis lengths.
ColumnsIndexArray(const Table &, const String &columnName)
Create an index on the given table for the given column.
const Table & table() const
Get the table for which this index is created.
void setChanged()
Something has changed in the table, so the index has to be recreated.
void getArray(Vector< Int > &result, const String &name)
Bool isUnique() const
Are all keys in the index unique?
void addColumnToDesc(RecordDesc &description, const TableColumn &column)
Add a column to the record description for the keys.
ColumnsIndexArray(const ColumnsIndexArray &that)
Copy constructor (copy semantics).
void readData()
Read the data of the columns forming the index, sort them and form the index.
void getArray(Vector< String > &result, const String &name)
void makeObjects(const RecordDesc &description)
Make the various internal RecordFieldPtr objects.
void copy(const ColumnsIndexArray &that)
Copy that object to this.
RowNumbers getRowNumbers(const Record &lower, const Record &upper, Bool lowerInclusive, Bool upperInclusive, Bool unique=False)
Vector< rownr_t > itsUniqueIndex
Record & accessUpperKey()
void fillRownrs(rownr_t npts, const Block< rownr_t > &nrel)
Fill the rownrs belonging to each array value.
rownr_t bsearch(Bool &found, void *fieldPtr) const
Do a binary search on itsUniqueIndexArray for the key in fieldPtrs.
RowNumbers getRowNumbers(Bool unique=False)
Find the row numbers matching the key.
Vector< rownr_t > itsDataIndex
ColumnsIndexArray & operator=(const ColumnsIndexArray &that)
Assignment (copy semantics).
static Int compare(void *fieldPtr, void *dataPtr, Int dataType, rownr_t index)
Compare the key in fieldPtr with the given index entry.
void getArray(Vector< uInt > &result, const String &name)
RowNumbers getRowNumbers(const Record &key, Bool unique=False)
void setChanged(const String &columnName)
rownr_t getRowNumber(Bool &found)
Find the row number matching the key.
void fillRowNumbers(Vector< rownr_t > &rows, rownr_t start, rownr_t end, Bool unique) const
Fill the row numbers vector for the given start till end in the itsUniqueIndexArray vector (end is no...
Record & accessLowerKey()
Block< rownr_t > itsRownrs
void getArray(Vector< uChar > &result, const String &name)
Get the data if the column is an array.
Record & accessKey()
Access the key values.
void deleteObjects()
Delete all data in the object.
void getArray(Vector< Short > &result, const String &name)
const String & columnName() const
Return the names of the columns forming the index.
RowNumbers getRowNumbers(Bool lowerInclusive, Bool upperInclusive, Bool unique=False)
Find the row numbers matching the key range.
rownr_t getRowNumber(Bool &found, const Record &key)
void getArray(Vector< Int64 > &result, const String &name)
String: the storage and methods of handling collections of characters.
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.