28 #ifndef TABLES_COLUMNSINDEX_H 29 #define TABLES_COLUMNSINDEX_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> 44 template<
typename T>
class RecordFieldPtr;
335 Bool lowerInclusive,
Bool upperInclusive);
389 template <
typename T>
392 key.
get (field.
name(), *field);
const Table & table() const
Get the table for which this index is created.
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.
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.
Vector< uInt > itsDataIndex
String name() const
Return the name of the field.
Vector< uInt > getRowNumbers()
Find the row numbers matching the key.
Block< Bool > itsColumnChanged
Access to an individual field in a record.
size_t nelements() const
How many elements does this array have? Product of all axis lengths.
Record & accessKey()
Access the key values.
void copyKey(Block< void *> fields, const Record &key)
Fill the internal key fields from the corresponding external key.
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()
Int Compare(const Block< void *> &fieldPtrs, const Block< void *> &dataPtrs, const Block< Int > &dataTypes, Int index)
Define the signature of a comparison function.
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.
Bool isUnique() const
Are all keys in the index unique?
Vector< uInt > itsUniqueIndex
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.
Vector< String > columnNames() const
Return the names of the columns forming the index.
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.
String: the storage and methods of handling collections of characters.
Block< void * > itsDataVectors
uInt bsearch(Bool &found, const Block< void *> &fieldPtrs) const
Do a binary search on itsUniqueIndex for the key in fieldPtrs.
void get(const RecordFieldId &, Bool &value) const
Get the value of the given field.
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...
this file contains all the compiler specific defines
void setChanged()
Something has changed in the table, so the index has to be recreated.
static void copyKeyField(RecordFieldPtr< T > &field, const Record &key)
Fill the internal key field from the corresponding external key.