casacore
Loading...
Searching...
No Matches
RowNumbers.h
Go to the documentation of this file.
1//# RowNumbers.h: Vector of row numbers
2//# Copyright (C) 2019
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_ROWNUMBERS_H
27#define TABLES_ROWNUMBERS_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <casacore/casa/Arrays/Vector.h>
32
33namespace casacore { //#Begin namespace casacore
34
35 class RowNumbers: public Vector<rownr_t>
36 {
37 public:
38 // Construct an empty RowNumbers Vector.
40 {}
41
42 // Construct with the given length.
43 explicit RowNumbers (size_t n)
44 : Vector<rownr_t> (n)
45 {}
46
47 // Construct from a Vector of row numbers.
49 : Vector<rownr_t> (rows)
50 {}
51
52 // Construct from a std::vector of row numbers.
53 RowNumbers (const std::vector<rownr_t>& rows);
54
55 // Array<T> has this virtual function, so also define in this
56 // class to avoid 'virtual function override' warning.
58
59 // Construct from a Vector or std::vector of old style row numbers.
60#ifdef IMPLICIT_CTDS_32BIT
61 RowNumbers (const Vector<uInt>& rows);
62 RowNumbers (const std::vector<uInt>& rows);
63#else
64 explicit RowNumbers (const Vector<uInt>& rows);
65 explicit RowNumbers (const std::vector<uInt>& rows);
66#endif
67
68 // Conversion operator to convert Vector<rownr_t> to Vector<uInt>.
69 // This is for backward compatibility of Table::rowNumbers.
70#ifdef IMPLICIT_CTDS_32BIT
71 operator Vector<uInt>() const
72#else
73 explicit operator Vector<uInt>() const
74#endif
75 { return convertRownrVector (*this); }
76
77 // Do the actual conversion.
78 // An exception is thrown if a row number exceeds 32 bits.
80 };
81
82} //#End namespace casacore
83
84#endif
RowNumbers(const std::vector< rownr_t > &rows)
Construct from a std::vector of row numbers.
RowNumbers(const Vector< uInt > &rows)
Construct from a Vector or std::vector of old style row numbers.
RowNumbers(const Vector< rownr_t > &rows)
Construct from a Vector of row numbers.
Definition RowNumbers.h:48
virtual Array< rownr_t > & operator=(const Array< rownr_t > &other)
Array<T> has this virtual function, so also define in this class to avoid 'virtual function override'...
RowNumbers(const std::vector< uInt > &rows)
RowNumbers(size_t n)
Construct with the given length.
Definition RowNumbers.h:43
RowNumbers()
Construct an empty RowNumbers Vector.
Definition RowNumbers.h:39
static Vector< uInt > convertRownrVector(const Vector< rownr_t > &)
Do the actual conversion.
this file contains all the compiler specific defines
Definition mainpage.dox:28
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44