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

More...

`#include <RefTable.h>`

## Public Member Functions

| RefTable (BaseTable *, Bool rowOrder, rownr_t initialNrrow)
| Create a reference table object referencing the given BaseTable object.
| RefTable (BaseTable *, const Vector< rownr_t > &rowNumbers)
| A RefTable with the given row numbers is constructed.
| RefTable (BaseTable *, const Vector< Bool > &rowMask)
| Create a reference table object out of a mask.
| RefTable (BaseTable *, const Vector< String > &columnNames)
| Create a reference table object via projection (i.e.
| RefTable (AipsIO &, const String &name, rownr_t nrrow, int option, const TableLock &lockOptions, const TSMOption &tsmOption)
| Create a reference table out of a file (written by writeRefTable).
virtual | ~RefTable ()
| The destructor flushes (i.e.
| RefTable (const RefTable &)=delete
| Copy constructor is forbidden, because copying a table requires some more knowledge (like table name of result).
RefTable & | operator= (const RefTable &)=delete
| Assignment is forbidden, because copying a table requires some more knowledge (like table name of result).
virtual void | reopenRW ()
| Try to reopen the table (the underlying one) for read/write access.
virtual Bool | asBigEndian () const
| Is the table stored in big or little endian format?
virtual const StorageOption & | storageOption () const
| Get the storage option used for the table.
virtual Bool | isMultiUsed (Bool checkSubTable) const
| Is the table in use (i.e.
virtual const TableLock & | lockOptions () const
| Get the locking info.
virtual void | mergeLock (const TableLock &lockOptions)
| Merge the given lock info with the existing one.
virtual Bool | hasLock (FileLocker::LockType) const
| Has this process the read or write lock, thus can the table be read or written safely?
virtual Bool | lock (FileLocker::LockType, uInt nattempts)
| Try to lock the table for read or write access.
virtual void | unlock ()
| Unlock the table.
virtual void | flush (Bool fsync, Bool recursive)
| Flush the table, i.e.
virtual void | resync ()
| Resync the Table object with the table file.
virtual uInt | getModifyCounter () const
| Get the modify counter.
virtual Bool | isWritable () const
| Test if the parent table is opened as writable.
void | getRef (AipsIO &, int option, const TableLock &lockOptions, const TSMOption &tsmOption)
| Read a reference table from a file.
virtual void | copy (const String &newName, int tableOption) const
| This is doing a shallow copy.
virtual void | deepCopy (const String &newName, const Record &dataManagerInfo, const StorageOption &, int tableOption, Bool, int endianFormat, Bool noRows) const
| Copy the table and all its subtables.
virtual int | tableType () const
| It returns the type of the parent table.
virtual TableDesc | actualTableDesc () const
| Get the actual table description.
virtual Record | dataManagerInfo () const
| Get the data manager info.
virtual TableRecord & | keywordSet ()
| Get readonly access to the table keyword set.
virtual TableRecord & | rwKeywordSet ()
| Get read/write access to the table keyword set.
virtual BaseColumn * | getColumn (uInt columnIndex) const
| Get a column object using its index.
virtual BaseColumn * | getColumn (const String &columnName) const
| Get a column object using its name.
virtual Bool | canRemoveRow () const
| Test if it is possible to remove a row from this table.
virtual void | removeRow (rownr_t rownr)
| Remove the given row.
virtual void | removeAllRow ()
| Remove the given row.
virtual void | addColumn (const ColumnDesc &columnDesc, Bool addToParent)
| Add one or more columns to the table.
virtual void | addColumn (const ColumnDesc &columnDesc, const String &dataManager, Bool byName, Bool addToParent)
virtual void | addColumn (const ColumnDesc &columnDesc, const DataManager &dataManager, Bool addToParent)
virtual void | addColumn (const TableDesc &tableDesc, const DataManager &dataManager, Bool addToParent)
virtual Bool | canRemoveColumn (const Vector< String > &columnNames) const
| Test if columns can be removed (yes).
virtual void | removeColumn (const Vector< String > &columnNames)
| Remove columns.
virtual Bool | canRenameColumn (const String &columnName) const
| Test if a column can be renamed (yes).
virtual void | renameColumn (const String &newName, const String &oldName)
| Rename a column.
virtual void | renameHypercolumn (const String &newName, const String &oldName)
| Rename a hypercolumn.
virtual DataManager * | findDataManager (const String &name, Bool byColumn) const
| Find the data manager with the given name or for the given column.
virtual Vector< rownr_t > | rowNumbers () const
| Get a vector of row numbers.
virtual BaseTable * | root ()
| Get parent of this table.
rownr_t | rootRownr (rownr_t rownr) const
| Get rownr in root table.
Vector< rownr_t > | rootRownr (const Vector< rownr_t > &rownrs) const
| Get vector of rownrs in root table.
virtual Bool | rowOrder () const
| Tell if the table is in row order.
virtual Vector< rownr_t > & | rowStorage ()
| Get row number vector.
void | addRownr (rownr_t rownr)
| Add a rownr to reference table.
void | addRownrRange (rownr_t startRownr, rownr_t endRownr)
void | setNrrow (rownr_t nrrow)
| Set the exact number of rows in the table.
virtual Bool | adjustRownrs (rownr_t nrrow, Vector< rownr_t > &rownrs, Bool determineOrder) const
| Adjust the row numbers to be the actual row numbers in the root table.
void | refAnd (rownr_t nr1, const rownr_t *rows1, rownr_t nr2, const rownr_t *rows2)
| And, or, subtract or xor the row numbers of 2 tables.
void | refOr (rownr_t nr1, const rownr_t *rows1, rownr_t nr2, const rownr_t *rows2)
void | refSub (rownr_t nr1, const rownr_t *rows1, rownr_t nr2, const rownr_t *rows2)
void | refXor (rownr_t nr1, const rownr_t *rows1, rownr_t nr2, const rownr_t *rows2)
void | refNot (rownr_t nr1, const rownr_t *rows1, rownr_t nrmain)
Public Member Functions inherited from casacore::BaseTable
| BaseTable (const String &tableName, int tableOption, rownr_t nrrow)
| Initialize the object.
| BaseTable (MPI_Comm mpiComm, const String &tableName, int tableOption, rownr_t nrrow)
| MPI version of the constructor.
void | BaseTableCommon (const String &tableName, int tableOption, rownr_t nrrow)
| Common code shared by the MPI constructor and non-MPI constructor.
virtual | ~BaseTable ()
| The destructor will delete the table if needed.
| BaseTable (const BaseTable &)=delete
| Copy constructor is forbidden, because copying a table requires some more knowledge (like table name of result).
BaseTable & | operator= (const BaseTable &)=delete
| Assignment is forbidden, because copying a table requires some more knowledge (like table name of result).
virtual Bool | isNull () const
| Is the table a null table?
virtual void | changeTiledDataOnly ()
| Indicate we will only modify data values in existing tiled columns.
virtual void | setTableChanged ()
| Set the table to being changed.
void | doNotWrite ()
| Do not write the table (used in in case of exceptions).
Bool | isColumnWritable (const String &columnName) const
| Test if the given column is writable.
Bool | isColumnWritable (uInt columnIndex) const
Bool | isColumnStored (const String &columnName) const
| Test if the given column is stored (otherwise it is virtual).
Bool | isColumnStored (uInt columnIndex) const
const String & | tableName () const
| Get the table name.
virtual void | rename (const String &newName, int tableOption)
| Rename the table.
int | tableOption () const
| Get the table option.
void | markForDelete (Bool callback, const String &oldName)
| Mark the table for delete.
void | unmarkForDelete (Bool callback, const String &oldName)
| Unmark the table for delete.
Bool | isMarkedForDelete () const
| Test if the table is marked for delete.
const TableDesc & | tableDesc () const
| Get the table description.
void | showStructure (std::ostream &, Bool showDataMan, Bool showColumns, Bool showSubTables, Bool sortColumns, Bool cOrder)
| Show the table structure (implementation of Table::showStructure).
TableInfo & | tableInfo ()
| Get access to the TableInfo object.
virtual void | flushTableInfo ()
| Write the TableInfo object.
rownr_t | nrow () const
| Get number of rows.
virtual Bool | canAddRow () const
| Test if it is possible to add a row to this table.
virtual void | addRow (rownr_t nrrow=1, Bool initialize=True)
| Add one or more rows and possibly initialize them.
void | removeRow (const Vector< rownr_t > &rownrs)
void | removeRow (const Vector< uInt > &rownrs)
std::shared_ptr< BaseTable > | select (const TableExprNode &, rownr_t maxRow, rownr_t offset)
| Select rows using the given expression (which can be null).
std::shared_ptr< BaseTable > | select (rownr_t maxRow, rownr_t offset)
| Select maxRow rows and skip first offset rows.
std::shared_ptr< BaseTable > | select (const Vector< rownr_t > &rownrs)
| Select rows using a vector of row numbers.
std::shared_ptr< BaseTable > | select (const Block< Bool > &mask)
| Select rows using a mask block.
std::shared_ptr< BaseTable > | project (const Block< String > &columnNames)
| Project the given columns (i.e.
std::shared_ptr< BaseTable > | tabAnd (BaseTable *)
| Do logical operations on a table.
std::shared_ptr< BaseTable > | tabOr (BaseTable *)
| union with another table
std::shared_ptr< BaseTable > | tabSub (BaseTable *)
| subtract another table
std::shared_ptr< BaseTable > | tabXor (BaseTable *)
| xor with another table
std::shared_ptr< BaseTable > | tabNot ()
| take complement
std::shared_ptr< BaseTable > | sort (const Block< String > &columnNames, const Block< std::shared_ptr< BaseCompare > > &compareObjects, const Block< Int > &sortOrder, int sortOption, std::shared_ptr< Vector< rownr_t > > sortIterBoundaries=nullptr, std::shared_ptr< Vector< size_t > > sortIterKeyIdxChange=nullptr)
| Sort a table on one or more columns of scalars.
BaseTableIterator * | makeIterator (const Block< String > &columnNames, const Block< std::shared_ptr< BaseCompare > > &, const Block< Int > &orders, int option, bool cacheIterationBoundaries=false)
| Create an iterator.
void | addColumns (const TableDesc &tableDesc, const Record &dmInfo, Bool addToParent)
| Add one or more columns to the table.
Bool | checkRemoveColumn (const Vector< String > &columnNames, Bool throwException) const
| Check if the set of columns can be removed.
virtual std::shared_ptr< BaseTable > | doSort (Block< BaseColumn * > &, const Block< std::shared_ptr< BaseCompare > > &, const Block< Int > &sortOrder, int sortOption, std::shared_ptr< Vector< rownr_t > > sortIterBoundaries, std::shared_ptr< Vector< size_t > > sortIterKeyIdxChange)
| Do the actual sort.
std::shared_ptr< RefTable > | makeRefTable (Bool rowOrder, rownr_t initialNrrow)
| Create a RefTable object.
void | checkRowNumber (rownr_t rownr) const
| Check if the row number is valid.
int | traceId () const
| Get the table's trace-id.

## Static Public Member Functions

static void | getLayout (TableDesc &desc, AipsIO &ios)
| Return the layout of a table (i.e.
Static Public Member Functions inherited from casacore::BaseTable
static TableInfo | tableInfo (const String &tableName)
| Get the table info of the table with the given name.

## Private Member Functions

virtual void | getPartNames (Block< String > &names, Bool recursive) const
| Get the names of the tables this table consists of.
void | showStructureExtra (std::ostream &) const
| Show the extra table structure info (name of root table).
void | setup (BaseTable *btp, const Vector< String > &columnNames)
| Setup the main parts of the object.
void | makeRefCol ()
| Create the RefColumn objects for all columns in the description.
void | writeRefTable (Bool fsync)
| Write a reference table.
void | copyRefTable (const String &newName, int tableOption)
| Copy a RefTable that is not persistent.
Bool | checkAddColumn (const String &name, Bool addToParent)
| Check if a column can be added.
void | addRefCol (const ColumnDesc &cd)
| Add a column.
void | addRefCol (const TableDesc &tdesc)
| Add multiple columns.

## Static Private Member Functions

static void | makeDesc (TableDesc &desc, const TableDesc &rootDesc, std::map< String, String > &nameMap, Vector< String > &names)
| Make a table description for the given columns.

## Private Attributes

std::shared_ptr< BaseTable > | baseTabPtr_p
Bool | rowOrd_p
Vector< rownr_t > | rowStorage_p
std::map< String, String > | nameMap_p
std::map< String, RefColumn * > | colMap_p
Bool | changed_p

## Additional Inherited Members

Protected Member Functions inherited from casacore::BaseTable
void | scratchCallback (Bool isScratch, const String &oldName) const
| Do the callback for scratch tables (if callback is set).
Bool | makeTableDir ()
| Create the table directory when needed (and possible).
void | trueDeepCopy (const String &newName, const Record &dataManagerInfo, const StorageOption &, int tableOption, int endianFormat, Bool noRows) const
| Make a true deep copy of the table.
void | prepareCopyRename (const String &newName, int tableOption) const
| Prepare for copying or renaming a table.
virtual void | renameSubTables (const String &newName, const String &oldName)
| Rename the subtables (used by rename function).
void | throwIfTableExists ()
| Check if the table already exists.
Bool | openedForWrite () const
| Test if the table is opened for write.
void | writeStart (AipsIO &, Bool bigEndian)
| Start writing a table.
void | writeEnd (AipsIO &)
| End writing a table.
Bool | shouldNotWrite () const
| Should the table be written.
void | getTableInfo ()
| Read the TableInfo object.
Protected Attributes inherited from casacore::BaseTable
std::weak_ptr< BaseTable > | thisPtr_p
rownr_t | nrrow_p
rownr_t | nrrowToAdd_p
std::shared_ptr< TableDesc > | tdescPtr_p
String | name_p
int | option_p
Bool | noWrite_p
Bool | delete_p
TableInfo | info_p
Bool | madeDir_p
int | itsTraceId

## Detailed Description

Class for a table as a view of another table

### Intended use:

Internal

### Review Status

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

### Prerequisite

- BaseTable
- RefColumn

### Etymology

RefTable represents a table which is a view on another table, thus which references another table.

### Synopsis

RefTable is used to make a view on another table. Usually it is a view on a subset of the table, either in vertical or horizontal direction. Thus a subset of rows and/or columns. It will be the result of a select, sort, project or iterate function.

It acts to the user as a normal table. All gets and puts are handled by RefColumn which directs them to the referenced column while (if needed) converting the given row number to the row number in the referenced table. For that purpose RefTable maintains a Vector of the row numbers in the referenced table.

The RefTable constructor acts in a way that it will always reference the original table. This means that if a select is done on a RefTable, the resulting RefTable will also reference the original PlainTable. This is done to avoid long chains of RefTables. However, if ever some other kind of table views are introduced (like a join or a concatenation of similar tables), this cannot be used anymore. Most software already anticipates on that. The only exception is the code anding, oring tables (refAnd, etc.).

### To Do

- Maybe not allocating the row number vector for a projection. This saves space and time, but each rownr conversion will take a bit more time because it has to test if there is a vector.
- Maybe maintain a Vector<String> telling on which columns the table is ordered. This may speed up selection, but it is hard to check if the order is changed by a put.
- Allow to remove a row or column from the RefTable
- Allow to rename a column in the RefTable
- Maybe implement doSort one time for a more efficient sort. (now everything is handled by BaseTable).

Definition at line 102 of file RefTable.h.

## Constructor & Destructor Documentation

## RefTable() [1/6]

casacore::RefTable::RefTable | ( | BaseTable * | ,
|  | Bool | rowOrder,
|  | rownr_t | initialNrrow )

Create a reference table object referencing the given BaseTable object.

If the BaseTable is actually another RefTable, it will reference its referenced table (thus the original table) and it will take its vector of row numbers and projected column names into account. Thus if a select is done on a projected table, the resulting RefTable will have the same projection.

Construct a RefTable with an empty row number vector. rowOrder=True indicates that the order of the rows will not be disturbed (as will be the case for a sort). A row number vector of the given size is initially allocated. Later this RefTable will be filled in by the select, etc..

References casacore::BaseTable::BaseTable(), and rowOrder().

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

## RefTable() [2/6]

casacore::RefTable::RefTable | ( | BaseTable * | ,
|  | const Vector< rownr_t > & | rowNumbers )

A RefTable with the given row numbers is constructed.

References casacore::BaseTable::BaseTable(), and rowNumbers().

## RefTable() [3/6]

casacore::RefTable::RefTable | ( | BaseTable * | ,
|  | const Vector< Bool > & | rowMask )

Create a reference table object out of a mask.

The row number vector will consist of the rows for which the mask has a True value. The length of the mask must be the number of rows in the BaseTable.

References casacore::BaseTable::BaseTable().

## RefTable() [4/6]

casacore::RefTable::RefTable | ( | BaseTable * | ,
|  | const Vector< String > & | columnNames )

Create a reference table object via projection (i.e.

column selection). The row number vector is a copy of the given table.

References casacore::BaseTable::BaseTable().

## RefTable() [5/6]

casacore::RefTable::RefTable | ( | AipsIO & | ,
|  | const String & | name,
|  | rownr_t | nrrow,
|  | int | option,
|  | const TableLock & | lockOptions,
|  | const TSMOption & | tsmOption )

Create a reference table out of a file (written by writeRefTable).

The referenced table will also be created (if not stored in the cache).

References lockOptions(), and casacore::name().

## ~RefTable()

virtual casacore::RefTable::~RefTable | ( |  | ) |

virtual

The destructor flushes (i.e.

writes) the table if it is opened for output and not marked for delete.

## RefTable() [6/6]

casacore::RefTable::RefTable | ( | const RefTable & |  | ) |

delete

Copy constructor is forbidden, because copying a table requires some more knowledge (like table name of result).

References RefTable().

## Member Function Documentation

## actualTableDesc()

virtual TableDesc casacore::RefTable::actualTableDesc | ( |  | ) | const

virtual

Get the actual table description.

Implements casacore::BaseTable.

## addColumn() [1/4]

virtual void casacore::RefTable::addColumn | ( | const ColumnDesc & | columnDesc,
|  | Bool | addToParent )

virtual

Add one or more columns to the table.

The column is added to the parent table if told so and if not existing.

Reimplemented from casacore::BaseTable.

## addColumn() [2/4]

virtual void casacore::RefTable::addColumn | ( | const ColumnDesc & | columnDesc,
|  | const DataManager & | dataManager,
|  | Bool | addToParent )

virtual

Reimplemented from casacore::BaseTable.

## addColumn() [3/4]

virtual void casacore::RefTable::addColumn | ( | const ColumnDesc & | columnDesc,
|  | const String & | dataManager,
|  | Bool | byName,
|  | Bool | addToParent )

virtual

Reimplemented from casacore::BaseTable.

## addColumn() [4/4]

virtual void casacore::RefTable::addColumn | ( | const TableDesc & | tableDesc,
|  | const DataManager & | dataManager,
|  | Bool | addToParent )

virtual

Reimplemented from casacore::BaseTable.

References casacore::BaseTable::tableDesc().

## addRefCol() [1/2]

void casacore::RefTable::addRefCol | ( | const ColumnDesc & | cd | ) |

private

Add a column.

## addRefCol() [2/2]

void casacore::RefTable::addRefCol | ( | const TableDesc & | tdesc | ) |

private

Add multiple columns.

## addRownr()

void casacore::RefTable::addRownr | ( | rownr_t | rownr | ) |

Add a rownr to reference table.

## addRownrRange()

void casacore::RefTable::addRownrRange | ( | rownr_t | startRownr,
|  | rownr_t | endRownr )

## adjustRownrs()

virtual Bool casacore::RefTable::adjustRownrs | ( | rownr_t | nrrow,
|  | Vector< rownr_t > & | rownrs,
|  | Bool | determineOrder ) const

virtual

Adjust the row numbers to be the actual row numbers in the root table.

This is, for instance, used when a RefTable is sorted. Optionally it also determines if the resulting rows are in row order.

Reimplemented from casacore::BaseTable.

## asBigEndian()

virtual Bool casacore::RefTable::asBigEndian | ( |  | ) | const

virtual

Is the table stored in big or little endian format?

Implements casacore::BaseTable.

## canRemoveColumn()

virtual Bool casacore::RefTable::canRemoveColumn | ( | const Vector< String > & | columnNames | ) | const

virtual

Test if columns can be removed (yes).

Implements casacore::BaseTable.

## canRemoveRow()

virtual Bool casacore::RefTable::canRemoveRow | ( |  | ) | const

virtual

Test if it is possible to remove a row from this table.

Reimplemented from casacore::BaseTable.

## canRenameColumn()

virtual Bool casacore::RefTable::canRenameColumn | ( | const String & | columnName | ) | const

virtual

Test if a column can be renamed (yes).

Implements casacore::BaseTable.

## checkAddColumn()

Bool casacore::RefTable::checkAddColumn | ( | const String & | name,
|  | Bool | addToParent )

private

Check if a column can be added.

Return True if it can and must be added to the parent table first.

References casacore::name().

## copy()

virtual void casacore::RefTable::copy | ( | const String & | newName,
|  | int | tableOption ) const

virtual

This is doing a shallow copy.

It gives an error if the RefTable has not been stored yet.

Reimplemented from casacore::BaseTable.

References casacore::BaseTable::tableOption().

## copyRefTable()

void casacore::RefTable::copyRefTable | ( | const String & | newName,
|  | int | tableOption )

private

Copy a RefTable that is not persistent.

It requires some special logic.

References casacore::BaseTable::tableOption().

## dataManagerInfo()

virtual Record casacore::RefTable::dataManagerInfo | ( |  | ) | const

virtual

Get the data manager info.

Implements casacore::BaseTable.

References casacore::Record().

Referenced by deepCopy().

## deepCopy()

virtual void casacore::RefTable::deepCopy | ( | const String & | newName,
|  | const Record & | dataManagerInfo,
|  | const StorageOption & | ,
|  | int | tableOption,
|  | Bool | ,
|  | int | endianFormat,
|  | Bool | noRows ) const

virtual

Copy the table and all its subtables.

It copies the contents of each row to get a real copy.

Reimplemented from casacore::BaseTable.

References dataManagerInfo(), casacore::Record(), and casacore::BaseTable::tableOption().

## findDataManager()

virtual DataManager * casacore::RefTable::findDataManager | ( | const String & | name,
|  | Bool | byColumn ) const

virtual

Find the data manager with the given name or for the given column.

Implements casacore::BaseTable.

References casacore::name().

## flush()

virtual void casacore::RefTable::flush | ( | Bool | fsync,
|  | Bool | recursive )

virtual

Flush the table, i.e.

write it to disk. Nothing will be done if the table is not writable. A flush can be executed at any time. When a table is marked for delete, the destructor will remove files written by intermediate flushes. Note that if necessary the destructor will do an implicit flush, unless it is executed due to an exception.

Implements casacore::BaseTable.

## getColumn() [1/2]

virtual BaseColumn * casacore::RefTable::getColumn | ( | const String & | columnName | ) | const

virtual

Get a column object using its name.

Implements casacore::BaseTable.

## getColumn() [2/2]

virtual BaseColumn * casacore::RefTable::getColumn | ( | uInt | columnIndex | ) | const

virtual

Get a column object using its index.

Implements casacore::BaseTable.

## getLayout()

void casacore::RefTable::getLayout | ( | TableDesc & | desc,
|  | AipsIO & | ios )

static

Return the layout of a table (i.e.

description and #rows). This function has the advantage that only the minimal amount of information required is read from the table, thus it is much faster than a normal table open.
The number of rows is returned. The description of the table is stored in desc (its contents will be overwritten).

## getModifyCounter()

virtual uInt casacore::RefTable::getModifyCounter | ( |  | ) | const

virtual

Get the modify counter.

Implements casacore::BaseTable.

## getPartNames()

virtual void casacore::RefTable::getPartNames | ( | Block< String > & | names,
|  | Bool | recursive ) const

private virtual

Get the names of the tables this table consists of.

Reimplemented from casacore::BaseTable.

## getRef()

void casacore::RefTable::getRef | ( | AipsIO & | ,
|  | int | option,
|  | const TableLock & | lockOptions,
|  | const TSMOption & | tsmOption )

Read a reference table from a file.

The referenced table will also be created (if not stored in the cache).

References lockOptions().

## hasLock()

virtual Bool casacore::RefTable::hasLock | ( | FileLocker::LockType |  | ) | const

virtual

Has this process the read or write lock, thus can the table be read or written safely?

Implements casacore::BaseTable.

## isMultiUsed()

virtual Bool casacore::RefTable::isMultiUsed | ( | Bool | checkSubTable | ) | const

virtual

Is the table in use (i.e.

open) in another process? It always returns False.

Implements casacore::BaseTable.

## isWritable()

virtual Bool casacore::RefTable::isWritable | ( |  | ) | const

virtual

Test if the parent table is opened as writable.

Implements casacore::BaseTable.

## keywordSet()

virtual TableRecord & casacore::RefTable::keywordSet | ( |  | ) |

virtual

Get readonly access to the table keyword set.

Implements casacore::BaseTable.

## lock()

virtual Bool casacore::RefTable::lock | ( | FileLocker::LockType | ,
|  | uInt | nattempts )

virtual

Try to lock the table for read or write access.

Implements casacore::BaseTable.

## lockOptions()

virtual const TableLock & casacore::RefTable::lockOptions | ( |  | ) | const

virtual

Get the locking info.

Implements casacore::BaseTable.

Referenced by getRef(), mergeLock(), and RefTable().

## makeDesc()

void casacore::RefTable::makeDesc | ( | TableDesc & | desc,
|  | const TableDesc & | rootDesc,
|  | std::map< String, String > & | nameMap,
|  | Vector< String > & | names )

static private

Make a table description for the given columns.

## makeRefCol()

void casacore::RefTable::makeRefCol | ( |  | ) |

private

Create the RefColumn objects for all columns in the description.

## mergeLock()

virtual void casacore::RefTable::mergeLock | ( | const TableLock & | lockOptions | ) |

virtual

Merge the given lock info with the existing one.

Implements casacore::BaseTable.

References lockOptions().

## operator=()

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

delete

Assignment is forbidden, because copying a table requires some more knowledge (like table name of result).

References RefTable().

## refAnd()

void casacore::RefTable::refAnd | ( | rownr_t | nr1,
|  | const rownr_t * | rows1,
|  | rownr_t | nr2,
|  | const rownr_t * | rows2 )

And, or, subtract or xor the row numbers of 2 tables.

## refNot()

void casacore::RefTable::refNot | ( | rownr_t | nr1,
|  | const rownr_t * | rows1,
|  | rownr_t | nrmain )

## refOr()

void casacore::RefTable::refOr | ( | rownr_t | nr1,
|  | const rownr_t * | rows1,
|  | rownr_t | nr2,
|  | const rownr_t * | rows2 )

## refSub()

void casacore::RefTable::refSub | ( | rownr_t | nr1,
|  | const rownr_t * | rows1,
|  | rownr_t | nr2,
|  | const rownr_t * | rows2 )

## refXor()

void casacore::RefTable::refXor | ( | rownr_t | nr1,
|  | const rownr_t * | rows1,
|  | rownr_t | nr2,
|  | const rownr_t * | rows2 )

## removeAllRow()

virtual void casacore::RefTable::removeAllRow | ( |  | ) |

virtual

Remove the given row.

## removeColumn()

virtual void casacore::RefTable::removeColumn | ( | const Vector< String > & | columnNames | ) |

virtual

Remove columns.

Implements casacore::BaseTable.

## removeRow()

virtual void casacore::RefTable::removeRow | ( | rownr_t | rownr | ) |

virtual

Remove the given row.

Reimplemented from casacore::BaseTable.

## renameColumn()

virtual void casacore::RefTable::renameColumn | ( | const String & | newName,
|  | const String & | oldName )

virtual

Rename a column.

Implements casacore::BaseTable.

## renameHypercolumn()

virtual void casacore::RefTable::renameHypercolumn | ( | const String & | newName,
|  | const String & | oldName )

virtual

Rename a hypercolumn.

Implements casacore::BaseTable.

## reopenRW()

virtual void casacore::RefTable::reopenRW | ( |  | ) |

virtual

Try to reopen the table (the underlying one) for read/write access.

An exception is thrown if the table is not writable. Nothing is done if the table is already open for read/write.

Implements casacore::BaseTable.

## resync()

virtual void casacore::RefTable::resync | ( |  | ) |

virtual

Resync the Table object with the table file.

Implements casacore::BaseTable.

## root()

virtual BaseTable * casacore::RefTable::root | ( |  | ) |

virtual

Get parent of this table.

Reimplemented from casacore::BaseTable.

References casacore::BaseTable::BaseTable().

## rootRownr() [1/2]

Vector< rownr_t > casacore::RefTable::rootRownr | ( | const Vector< rownr_t > & | rownrs | ) | const

Get vector of rownrs in root table.

This converts the given row numbers to row numbers in the root table.

## rootRownr() [2/2]

rownr_t casacore::RefTable::rootRownr | ( | rownr_t | rownr | ) | const

inline

Get rownr in root table.

This converts the given row number to the row number in the root table.

Definition at line 388 of file RefTable.h.

References rowStorage_p.

## rowNumbers()

virtual Vector< rownr_t > casacore::RefTable::rowNumbers | ( |  | ) | const

virtual

Get a vector of row numbers.

Reimplemented from casacore::BaseTable.

Referenced by RefTable().

## rowOrder()

virtual Bool casacore::RefTable::rowOrder | ( |  | ) | const

virtual

Tell if the table is in row order.

Reimplemented from casacore::BaseTable.

Referenced by RefTable().

## rowStorage()

virtual Vector< rownr_t > & casacore::RefTable::rowStorage | ( |  | ) |

virtual

Get row number vector.

This is used by the BaseTable logic and sort routines.

Reimplemented from casacore::BaseTable.

## rwKeywordSet()

virtual TableRecord & casacore::RefTable::rwKeywordSet | ( |  | ) |

virtual

Get read/write access to the table keyword set.

This requires that the table is locked (or it gets locked when using AutoLocking mode).

Implements casacore::BaseTable.

## setNrrow()

void casacore::RefTable::setNrrow | ( | rownr_t | nrrow | ) |

Set the exact number of rows in the table.

An exception is thrown if more than current nrrow.

## setup()

void casacore::RefTable::setup | ( | BaseTable * | btp,
|  | const Vector< String > & | columnNames )

private

Setup the main parts of the object.

First create the name map (mapping column name in RefTable to the column in the original table). If the BaseTable is a RefTable, use its name map. Otherwise create the initial name map from the table description. A rename might change the map.
Create the RefColumn objects.
Create the initial TableInfo as a copy of the original BaseTable.

References casacore::BaseTable::BaseTable().

## showStructureExtra()

void casacore::RefTable::showStructureExtra | ( | std::ostream & |  | ) | const

private virtual

Show the extra table structure info (name of root table).

Reimplemented from casacore::BaseTable.

## storageOption()

virtual const StorageOption & casacore::RefTable::storageOption | ( |  | ) | const

virtual

Get the storage option used for the table.

Implements casacore::BaseTable.

## tableType()

virtual int casacore::RefTable::tableType | ( |  | ) | const

virtual

It returns the type of the parent table.

Reimplemented from casacore::BaseTable.

## unlock()

virtual void casacore::RefTable::unlock | ( |  | ) |

virtual

Unlock the table.

This will also synchronize the table data, thus force the data to be written to disk.

Implements casacore::BaseTable.

## writeRefTable()

void casacore::RefTable::writeRefTable | ( | Bool | fsync | ) |

private

Write a reference table.

## Member Data Documentation

## baseTabPtr_p

std::shared_ptr<BaseTable> casacore::RefTable::baseTabPtr_p

private

Definition at line 339 of file RefTable.h.

## changed_p

Bool casacore::RefTable::changed_p

private

Definition at line 344 of file RefTable.h.

## colMap_p

std::map<String,RefColumn*> casacore::RefTable::colMap_p

private

Definition at line 343 of file RefTable.h.

## nameMap_p

std::map<String,String> casacore::RefTable::nameMap_p

private

Definition at line 342 of file RefTable.h.

## rowOrd_p

Bool casacore::RefTable::rowOrd_p

private

Definition at line 340 of file RefTable.h.

## rowStorage_p

Vector<rownr_t> casacore::RefTable::rowStorage_p

private

Definition at line 341 of file RefTable.h.

Referenced by rootRownr().

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

- tables/Tables/RefTable.h