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
30//# Includes
31#include <casacore/casa/aips.h>
32#include <casacore/tables/Tables/ColumnsIndex.h>
33#include <casacore/tables/Tables/ColumnsIndexArray.h>
34
35
36namespace casacore { //# NAMESPACE CASACORE - BEGIN
37
38//# Forward Declarations
39class TableProxy;
40
41
42// <summary>
43// Proxy for table index access.
44// </summary>
45
46// <use visibility=export>
47
48// <reviewed reviewer="Paul Shannon" date="1995/09/15" tests="tgtable.g" demos="">
49// </reviewed>
50
51// <prerequisite>
52//# Classes you should understand before using this one.
53// <li> class ColumnsIndex
54// <li> class ColumnsIndexArray
55// </prerequisite>
56
57// <synopsis>
58// TableIndexProxy gives access to indexed access to tables, both for
59// scalar columns and array columns.
60// It is primarily meant to be used in classes that wrap access to it
61// from scripting languages (like Glish and Python).
62// However, it can also be used directly from other C++ code.
63//
64// A TableIndexProxy object is usually created by class
65// <linkto class=TableProxy>TableProxy</linkto>.
66// </synopsis>
67
69{
70public:
71 // Construct for the given columns in the table.
73 const Vector<String>& columnNames, Bool noSort);
74
75 // Copy constructor.
77
79
80 // Assignment is forbidden.
82
83 // Are all keys in the index unique?
84 Bool isUnique() const;
85
86 // Return the names of the columns forming the index.
88
89 // Something has changed in the table, so the index has to be recreated.
90 // An empty vector means that all columns have changed, otherwise
91 // only the given columns.
93
94 // Find the row number matching the key. All keys have to be unique,
95 // otherwise an exception is thrown.
96 // If no match is found, -1 is returned.
98
99 // Find the row numbers matching the key. It should be used instead
100 // of <src>getRowNumber</src> if the same key can exist multiple times.
102
103 // Find the row numbers matching the key range. The boolean arguments
104 // tell if the lower and upper key are part of the range.
105 Vector<Int64> getRowNumbersRange (const Record& lower, const Record& upper,
106 Bool lowerInclusive, Bool upperInclusive);
107
108private:
111};
112
113
114} //# NAMESPACE CASACORE - END
115
116
117#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.
this file contains all the compiler specific defines
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