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::ConcatRows Class Reference

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

#include <ConcatRows.h>

Public Member Functions

 ConcatRows ()
 Construct an empty block. More...
 
void reserve (uInt ntable)
 Reserve the block for the given nr of tables. More...
 
void add (uInt nrow)
 Add a table with the given nr of rows. More...
 
uInt ntable () const
 Give the nr of tables. More...
 
uInt nrow () const
 Get the total nr of rows. More...
 
uInt operator[] (uInt i) const
 Give the nr of rows for the i-th table. More...
 
uInt offset (uInt i) const
 Give the offset for the i-th table. More...
 
void mapRownr (uInt &tableNr, uInt &tabRownr, uInt rownr) const
 Map an overall row number to a table and row number. More...
 

Private Member Functions

void findRownr (uInt rownr) const
 Find the row number and fill in the lastXX_p values. More...
 

Private Attributes

Block< uIntitsRows
 
uInt itsNTable
 
uInt itsLastStRow
 
uInt itsLastEndRow
 
uInt itsLastTableNr
 

Detailed Description

Class holding the row numbers in a ConcatTable.

Intended use:

Internal

Review Status

Reviewed By:
UNKNOWN
Test programs:
tConcatRows

Prerequisite

Synopsis

ConcatRows is used to hold the row numbers forming the concatenation of oher tables. 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 ConcatTable
  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 ConcatRowsIter can be used to iterate through a ConcatRows object. Each step in the iteration goes to the next slice. If the ConcatRows object 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

ConcatRows 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 ConcatRows.h.

Constructor & Destructor Documentation

casacore::ConcatRows::ConcatRows ( )
inline

Construct an empty block.

Definition at line 87 of file ConcatRows.h.

Member Function Documentation

void casacore::ConcatRows::add ( uInt  nrow)

Add a table with the given nr of rows.

void casacore::ConcatRows::findRownr ( uInt  rownr) const
private

Find the row number and fill in the lastXX_p values.

Referenced by mapRownr().

void casacore::ConcatRows::mapRownr ( uInt tableNr,
uInt tabRownr,
uInt  rownr 
) const
inline

Map an overall row number to a table and row number.

Definition at line 118 of file ConcatRows.h.

References findRownr(), itsLastEndRow, itsLastStRow, and itsLastTableNr.

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

Get the total nr of rows.

Definition at line 106 of file ConcatRows.h.

References itsNTable, and itsRows.

uInt casacore::ConcatRows::ntable ( ) const
inline

Give the nr of tables.

Definition at line 102 of file ConcatRows.h.

References itsNTable.

uInt casacore::ConcatRows::offset ( uInt  i) const
inline

Give the offset for the i-th table.

Definition at line 114 of file ConcatRows.h.

References itsRows.

uInt casacore::ConcatRows::operator[] ( uInt  i) const
inline

Give the nr of rows for the i-th table.

Definition at line 110 of file ConcatRows.h.

References itsRows.

void casacore::ConcatRows::reserve ( uInt  ntable)
inline

Reserve the block for the given nr of tables.

Definition at line 95 of file ConcatRows.h.

References itsRows, and casacore::Block< T >::resize().

Member Data Documentation

uInt casacore::ConcatRows::itsLastEndRow
mutableprivate

Definition at line 135 of file ConcatRows.h.

Referenced by mapRownr().

uInt casacore::ConcatRows::itsLastStRow
mutableprivate

Definition at line 134 of file ConcatRows.h.

Referenced by mapRownr().

uInt casacore::ConcatRows::itsLastTableNr
mutableprivate

Definition at line 136 of file ConcatRows.h.

Referenced by mapRownr().

uInt casacore::ConcatRows::itsNTable
private

Definition at line 133 of file ConcatRows.h.

Referenced by nrow(), and ntable().

Block<uInt> casacore::ConcatRows::itsRows
private

Definition at line 132 of file ConcatRows.h.

Referenced by nrow(), offset(), operator[](), and reserve().


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