28 #ifndef TABLES_COLUMNSINDEX_H
29 #define TABLES_COLUMNSINDEX_H
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.
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
uInt getRowNumber(Bool &found)
Find the row number matching the key.
Block< void * > itsUpperFields
void deleteObjects()
Delete all data in the object.
Bool isUnique() const
Are all keys in the index unique?
Vector< uInt > itsDataIndex
String name() const
Return the name of the field.
Vector< uInt > getRowNumbers()
Find the row numbers matching the key.
const_iterator end() const
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.
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()
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.
Vector< uInt > itsUniqueIndex
uInt bsearch(Bool &found, const Block< void * > &fieldPtrs) const
Do a binary search on itsUniqueIndex for the key in fieldPtrs.
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.
Int Compare(const Block< void * > &fieldPtrs, const Block< void * > &dataPtrs, const Block< Int > &dataTypes, Int index)
Define the signature of a comparison function.
String: the storage and methods of handling collections of characters.
Block< void * > itsDataVectors
void fillRowNumbers(Vector< uInt > &rows, uInt start, uInt end) const
Fill the row numbers vector for the given start till end in the itsUniqueIndex vector (end is not inc...
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.
static void copyKeyField(RecordFieldPtr< T > &field, const Record &key)
Fill the internal key field from the corresponding external key.
static Int compare(const Block< void * > &fieldPtrs, const Block< void * > &dataPtrs, const Block< Int > &dataTypes, Int index)
Compare the key in fieldPtrs with the given index entry.
#define casacore
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.