Go to the documentation of this file.
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);
Access to an individual field in a record.
Description of the fields in a record object.
void copy(const ColumnsIndex &that)
Copy that object to this.
String name() const
Return the name of the field.
void deleteObjects()
Delete all data in the object.
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...
void setChanged()
Something has changed in the table, so the index has to be recreated.
Read/write access to a table column.
size_t nelements() const
How many elements does this array have? Product of all axis lengths.
void copyKey(Block< void * > fields, const Record &key)
Fill the internal key fields from the corresponding external key.
ColumnsIndex & operator=(const ColumnsIndex &that)
Assignment (copy semantics).
Block< void * > itsDataVectors
uInt getRowNumber(Bool &found)
Find the row number matching the key.
Bool isUnique() const
Are all keys in the index unique?
Index to one or more columns in a table.
const Table & table() const
Get the table for which this index is created.
Main interface class to a read/write table.
void makeObjects(const RecordDesc &description)
Make the various internal RecordFieldPtr objects.
Block< Int > itsDataTypes
Record & accessLowerKey()
Block< Bool > itsColumnChanged
Block< void * > itsLowerFields
Block< void * > itsUpperFields
this file contains all the compiler specific defines
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.
void get(const RecordFieldId &, Bool &value) const
Get the value of the given field.
uInt bsearch(Bool &found, const Block< void * > &fieldPtrs) const
Do a binary search on itsUniqueIndex for the key in fieldPtrs.
Record & accessUpperKey()
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.
Vector< String > columnNames() const
Return the names of the columns forming the index.
void create(const Table &table, const Vector< String > &columnNames, Compare *compareFunction, Bool noSort)
Create the various members in the object.
void addColumnToDesc(RecordDesc &description, const TableColumn &column)
Add a column to the record description for the keys.
ColumnsIndex(const Table &, const String &columnName, Compare *compareFunction=0, Bool noSort=False)
Create an index on the given table for the given column.
String: the storage and methods of handling collections of characters.
Vector< uInt > itsUniqueIndex
bool Bool
Define the standard types used by Casacore.
A hierarchical collection of named fields of various types.
A 1-D Specialization of the Array class.
Vector< uInt > itsDataIndex
Int Compare(const Block< void * > &fieldPtrs, const Block< void * > &dataPtrs, const Block< Int > &dataTypes, Int index)
Define the signature of a comparison function.
Record & accessKey()
Access the key values.
Vector< uInt > getRowNumbers()
Find the row numbers matching the key.
static void copyKeyField(RecordFieldPtr< T > &field, const Record &key)
Fill the internal key field from the corresponding external key.