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