casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::RefRows Class Reference

Class holding the row numbers in a RefTable. More...

#include <RefRows.h>

Public Member Functions

 RefRows (const Vector< uInt > &rowNumbers, Bool isSliced=False, Bool collapse=False)
 Create the object from a Vector containing the row numbers. More...
 
 RefRows (uInt start, uInt end, uInt incr=1)
 Create the object from a single start,end,incr slice. More...
 
 RefRows (const RefRows &other)
 Copy constructor (reference semantics). More...
 
RefRowsoperator= (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...
 
Vector< uIntconvert (const Vector< uInt > &rootRownrs) const
 Convert this object to a Vector<uInt> by applying the given row numbers. More...
 
Vector< uIntconvert () const
 Convert this object to a Vector<uInt> by de-slicing it. More...
 
uInt nrows () const
 Return the number of rows given by this object. More...
 
uInt nrow () const
 
uInt firstRow () const
 Return the first row in the object. More...
 
Bool isSliced () const
 Represents the vector a slice? More...
 
const Vector< uInt > & rowVector () const
 Get the row vector as is (thus sliced if the object contains slices). More...
 

Private Member Functions

uInt fillNrows () const
 Fill the itsNrows variable. More...
 

Private Attributes

Vector< uIntitsRows
 
uInt 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

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

Constructor & Destructor Documentation

casacore::RefRows::RefRows ( const Vector< uInt > &  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 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).

casacore::RefRows::RefRows ( uInt  start,
uInt  end,
uInt  incr = 1 
)

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

casacore::RefRows::RefRows ( const RefRows other)

Copy constructor (reference semantics).

casacore::RefRows::~RefRows ( )

Member Function Documentation

Vector<uInt> casacore::RefRows::convert ( const Vector< uInt > &  rootRownrs) const

Convert this object to a Vector<uInt> 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.

Referenced by casacore::Adios2StManColumnT< T >::getArrayColumnCellsV(), and casacore::Adios2StManColumnT< T >::putArrayColumnCellsV().

Vector<uInt> casacore::RefRows::convert ( ) const

Convert this object to a Vector<uInt> by de-slicing it.

I.e. it linearizes the row numbers.

uInt casacore::RefRows::fillNrows ( ) const
private

Fill the itsNrows variable.

Referenced by nrow(), and nrows().

uInt casacore::RefRows::firstRow ( ) const
inline

Return the first row in the object.

Definition at line 132 of file RefRows.h.

References itsRows.

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

Represents the vector a slice?

Definition at line 136 of file RefRows.h.

References itsSliced.

Referenced by casacore::Adios2StManColumnT< T >::getArrayColumnCellsV(), and casacore::Adios2StManColumnT< T >::putArrayColumnCellsV().

uInt casacore::RefRows::nrow ( ) const
inline

Definition at line 127 of file RefRows.h.

References fillNrows(), and itsNrows.

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

References fillNrows(), and itsNrows.

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

Assignment (copy semantics).

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

Do this and the other object reference the same rows?

const Vector<uInt>& 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 142 of file RefRows.h.

References itsRows.

Referenced by casacore::Adios2StManColumnT< T >::getArrayColumnCellsV(), and casacore::Adios2StManColumnT< T >::putArrayColumnCellsV().

Member Data Documentation

uInt casacore::RefRows::itsNrows
private

Definition at line 150 of file RefRows.h.

Referenced by nrow(), and nrows().

Vector<uInt> casacore::RefRows::itsRows
private

Definition at line 149 of file RefRows.h.

Referenced by firstRow(), and rowVector().

Bool casacore::RefRows::itsSliced
private

Definition at line 151 of file RefRows.h.

Referenced by isSliced().


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