28 #ifndef TABLES_COLUMNSINDEX_H
29 #define TABLES_COLUMNSINDEX_H
44 template<
typename T>
class RecordFieldPtr;
335 Bool lowerInclusive,
Bool upperInclusive);
389 template <
typename T>
392 key.
get (field.
name(), *field);
void copy(const ColumnsIndex &that)
Copy that object to this.
Index to one or more columns in a table.
Block< Int > itsDataTypes
A 1-D Specialization of the Array class.
void readData()
Read the data of the columns forming the index, sort them and form the index.
RowNumbers getRowNumbers()
Find the row numbers matching the key.
static void copyKeyField(void *field, int dtype, const Record &key)
Fill the internal key field from the corresponding external key.
size_t nelements() const
How many elements does this array have? Product of all axis lengths.
Main interface class to a read/write table.
Block< void * > itsLowerFields
Block< void * > itsUpperFields
Vector< rownr_t > itsUniqueIndex
void deleteObjects()
Delete all data in the object.
rownr_t getRowNumber(Bool &found)
Find the row number matching the key.
Bool isUnique() const
Are all keys in the index unique?
String name() const
Return the name of the field.
void fillRowNumbers(Vector< rownr_t > &rows, rownr_t start, rownr_t end) const
Fill the row numbers vector for the given start till end in the itsUniqueIndex vector (end is not inc...
void copyKey(Block< void * > fields, const Record &key)
Fill the internal key fields from the corresponding external key.
Block< Bool > itsColumnChanged
Access to an individual field in a record.
Record & accessKey()
Access the key values.
static Int compare(const Block< void * > &fieldPtrs, const Block< void * > &dataPtrs, const Block< Int > &dataTypes, rownr_t index)
Compare the key in fieldPtrs with the given index entry.
ColumnsIndex(const Table &, const String &columnName, Compare *compareFunction=0, Bool noSort=False)
Create an index on the given table for the given column.
Description of the fields in a record object.
Record & accessUpperKey()
rownr_t bsearch(Bool &found, const Block< void * > &fieldPtrs) const
Do a binary search on itsUniqueIndex for the key in fieldPtrs.
A hierarchical collection of named fields of various types.
bool Bool
Define the standard types used by Casacore.
void makeObjects(const RecordDesc &description)
Make the various internal RecordFieldPtr objects.
Record & accessLowerKey()
void addColumnToDesc(RecordDesc &description, const TableColumn &column)
Add a column to the record description for the keys.
Read/write access to a table column.
uInt64 rownr_t
Define the type of a row number in a table.
ColumnsIndex & operator=(const ColumnsIndex &that)
Assignment (copy semantics).
void create(const Table &table, const Vector< String > &columnNames, Compare *compareFunction, Bool noSort)
Create the various members in the object.
void get(const RecordFieldId &, Bool &value) const
Get the value of the given field.
String: the storage and methods of handling collections of characters.
Block< void * > itsDataVectors
Vector< rownr_t > itsDataIndex
Vector< String > columnNames() const
Return the names of the columns forming the index.
void setChanged()
Something has changed in the table, so the index has to be recreated.
const Table & table() const
Get the table for which this index is created.
Int Compare(const Block< void * > &fieldPtrs, const Block< void * > &dataPtrs, const Block< Int > &dataTypes, rownr_t index)
Define the signature of a comparison function.
static void copyKeyField(RecordFieldPtr< T > &field, const Record &key)
Fill the internal key field from the corresponding external key.