casacore
Loading...
Searching...
No Matches
TableIndexProxy.h
Go to the documentation of this file.
1// # TableIndexProxy.h: Proxy for table index access
2// # Copyright (C) 2002,2005
3// # Associated Universities, Inc. Washington DC, USA.
4// #
5// # This library is free software; you can redistribute it and/or modify it
6// # under the terms of the GNU Library General Public License as published by
7// # the Free Software Foundation; either version 2 of the License, or (at your
8// # option) any later version.
9// #
10// # This library is distributed in the hope that it will be useful, but WITHOUT
11// # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12// # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13// # License for more details.
14// #
15// # You should have received a copy of the GNU Library General Public License
16// # along with this library; if not, write to the Free Software Foundation,
17// # Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18// #
19// # Correspondence concerning AIPS++ should be addressed as follows:
20// # Internet email: casa-feedback@nrao.edu.
21// # Postal address: AIPS++ Project Office
22// # National Radio Astronomy Observatory
23// # 520 Edgemont Road
24// # Charlottesville, VA 22903-2475 USA
25
26#ifndef TABLES_TABLEINDEXPROXY_H
27#define TABLES_TABLEINDEXPROXY_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/tables/Tables/ColumnsIndex.h>
32#include <casacore/tables/Tables/ColumnsIndexArray.h>
33
34namespace casacore { // # NAMESPACE CASACORE - BEGIN
35
36// # Forward Declarations
37class TableProxy;
38
39// <summary>
40// Proxy for table index access.
41// </summary>
42
43// <use visibility=export>
44
45// <reviewed reviewer="Paul Shannon" date="1995/09/15" tests="tgtable.g" demos="">
46// </reviewed>
47
48// <prerequisite>
49// # Classes you should understand before using this one.
50// <li> class ColumnsIndex
51// <li> class ColumnsIndexArray
52// </prerequisite>
53
54// <synopsis>
55// TableIndexProxy gives access to indexed access to tables, both for
56// scalar columns and array columns.
57// It is primarily meant to be used in classes that wrap access to it
58// from scripting languages (like Glish and Python).
59// However, it can also be used directly from other C++ code.
60//
61// A TableIndexProxy object is usually created by class
62// <linkto class=TableProxy>TableProxy</linkto>.
63// </synopsis>
64
66 public:
67 // Construct for the given columns in the table.
69
70 // Copy constructor.
72
74
75 // Assignment is forbidden.
77
78 // Are all keys in the index unique?
79 Bool isUnique() const;
80
81 // Return the names of the columns forming the index.
83
84 // Something has changed in the table, so the index has to be recreated.
85 // An empty vector means that all columns have changed, otherwise
86 // only the given columns.
88
89 // Find the row number matching the key. All keys have to be unique,
90 // otherwise an exception is thrown.
91 // If no match is found, -1 is returned.
93
94 // Find the row numbers matching the key. It should be used instead
95 // of <src>getRowNumber</src> if the same key can exist multiple times.
97
98 // Find the row numbers matching the key range. The boolean arguments
99 // tell if the lower and upper key are part of the range.
100 Vector<Int64> getRowNumbersRange(const Record& lower, const Record& upper, Bool lowerInclusive,
101 Bool upperInclusive);
102
103 private:
106};
107
108} // namespace casacore
109
110#endif
Bool isUnique() const
Are all keys in the index unique?
Vector< String > columnNames() const
Return the names of the columns forming the index.
TableIndexProxy(const TableProxy &table, const Vector< String > &columnNames, Bool noSort)
Construct for the given columns in the table.
ColumnsIndexArray * arrIndex_p
void setChanged(const Vector< String > &columnNames)
Something has changed in the table, so the index has to be recreated.
Int64 getRowNumber(const Record &key)
Find the row number matching the key.
Vector< Int64 > getRowNumbers(const Record &key)
Find the row numbers matching the key.
Vector< Int64 > getRowNumbersRange(const Record &lower, const Record &upper, Bool lowerInclusive, Bool upperInclusive)
Find the row numbers matching the key range.
TableIndexProxy(const TableIndexProxy &)
Copy constructor.
TableIndexProxy & operator=(const TableIndexProxy &)=delete
Assignment is forbidden.
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size).
Definition aipsxtype.h:36
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40