casacore
|
Class holding the row numbers in a RefTable. More...
#include <RefRows.h>
Public Member Functions | |
RefRows (const Vector< rownr_t > &rowNumbers, Bool isSliced=False, Bool collapse=False) | |
Create the object from a Vector containing the row numbers. More... | |
RefRows (const Vector< uInt > &rowNumbers, Bool isSliced=False, Bool collapse=False) | |
RefRows (rownr_t start, rownr_t end, rownr_t incr=1) | |
Create the object from a single start,end,incr slice. More... | |
RefRows (const RefRows &other) | |
Copy constructor (reference semantics). More... | |
RefRows & | operator= (const RefRows &other) |
Assignment (copy semantics). More... | |
~RefRows () | |
Bool | operator== (const RefRows &other) const |
Do this and the other object reference the same rows? More... | |
RowNumbers | convert (const RowNumbers &rootRownrs) const |
Convert this object to a RowNumbers object by applying the given row numbers. More... | |
RowNumbers | convert () const |
Convert this object to a RowNumbers object by de-slicing it. More... | |
rownr_t | nrows () const |
Return the number of rows given by this object. More... | |
rownr_t | nrow () const |
rownr_t | firstRow () const |
Return the first row in the object. More... | |
Bool | isSliced () const |
Represents the vector a slice? More... | |
const Vector< rownr_t > & | rowVector () const |
Get the row vector as is (thus sliced if the object contains slices). More... | |
Private Member Functions | |
void | init (const Vector< rownr_t > &rowNumbers, Bool isSliced, Bool collapse) |
Initialize the object. More... | |
rownr_t | fillNrows () const |
Fill the itsNrows variable. More... | |
Private Attributes | |
Vector< rownr_t > | itsRows |
rownr_t | itsNrows |
Bool | itsSliced |
Class holding the row numbers in a RefTable.
Internal
RefRows is used to hold the row numbers forming a view on another table. It contains a vector which can hold the row numbers in 2 ways:
ScalarColumn::getColumnRange
. Class RefRowsSliceIter can be used to iterate through a RefRows object. Each step in the iteration goes to the next a slice. If the RefRows objct contains a simple series of row numbers, each slice contains only one row number. This can degrade performance, so it is possible to use shortcuts by testing if the object contains slices (using isSliced()
) and getting the row number vector directly (using rowVector()
).
RefRows is meant to have one class representing the various ways of picking row numbers. This simplifies the interface of the table and data manager classes dealing with getting/putting the data.
casacore::RefRows::RefRows | ( | const Vector< rownr_t > & | rowNumbers, |
Bool | isSliced = False , |
||
Bool | collapse = False |
||
) |
Create the object from a Vector containing the row numbers.
When isSliced==False
, the vector is treated as containing individual row numbers, otherwise as containing (possibly multiple) slices in the form start,end,incr. When collapse==True
, it will try to collapse the individual row numbers to the slice form (to save memory).
|
explicit |
Create the object from a single start,end,incr slice.
casacore::RefRows::RefRows | ( | const RefRows & | other | ) |
Copy constructor (reference semantics).
casacore::RefRows::~RefRows | ( | ) |
RowNumbers casacore::RefRows::convert | ( | const RowNumbers & | rootRownrs | ) | const |
Convert this object to a RowNumbers object by applying the given row numbers.
It is used to convert the RefRows object with row numbers in a RefTable to row numbers in the original root table.
RowNumbers casacore::RefRows::convert | ( | ) | const |
Convert this object to a RowNumbers object by de-slicing it.
I.e. it linearizes the row numbers.
|
private |
|
inline |
|
private |
Initialize the object.
|
inline |
|
inline |
Definition at line 133 of file RefRows.h.
References fillNrows(), and itsNrows.
|
inline |
Return the number of rows given by this object.
If the object contains slices, it counts the number of rows represented by each slice. //
Definition at line 131 of file RefRows.h.
References fillNrows(), and itsNrows.
Do this and the other object reference the same rows?
|
private |
Definition at line 159 of file RefRows.h.
Referenced by firstRow(), and rowVector().
|
private |
Definition at line 161 of file RefRows.h.
Referenced by isSliced().