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

More...

`#include <ConcatRows.h>`

## Public Member Functions

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

## Private Member Functions

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

## Private Attributes

Block< rownr_t > | itsRows
uInt | itsNTable
rownr_t | itsLastStRow
rownr_t | 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

- Block

### 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 81 of file ConcatRows.h.

## Constructor & Destructor Documentation

## ConcatRows()

casacore::ConcatRows::ConcatRows | ( |  | ) |

inline

Construct an empty block.

Definition at line 85 of file ConcatRows.h.

References itsLastEndRow, itsLastStRow, itsNTable, and itsRows.

## Member Function Documentation

## add()

void casacore::ConcatRows::add | ( | rownr_t | nrow | ) |

Add a table with the given nr of rows.

References nrow().

## findRownr()

void casacore::ConcatRows::findRownr | ( | rownr_t | rownr | ) | const

private

Find the row number and fill in the lastXX_p values.

Referenced by mapRownr().

## mapRownr()

void casacore::ConcatRows::mapRownr | ( | uInt & | tableNr,
|  | rownr_t & | tabRownr,
|  | rownr_t | rownr ) const

inline

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

Definition at line 116 of file ConcatRows.h.

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

## nrow()

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

inline

Get the total nr of rows.

Definition at line 104 of file ConcatRows.h.

References itsNTable, and itsRows.

Referenced by add().

## ntable()

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

inline

Give the nr of tables.

Definition at line 100 of file ConcatRows.h.

References itsNTable.

Referenced by reserve().

## offset()

rownr_t casacore::ConcatRows::offset | ( | uInt | i | ) | const

inline

Give the offset for the i-th table.

Definition at line 112 of file ConcatRows.h.

References itsRows.

## operator[]()

rownr_t casacore::ConcatRows::operator[] | ( | uInt | i | ) | const

inline

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

Definition at line 108 of file ConcatRows.h.

References itsRows.

## reserve()

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

inline

Reserve the block for the given nr of tables.

Definition at line 93 of file ConcatRows.h.

References itsRows, and ntable().

## Member Data Documentation

## itsLastEndRow

rownr_t casacore::ConcatRows::itsLastEndRow

mutable private

Definition at line 133 of file ConcatRows.h.

Referenced by ConcatRows(), and mapRownr().

## itsLastStRow

rownr_t casacore::ConcatRows::itsLastStRow

mutable private

Definition at line 132 of file ConcatRows.h.

Referenced by ConcatRows(), and mapRownr().

## itsLastTableNr

uInt casacore::ConcatRows::itsLastTableNr

mutable private

Definition at line 134 of file ConcatRows.h.

Referenced by mapRownr().

## itsNTable

uInt casacore::ConcatRows::itsNTable

private

Definition at line 131 of file ConcatRows.h.

Referenced by ConcatRows(), nrow(), and ntable().

## itsRows

Block<rownr_t> casacore::ConcatRows::itsRows

private

Definition at line 130 of file ConcatRows.h.

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

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

- tables/Tables/ConcatRows.h