Loading...
Searching...
No Matches
casacore::RefRows Class Reference
tables package (libcasa_tables) » Tables_module » Tables_module_internal_classes

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.
| 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.
| RefRows (const RefRows &other)
| Copy constructor (reference semantics).
RefRows & | operator= (const RefRows &other)
| Assignment (copy semantics).
| ~RefRows ()
Bool | operator== (const RefRows &other) const
| Do this and the other object reference the same rows?
RowNumbers | convert (const RowNumbers &rootRownrs) const
| Convert this object to a RowNumbers object by applying the given row numbers.
RowNumbers | convert () const
| Convert this object to a RowNumbers object by de-slicing it.
rownr_t | nrows () const
| Return the number of rows given by this object.
rownr_t | nrow () const
rownr_t | firstRow () const
| Return the first row in the object.
Bool | isSliced () const
| Represents the vector a slice?
const Vector< rownr_t > & | rowVector () const
| Get the row vector as is (thus sliced if the object contains slices).

## Private Member Functions

void | init (const Vector< rownr_t > &rowNumbers, Bool isSliced, Bool collapse)
| Initialize the object.
rownr_t | fillNrows () const
| Fill the itsNrows variable.

## Private Attributes

Vector< rownr_t > | itsRows
rownr_t | itsNrows
Bool | itsSliced

## Detailed Description

Class holding the row numbers in a RefTable

### Intended use:

Internal

### Review Status

Reviewed By:
  UNKNOWN
Date Reviewed:
  before2004/08/25
Test programs:
  tRefRows

### Prerequisite

- Vector

### Synopsis

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:

1. As a normal series of row numbers. This is used by e.g. class RefTable
2. As a series of Slices. In this case 3 subsequent entries in the vector are used to represent start, end, and increment. This is used by a function like 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()).

### Motivation

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.

Definition at line 83 of file RefRows.h.

## Constructor & Destructor Documentation

## RefRows() [1/4]

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).

References casacore::False, and isSliced().

Referenced by operator=(), operator==(), and RefRows().

## RefRows() [2/4]

casacore::RefRows::RefRows | ( | const Vector< uInt > & | rowNumbers,
|  | Bool | isSliced = False,
|  | Bool | collapse = False )

explicit

References casacore::False, and isSliced().

## RefRows() [3/4]

casacore::RefRows::RefRows | ( | rownr_t | start,
|  | rownr_t | end,
|  | rownr_t | incr = 1 )

Create the object from a single start,end,incr slice.

## RefRows() [4/4]

casacore::RefRows::RefRows | ( | const RefRows & | other | ) |

Copy constructor (reference semantics).

References RefRows().

## ~RefRows()

casacore::RefRows::~RefRows | ( |  | ) |

## Member Function Documentation

## convert() [1/2]

RowNumbers casacore::RefRows::convert | ( |  | ) | const

Convert this object to a RowNumbers object by de-slicing it.

I.e. it linearizes the row numbers.

## convert() [2/2]

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.

## fillNrows()

rownr_t casacore::RefRows::fillNrows | ( |  | ) | const

private

Fill the itsNrows variable.

Referenced by nrow(), and nrows().

## firstRow()

rownr_t casacore::RefRows::firstRow | ( |  | ) | const

inline

Return the first row in the object.

Definition at line 136 of file RefRows.h.

References itsRows.

## init()

void casacore::RefRows::init | ( | const Vector< rownr_t > & | rowNumbers,
|  | Bool | isSliced,
|  | Bool | collapse )

private

Initialize the object.

References isSliced().

## isSliced()

Bool casacore::RefRows::isSliced | ( |  | ) | const

inline

Represents the vector a slice?

Definition at line 140 of file RefRows.h.

References itsSliced.

Referenced by init(), RefRows(), and RefRows().

## nrow()

rownr_t casacore::RefRows::nrow | ( |  | ) | const

inline

Definition at line 131 of file RefRows.h.

References fillNrows(), and itsNrows.

## nrows()

rownr_t casacore::RefRows::nrows | ( |  | ) | const

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 129 of file RefRows.h.

References fillNrows(), and itsNrows.

## operator=()

RefRows & casacore::RefRows::operator= | ( | const RefRows & | other | ) |

Assignment (copy semantics).

References RefRows().

## operator==()

Bool casacore::RefRows::operator== | ( | const RefRows & | other | ) | const

Do this and the other object reference the same rows?

References RefRows().

## rowVector()

const Vector< rownr_t > & casacore::RefRows::rowVector | ( |  | ) | const

inline

Get the row vector as is (thus sliced if the object contains slices).

It is mainly useful to get all row numbers when the object does not contain slices.

Definition at line 146 of file RefRows.h.

References itsRows.

## Member Data Documentation

## itsNrows

rownr_t casacore::RefRows::itsNrows

private

Definition at line 158 of file RefRows.h.

Referenced by nrow(), and nrows().

## itsRows

Vector<rownr_t> casacore::RefRows::itsRows

private

Definition at line 157 of file RefRows.h.

Referenced by firstRow(), and rowVector().

## itsSliced

Bool casacore::RefRows::itsSliced

private

Definition at line 159 of file RefRows.h.

Referenced by isSliced().

The documentation for this class was generated from the following file:

- tables/Tables/RefRows.h