Loading...
Searching...
No Matches
casacore::ISMIndex Class Reference
tables package (libcasa_tables) » DataMan_module » DataMan_module_internal_classes

More...

`#include <ISMIndex.h>`

## Public Member Functions

| ISMIndex ()
| ~ISMIndex ()
| The destructor closes the file (if opened).
| ISMIndex (const ISMIndex &)=delete
| Forbid copy constructor.
ISMIndex & | operator= (const ISMIndex &)=delete
| Forbid assignment.
void | addRow (rownr_t nrrow)
| Add a row.
Int | removeRow (rownr_t rownr)
| Remove a row from the index.
uInt | getBucketNr (rownr_t rownr, rownr_t &bucketStartRow, rownr_t &bucketNrrow) const
| Get the bucket number for the given row.
void | get (AipsIO &os)
| Read the bucket index from the AipsIO object.
void | put (AipsIO &os)
| Write the bucket index into the AipsIO object.
void | addBucketNr (rownr_t rownr, uInt bucketNr)
| Add a bucket number to the index.
Bool | nextBucketNr (uInt &cursor, rownr_t &bucketStartRow, rownr_t &bucketNrrow, uInt &bucketNr) const
| Get the number of the next bucket from the index and return it in bucketNr.
void | show (std::ostream &) const
| Show the index.

## Private Member Functions

uInt | getIndex (rownr_t rownr) const
| Get the index of the bucket containing the given row.

## Private Attributes

uInt | nused_p
| Number of entries used.
Block< rownr_t > | rows_p
| Rownr index (i.e.
Block< uInt > | bucketNr_p
| Corresponding bucket number.

## Detailed Description

The Index of the Incremental Storage Manager

### Intended use:

Internal

### Review Status

Reviewed By:
  UNKNOWN
Date Reviewed:
  before2004/08/25

### Prerequisite

- ISMBase

### Etymology

ISMIndex represents the index in the Incremental Storage Manager.

### Synopsis

ISMIndex maintains an index of all buckets in an ISM (Incremental Storage Manager). The index consists of the starting row number and the bucket number of each bucket in the BucketCache object of the ISM. When the ISM is opened, the entire index is read in and kept in memory. When the ISM is closed or flushed, the index is written back after all buckets in the file. A little header at the beginning of the file indicates the starting offset of the index.

### Motivation

ISMIndex encapsulates all operations on the ISM index.

Definition at line 77 of file ISMIndex.h.

## Constructor & Destructor Documentation

## ISMIndex() [1/2]

casacore::ISMIndex::ISMIndex | ( |  | ) |

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

## ~ISMIndex()

casacore::ISMIndex::~ISMIndex | ( |  | ) |

The destructor closes the file (if opened).

## ISMIndex() [2/2]

casacore::ISMIndex::ISMIndex | ( | const ISMIndex & |  | ) |

delete

Forbid copy constructor.

References ISMIndex().

## Member Function Documentation

## addBucketNr()

void casacore::ISMIndex::addBucketNr | ( | rownr_t | rownr,
|  | uInt | bucketNr )

Add a bucket number to the index.

Argument rownr gives the starting row of the bucket. It is used to add the bucket number at the correct place (such that the row numbers are kept in ascending order).

## addRow()

void casacore::ISMIndex::addRow | ( | rownr_t | nrrow | ) |

Add a row.

## get()

void casacore::ISMIndex::get | ( | AipsIO & | os | ) |

Read the bucket index from the AipsIO object.

## getBucketNr()

uInt casacore::ISMIndex::getBucketNr | ( | rownr_t | rownr,
|  | rownr_t & | bucketStartRow,
|  | rownr_t & | bucketNrrow ) const

Get the bucket number for the given row.

Also return the start row of the bucket and the number of rows in it.

## getIndex()

uInt casacore::ISMIndex::getIndex | ( | rownr_t | rownr | ) | const

private

Get the index of the bucket containing the given row.

## nextBucketNr()

Bool casacore::ISMIndex::nextBucketNr | ( | uInt & | cursor,
|  | rownr_t & | bucketStartRow,
|  | rownr_t & | bucketNrrow,
|  | uInt & | bucketNr ) const

Get the number of the next bucket from the index and return it in bucketNr.

The starting row of that bucket and the number of rows in the bucket are also returned. Return status False indicates that no more buckets are available.
The start of the iteration is indicated by cursor=0. The first bucket returned is the bucket containing the rownr given in bucketStartRow (thus set bucketStartRow to 0 if you want to start at the first bucket).
The next iterations return the next bucket number and fill the starting row and number of rows.

## operator=()

ISMIndex & casacore::ISMIndex::operator= | ( | const ISMIndex & |  | ) |

delete

Forbid assignment.

References ISMIndex().

## put()

void casacore::ISMIndex::put | ( | AipsIO & | os | ) |

Write the bucket index into the AipsIO object.

## removeRow()

Int casacore::ISMIndex::removeRow | ( | rownr_t | rownr | ) |

Remove a row from the index.

If the result of this is that the entire bucket gets empty, that bucketnr is returned. Otherwise -1 is returned.

## show()

void casacore::ISMIndex::show | ( | std::ostream & |  | ) | const

Show the index.

## Member Data Documentation

## bucketNr_p

Block<uInt> casacore::ISMIndex::bucketNr_p

private

Corresponding bucket number.

Definition at line 143 of file ISMIndex.h.

## nused_p

uInt casacore::ISMIndex::nused_p

private

Number of entries used.

Definition at line 139 of file ISMIndex.h.

## rows_p

Block<rownr_t> casacore::ISMIndex::rows_p

private

Rownr index (i.e.

row rows_p[i] starts in bucketNr_p[i]).

Definition at line 141 of file ISMIndex.h.

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

- tables/DataMan/ISMIndex.h