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

Abstract base class for tables. More...

#include <BaseTable.h>

Inheritance diagram for casacore::BaseTable:
casacore::ConcatTable casacore::MemoryTable casacore::NullTable casacore::PlainTable casacore::RefTable

Public Member Functions

 BaseTable (const String &tableName, int tableOption, uInt nrrow)
 Initialize the object. More...
 
void BaseTableCommon (const String &tableName, int tableOption, uInt nrrow)
 Common code shared by the MPI constructor and non-MPI constructor. More...
 
virtual ~BaseTable ()
 
void link ()
 Link to this BaseTable object (i.e. More...
 
virtual Bool isNull () const
 Is the table a null table? By default it is not. More...
 
virtual void reopenRW ()=0
 Reopen the table for read/write. More...
 
virtual Bool asBigEndian () const =0
 Is the table stored in big or little endian format? More...
 
virtual const StorageOptionstorageOption () const =0
 Get the storage option used for the table. More...
 
virtual Bool isMultiUsed (Bool checkSubTables) const =0
 Is the table in use (i.e. More...
 
virtual const TableLocklockOptions () const =0
 Get the locking info. More...
 
virtual void mergeLock (const TableLock &lockOptions)=0
 Merge the given lock info with the existing one. More...
 
virtual Bool hasLock (FileLocker::LockType) const =0
 Has this process the read or write lock, thus can the table be read or written safely? More...
 
virtual Bool lock (FileLocker::LockType, uInt nattempts)=0
 Try to lock the table for read or write access. More...
 
virtual void unlock ()=0
 Unlock the table. More...
 
virtual void flush (Bool fsync, Bool recursive)=0
 Flush the table, i.e. More...
 
virtual void resync ()=0
 Resync the Table object with the table file. More...
 
virtual uInt getModifyCounter () const =0
 Get the modify counter. More...
 
virtual void setTableChanged ()
 Set the table to being changed. More...
 
void doNotWrite ()
 Do not write the table (used in in case of exceptions). More...
 
virtual Bool isWritable () const =0
 Test if this table is writable. More...
 
Bool isColumnWritable (const String &columnName) const
 Test if the given column is writable. More...
 
Bool isColumnWritable (uInt columnIndex) const
 
Bool isColumnStored (const String &columnName) const
 Test if the given column is stored (otherwise it is virtual). More...
 
Bool isColumnStored (uInt columnIndex) const
 
const StringtableName () const
 Get the table name. More...
 
virtual void getPartNames (Block< String > &names, Bool recursive) const
 Get the names of the tables this table consists of. More...
 
virtual void rename (const String &newName, int tableOption)
 Rename the table. More...
 
virtual void copy (const String &newName, int tableOption) const
 Copy the table and all its subtables. More...
 
virtual void deepCopy (const String &newName, const Record &dataManagerInfo, const StorageOption &, int tableOption, Bool valueCopy, int endianFormat, Bool noRows) const
 
virtual int tableType () const
 Get the table type. More...
 
int tableOption () const
 Get the table option. More...
 
void markForDelete (Bool callback, const String &oldName)
 Mark the table for delete. More...
 
void unmarkForDelete (Bool callback, const String &oldName)
 Unmark the table for delete. More...
 
Bool isMarkedForDelete () const
 Test if the table is marked for delete. More...
 
const TableDesctableDesc () const
 Get the table description. More...
 
virtual TableDesc actualTableDesc () const =0
 Get the actual table description. More...
 
virtual Record dataManagerInfo () const =0
 Get the data manager info. More...
 
void showStructure (std::ostream &, Bool showDataMan, Bool showColumns, Bool showSubTables, Bool sortColumns, Bool cOrder)
 Show the table structure (implementation of Table::showStructure). More...
 
virtual TableRecordkeywordSet ()=0
 Get readonly access to the table keyword set. More...
 
virtual TableRecordrwKeywordSet ()=0
 Get read/write access to the table keyword set. More...
 
TableInfotableInfo ()
 Get access to the TableInfo object. More...
 
virtual void flushTableInfo ()
 Write the TableInfo object. More...
 
uInt nrow () const
 Get number of rows. More...
 
virtual BaseColumngetColumn (uInt columnIndex) const =0
 Get a column object using its index. More...
 
virtual BaseColumngetColumn (const String &columnName) const =0
 Get a column object using its name. More...
 
virtual Bool canAddRow () const
 Test if it is possible to add a row to this table. More...
 
virtual void addRow (uInt nrrow=1, Bool initialize=True)
 Add one or more rows and possibly initialize them. More...
 
virtual Bool canRemoveRow () const
 Test if it is possible to remove a row from this table. More...
 
virtual void removeRow (uInt rownr)
 Remove rows. More...
 
void removeRow (const Vector< uInt > &rownrs)
 
virtual DataManagerfindDataManager (const String &name, Bool byColumn) const =0
 Find the data manager with the given name or for the given column. More...
 
BaseTableselect (const TableExprNode &, uInt maxRow, uInt offset)
 Select rows using the given expression (which can be null). More...
 
BaseTableselect (uInt maxRow, uInt offset)
 Select maxRow rows and skip first offset rows. More...
 
BaseTableselect (const Vector< uInt > &rownrs)
 Select rows using a vector of row numbers. More...
 
BaseTableselect (const Block< Bool > &mask)
 Select rows using a mask block. More...
 
BaseTableproject (const Block< String > &columnNames)
 Project the given columns (i.e. More...
 
BaseTabletabAnd (BaseTable *)
 Do logical operations on a table. More...
 
BaseTabletabOr (BaseTable *)
 union with another table More...
 
BaseTabletabSub (BaseTable *)
 subtract another table More...
 
BaseTabletabXor (BaseTable *)
 xor with another table More...
 
BaseTabletabNot ()
 take complement More...
 
BaseTablesort (const Block< String > &columnNames, const Block< CountedPtr< BaseCompare > > &compareObjects, const Block< Int > &sortOrder, int sortOption)
 Sort a table on one or more columns of scalars. More...
 
BaseTableIteratormakeIterator (const Block< String > &columnNames, const Block< CountedPtr< BaseCompare > > &, const Block< Int > &orders, int option)
 Create an iterator. More...
 
virtual void addColumn (const ColumnDesc &columnDesc, Bool addToParent)
 Add one or more columns to the table. More...
 
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)
 
void addColumns (const TableDesc &tableDesc, const Record &dmInfo, Bool addToParent)
 Add one or more columns to the table. More...
 
virtual Bool canRemoveColumn (const Vector< String > &columnNames) const =0
 Test if columns can be removed. More...
 
virtual void removeColumn (const Vector< String > &columnNames)=0
 Remove columns. More...
 
Bool checkRemoveColumn (const Vector< String > &columnNames, Bool throwException) const
 Check if the set of columns can be removed. More...
 
virtual Bool canRenameColumn (const String &columnName) const =0
 Test if a column can be renamed. More...
 
virtual void renameColumn (const String &newName, const String &oldName)=0
 Rename a column. More...
 
virtual void renameHypercolumn (const String &newName, const String &oldName)=0
 Rename a hypercolumn. More...
 
virtual Vector< uIntrowNumbers () const
 Get a vector of row numbers. More...
 
virtual BaseTableroot ()
 Get pointer to root table (i.e. More...
 
virtual Bool rowOrder () const
 Tell if the table is in row order. More...
 
virtual Vector< uInt > * rowStorage ()
 By the default the table cannot return the storage of rownrs. More...
 
virtual Bool adjustRownrs (uInt nrrow, Vector< uInt > &rownrs, Bool determineOrder) const
 Adjust the row numbers to be the actual row numbers in the root table. More...
 
virtual BaseTabledoSort (PtrBlock< BaseColumn * > &, const Block< CountedPtr< BaseCompare > > &, const Block< Int > &sortOrder, int sortOption)
 Do the actual sort. More...
 
RefTablemakeRefTable (Bool rowOrder, uInt initialNrrow)
 Create a RefTable object. More...
 
void checkRowNumber (uInt rownr) const
 Check if the row number is valid. More...
 
int traceId () const
 Get the table's trace-id. More...
 

Static Public Member Functions

static void unlink (BaseTable *)
 Unlink from a BaseTable. More...
 
static TableInfo tableInfo (const String &tableName)
 Get the table info of the table with the given name. More...
 

Protected Member Functions

void scratchCallback (Bool isScratch, const String &oldName) const
 Do the callback for scratch tables (if callback is set). More...
 
Bool makeTableDir ()
 Create the table directory when needed (and possible). More...
 
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. More...
 
void prepareCopyRename (const String &newName, int tableOption) const
 Prepare for copying or renaming a table. More...
 
virtual void renameSubTables (const String &newName, const String &oldName)
 Rename the subtables (used by rename function). More...
 
void throwIfTableExists ()
 Check if the table already exists. More...
 
Bool openedForWrite () const
 Test if the table is opened for write. More...
 
void writeStart (AipsIO &, Bool bigEndian)
 Start writing a table. More...
 
void writeEnd (AipsIO &)
 End writing a table. More...
 
Bool shouldNotWrite () const
 Should the table be written. More...
 
void getTableInfo ()
 Read the TableInfo object. More...
 

Protected Attributes

uInt nrlink_p
 
uInt nrrow_p
 
uInt nrrowToAdd_p
 
TableDesctdescPtr_p
 
String name_p
 
int option_p
 
Bool noWrite_p
 
Bool delete_p
 
TableInfo info_p
 
Bool madeDir_p
 
int itsTraceId
 

Private Member Functions

 BaseTable (const BaseTable &)
 Copy constructor is forbidden, because copying a table requires some more knowledge (like table name of result). More...
 
BaseTableoperator= (const BaseTable &)
 Assignment is forbidden, because copying a table requires some more knowledge (like table name of result). More...
 
virtual void showStructureExtra (std::ostream &) const
 Show a possible extra table structure header. More...
 
void showColumnInfo (ostream &os, const TableDesc &, uInt maxNameLength, const Array< String > &columnNames, Bool sort, Bool cOrder) const
 Show the info of the given columns. More...
 
void checkRowNumberThrow (uInt rownr) const
 Throw an exception for checkRowNumber. More...
 
void logicCheck (BaseTable *that)
 Check if the tables combined in a logical operation have the same root. More...
 
uInt logicRows (uInt *&rownrs, Bool &allocated)
 Get the rownrs of the table in ascending order to be used in the logical operation on the table. More...
 
const TableDescmakeTableDesc () const
 Make an empty table description. More...
 
String makeAbsoluteName (const String &name) const
 Make the name absolute. More...
 

Detailed Description

Abstract base class for tables.

Intended use:

Internal

Review Status

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

Prerequisite

Etymology

BaseTable is the (abstract) base class for different kind of tables.

Synopsis

BaseTables defines many virtual functions, which are actually implemented in the underlying table classes like PlainTable and RefTable. Other functions like sort and select are implemented in BaseTable itself.

The functions in BaseTable and its derived classes can only be used by the table system classes. All user access is via the envelope class Table, which references (counted) BaseTable.

To Do

Definition at line 103 of file BaseTable.h.

Constructor & Destructor Documentation

casacore::BaseTable::BaseTable ( const String tableName,
int  tableOption,
uInt  nrrow 
)

Initialize the object.

virtual casacore::BaseTable::~BaseTable ( )
virtual
casacore::BaseTable::BaseTable ( const BaseTable )
private

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

Declaring it private, makes it unusable.

Member Function Documentation

virtual TableDesc casacore::BaseTable::actualTableDesc ( ) const
pure virtual
virtual void casacore::BaseTable::addColumn ( const ColumnDesc columnDesc,
Bool  addToParent 
)
virtual

Add one or more columns to the table.

The default implementation throws an "invalid operation" exception.

Reimplemented in casacore::ConcatTable, casacore::RefTable, casacore::PlainTable, casacore::MemoryTable, and casacore::NullTable.

Referenced by casacore::Table::addColumn().

virtual void casacore::BaseTable::addColumn ( const ColumnDesc columnDesc,
const String dataManager,
Bool  byName,
Bool  addToParent 
)
virtual
virtual void casacore::BaseTable::addColumn ( const ColumnDesc columnDesc,
const DataManager dataManager,
Bool  addToParent 
)
virtual
virtual void casacore::BaseTable::addColumn ( const TableDesc tableDesc,
const DataManager dataManager,
Bool  addToParent 
)
virtual
void casacore::BaseTable::addColumns ( const TableDesc tableDesc,
const Record dmInfo,
Bool  addToParent 
)

Add one or more columns to the table.

The data manager to use is described in the record.

Referenced by casacore::Table::addColumn().

virtual void casacore::BaseTable::addRow ( uInt  nrrow = 1,
Bool  initialize = True 
)
virtual

Add one or more rows and possibly initialize them.

This will fail for tables not supporting addition of rows.

Reimplemented in casacore::PlainTable, casacore::MemoryTable, and casacore::NullTable.

Referenced by casacore::Table::addRow().

virtual Bool casacore::BaseTable::adjustRownrs ( uInt  nrrow,
Vector< uInt > &  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 order.

Reimplemented in casacore::RefTable, and casacore::NullTable.

virtual Bool casacore::BaseTable::asBigEndian ( ) const
pure virtual

Is the table stored in big or little endian format?

Implemented in casacore::ConcatTable, casacore::RefTable, casacore::PlainTable, casacore::MemoryTable, and casacore::NullTable.

void casacore::BaseTable::BaseTableCommon ( const String tableName,
int  tableOption,
uInt  nrrow 
)

Common code shared by the MPI constructor and non-MPI constructor.

virtual Bool casacore::BaseTable::canAddRow ( ) const
virtual

Test if it is possible to add a row to this table.

Reimplemented in casacore::PlainTable, casacore::MemoryTable, and casacore::NullTable.

Referenced by casacore::Table::canAddRow().

virtual Bool casacore::BaseTable::canRemoveColumn ( const Vector< String > &  columnNames) const
pure virtual
virtual Bool casacore::BaseTable::canRemoveRow ( ) const
virtual

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

Reimplemented in casacore::ConcatTable, casacore::RefTable, casacore::PlainTable, casacore::MemoryTable, and casacore::NullTable.

Referenced by casacore::Table::canRemoveRow().

virtual Bool casacore::BaseTable::canRenameColumn ( const String columnName) const
pure virtual
Bool casacore::BaseTable::checkRemoveColumn ( const Vector< String > &  columnNames,
Bool  throwException 
) const

Check if the set of columns can be removed.

It checks if columns have not been specified twice and it checks if they exist. If the flag is set an exception is thrown if errors are found.

void casacore::BaseTable::checkRowNumber ( uInt  rownr) const
inline

Check if the row number is valid.

It throws an exception if out of range.

Definition at line 482 of file BaseTable.h.

References checkRowNumberThrow(), nrrow_p, and nrrowToAdd_p.

Referenced by casacore::TableColumn::checkRowNumber().

void casacore::BaseTable::checkRowNumberThrow ( uInt  rownr) const
private

Throw an exception for checkRowNumber.

Referenced by checkRowNumber().

virtual void casacore::BaseTable::copy ( const String newName,
int  tableOption 
) const
virtual

Copy the table and all its subtables.

The default implementation of deepCopy is to call copy. The following options can be given:

Table::New
When a table with this name exists, it will be overwritten.
Table::NewNoReplace
When a table with this name already exists, an exception is thrown.
Table::Scratch
Same as Table::New, but followed by markForDelete().

Reimplemented in casacore::ConcatTable, casacore::RefTable, and casacore::MemoryTable.

virtual Record casacore::BaseTable::dataManagerInfo ( ) const
pure virtual
virtual void casacore::BaseTable::deepCopy ( const String newName,
const Record dataManagerInfo,
const StorageOption ,
int  tableOption,
Bool  valueCopy,
int  endianFormat,
Bool  noRows 
) const
virtual
void casacore::BaseTable::doNotWrite ( )
inline

Do not write the table (used in in case of exceptions).

Definition at line 175 of file BaseTable.h.

References noWrite_p, and casacore::True.

virtual BaseTable* casacore::BaseTable::doSort ( PtrBlock< BaseColumn * > &  ,
const Block< CountedPtr< BaseCompare > > &  ,
const Block< Int > &  sortOrder,
int  sortOption 
)
virtual

Do the actual sort.

The default implementation is suitable for almost all cases. Only in RefTable a smarter implementation is provided.

Reimplemented in casacore::NullTable.

virtual DataManager* casacore::BaseTable::findDataManager ( const String name,
Bool  byColumn 
) const
pure virtual

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

Implemented in casacore::ConcatTable, casacore::RefTable, casacore::PlainTable, casacore::MemoryTable, and casacore::NullTable.

Referenced by casacore::Table::findDataManager().

virtual void casacore::BaseTable::flush ( Bool  fsync,
Bool  recursive 
)
pure virtual

Flush the table, i.e.

write it to disk.

Implemented in casacore::ConcatTable, casacore::RefTable, casacore::PlainTable, casacore::MemoryTable, and casacore::NullTable.

Referenced by casacore::Table::flush().

virtual void casacore::BaseTable::flushTableInfo ( )
virtual

Write the TableInfo object.

Reimplemented in casacore::MemoryTable.

Referenced by casacore::Table::flushTableInfo().

virtual BaseColumn* casacore::BaseTable::getColumn ( uInt  columnIndex) const
pure virtual

Get a column object using its index.

Implemented in casacore::ConcatTable, casacore::RefTable, casacore::PlainTable, casacore::MemoryTable, and casacore::NullTable.

virtual BaseColumn* casacore::BaseTable::getColumn ( const String columnName) const
pure virtual

Get a column object using its name.

Implemented in casacore::ConcatTable, casacore::RefTable, casacore::PlainTable, casacore::MemoryTable, and casacore::NullTable.

virtual uInt casacore::BaseTable::getModifyCounter ( ) const
pure virtual
virtual void casacore::BaseTable::getPartNames ( Block< String > &  names,
Bool  recursive 
) const
virtual

Get the names of the tables this table consists of.

The default implementation adds the name of this table to the block.

Reimplemented in casacore::RefTable, and casacore::ConcatTable.

void casacore::BaseTable::getTableInfo ( )
protected

Read the TableInfo object.

virtual Bool casacore::BaseTable::hasLock ( FileLocker::LockType  ) const
pure virtual

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

Implemented in casacore::ConcatTable, casacore::RefTable, casacore::PlainTable, casacore::MemoryTable, and casacore::NullTable.

Referenced by casacore::Table::hasLock().

Bool casacore::BaseTable::isColumnStored ( const String columnName) const

Test if the given column is stored (otherwise it is virtual).

Referenced by casacore::Table::isColumnStored().

Bool casacore::BaseTable::isColumnStored ( uInt  columnIndex) const
Bool casacore::BaseTable::isColumnWritable ( const String columnName) const

Test if the given column is writable.

Referenced by casacore::Table::isColumnWritable().

Bool casacore::BaseTable::isColumnWritable ( uInt  columnIndex) const
Bool casacore::BaseTable::isMarkedForDelete ( ) const
inline

Test if the table is marked for delete.

Definition at line 268 of file BaseTable.h.

References delete_p.

Referenced by casacore::Table::isMarkedForDelete().

virtual Bool casacore::BaseTable::isMultiUsed ( Bool  checkSubTables) const
pure virtual

Is the table in use (i.e.

open) in another process? If checkSubTables is set, it is also checked if a subtable is used in another process.

Implemented in casacore::ConcatTable, casacore::RefTable, casacore::PlainTable, casacore::MemoryTable, and casacore::NullTable.

Referenced by casacore::Table::isMultiUsed().

virtual Bool casacore::BaseTable::isNull ( ) const
virtual

Is the table a null table? By default it is not.

Reimplemented in casacore::NullTable.

Referenced by casacore::Table::isNull().

virtual Bool casacore::BaseTable::isWritable ( ) const
pure virtual

Test if this table is writable.

This tells if values can be put into a column.

Implemented in casacore::ConcatTable, casacore::RefTable, casacore::PlainTable, casacore::MemoryTable, and casacore::NullTable.

Referenced by casacore::TableColumn::isWritable(), and casacore::Table::isWritable().

virtual TableRecord& casacore::BaseTable::keywordSet ( )
pure virtual

Get readonly access to the table keyword set.

Implemented in casacore::ConcatTable, casacore::RefTable, casacore::PlainTable, casacore::MemoryTable, and casacore::NullTable.

Referenced by casacore::Table::keywordSet().

void casacore::BaseTable::link ( )

Link to this BaseTable object (i.e.

increase reference count).

virtual Bool casacore::BaseTable::lock ( FileLocker::LockType  ,
uInt  nattempts 
)
pure virtual

Try to lock the table for read or write access.

Implemented in casacore::ConcatTable, casacore::RefTable, casacore::PlainTable, casacore::MemoryTable, and casacore::NullTable.

Referenced by casacore::Table::lock().

virtual const TableLock& casacore::BaseTable::lockOptions ( ) const
pure virtual
void casacore::BaseTable::logicCheck ( BaseTable that)
private

Check if the tables combined in a logical operation have the same root.

uInt casacore::BaseTable::logicRows ( uInt *&  rownrs,
Bool allocated 
)
private

Get the rownrs of the table in ascending order to be used in the logical operation on the table.

String casacore::BaseTable::makeAbsoluteName ( const String name) const
private

Make the name absolute.

It first checks if the name contains valid characters (not only. and /).

BaseTableIterator* casacore::BaseTable::makeIterator ( const Block< String > &  columnNames,
const Block< CountedPtr< BaseCompare > > &  ,
const Block< Int > &  orders,
int  option 
)

Create an iterator.

RefTable* casacore::BaseTable::makeRefTable ( Bool  rowOrder,
uInt  initialNrrow 
)

Create a RefTable object.

const TableDesc& casacore::BaseTable::makeTableDesc ( ) const
private

Make an empty table description.

This is used if one asks for the description of a NullTable. Creating an empty TableDesc in the NullTable takes too much time. Furthermore it causes static initialization order problems.

Referenced by tableDesc().

Bool casacore::BaseTable::makeTableDir ( )
protected

Create the table directory when needed (and possible).

When the file already exists, check if it is a directory. It returns True when it actually created the directory.

void casacore::BaseTable::markForDelete ( Bool  callback,
const String oldName 
)

Mark the table for delete.

This means that the underlying table gets deleted when it is actually destructed. The scratchCallback function is called when needed.

Referenced by casacore::Table::markForDelete().

virtual void casacore::BaseTable::mergeLock ( const TableLock lockOptions)
pure virtual

Merge the given lock info with the existing one.

Implemented in casacore::ConcatTable, casacore::RefTable, casacore::PlainTable, casacore::MemoryTable, and casacore::NullTable.

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

Get number of rows.

Definition at line 309 of file BaseTable.h.

References nrrow_p.

Referenced by casacore::Table::nrow().

Bool casacore::BaseTable::openedForWrite ( ) const
protected

Test if the table is opened for write.

BaseTable& casacore::BaseTable::operator= ( const BaseTable )
private

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

Declaring it private, makes it unusable.

void casacore::BaseTable::prepareCopyRename ( const String newName,
int  tableOption 
) const
protected

Prepare for copying or renaming a table.

It checks if the target table already exists and removes it when necessary.

BaseTable* casacore::BaseTable::project ( const Block< String > &  columnNames)

Project the given columns (i.e.

select the columns).

virtual void casacore::BaseTable::removeColumn ( const Vector< String > &  columnNames)
pure virtual
virtual void casacore::BaseTable::removeRow ( uInt  rownr)
virtual

Remove rows.

This will fail for tables not supporting removal of rows.
Tip: The following code fragments do NOT have the same result:

tab;removeRow (10); // remove row 10
tab;removeRow (20); // remove row 20, which was 21
Vector<uInt> vec(2);
vec(0) = 10;
vec(1) = 20;
tab;removeRow (vec); // remove row 10 and 20

because in the first fragment removing row 10 turns the former row 21 into row 20;

Reimplemented in casacore::ConcatTable, casacore::RefTable, casacore::PlainTable, casacore::MemoryTable, and casacore::NullTable.

Referenced by casacore::Table::removeRow().

void casacore::BaseTable::removeRow ( const Vector< uInt > &  rownrs)
virtual void casacore::BaseTable::rename ( const String newName,
int  tableOption 
)
virtual

Rename the table.

The following options can be given:

Table::Update
A table with this name must already exists, which will be overwritten. When succesfully renamed, the table is unmarked for delete (if necessary).
Table::New
When a table with this name exists, it will be overwritten. When succesfully renamed, the table is unmarked for delete (if necessary).
Table::NewNoReplace
When a table with this name already exists, an exception is thrown. When succesfully renamed, the table is unmarked for delete (if necessary).
Table::Scratch
Same as Table::New, but followed by markForDelete().

The rename function in this base class renames the table file. In a derived class (e.g. PlainTable) the function should also be implemented to rename subtables in its keywords.

Reimplemented in casacore::MemoryTable.

Referenced by casacore::Table::rename().

virtual void casacore::BaseTable::renameColumn ( const String newName,
const String oldName 
)
pure virtual
virtual void casacore::BaseTable::renameHypercolumn ( const String newName,
const String oldName 
)
pure virtual
virtual void casacore::BaseTable::renameSubTables ( const String newName,
const String oldName 
)
protectedvirtual

Rename the subtables (used by rename function).

Reimplemented in casacore::PlainTable, and casacore::NullTable.

virtual void casacore::BaseTable::reopenRW ( )
pure virtual
virtual void casacore::BaseTable::resync ( )
pure virtual

Resync the Table object with the table file.

Implemented in casacore::ConcatTable, casacore::RefTable, casacore::PlainTable, casacore::MemoryTable, and casacore::NullTable.

Referenced by casacore::Table::resync().

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

Get pointer to root table (i.e.

parent of a RefTable). Default it is this table. It is meant for the reference tables after a select or sort which can then still name their parent as the root.

Reimplemented in casacore::RefTable, and casacore::NullTable.

Referenced by casacore::Table::isRootTable(), and casacore::Table::isSameRoot().

virtual Vector<uInt> casacore::BaseTable::rowNumbers ( ) const
virtual

Get a vector of row numbers.

By default it returns the row numbers 0..nrrow()-1. It needs to be implemented for RefTable only.

Reimplemented in casacore::RefTable, and casacore::NullTable.

virtual Bool casacore::BaseTable::rowOrder ( ) const
virtual

Tell if the table is in row order.

By default it is, since normally a table is always in row order. It is meant for RefTable-s, where the rows can be in another (sorted) order.

Reimplemented in casacore::RefTable, and casacore::NullTable.

virtual Vector<uInt>* casacore::BaseTable::rowStorage ( )
virtual

By the default the table cannot return the storage of rownrs.

That can only be done by a RefTable, where it is implemented.

Reimplemented in casacore::RefTable, and casacore::NullTable.

virtual TableRecord& casacore::BaseTable::rwKeywordSet ( )
pure 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).

Implemented in casacore::ConcatTable, casacore::RefTable, casacore::PlainTable, casacore::MemoryTable, and casacore::NullTable.

void casacore::BaseTable::scratchCallback ( Bool  isScratch,
const String oldName 
) const
protected

Do the callback for scratch tables (if callback is set).

BaseTable* casacore::BaseTable::select ( const TableExprNode ,
uInt  maxRow,
uInt  offset 
)

Select rows using the given expression (which can be null).

Skip first offset matching rows. Return at most maxRow matching rows.

BaseTable* casacore::BaseTable::select ( uInt  maxRow,
uInt  offset 
)

Select maxRow rows and skip first offset rows.

maxRow=0 means all.

BaseTable* casacore::BaseTable::select ( const Vector< uInt > &  rownrs)

Select rows using a vector of row numbers.

BaseTable* casacore::BaseTable::select ( const Block< Bool > &  mask)

Select rows using a mask block.

The length of the block must match the number of rows in the table. If True, the corresponding row will be selected.

virtual void casacore::BaseTable::setTableChanged ( )
virtual

Set the table to being changed.

By default it does nothing.

Reimplemented in casacore::PlainTable.

Referenced by casacore::ColumnSet::setTableChanged().

Bool casacore::BaseTable::shouldNotWrite ( ) const
inlineprotected

Should the table be written.

This flag is False if an exception was thrown.

Definition at line 545 of file BaseTable.h.

References noWrite_p.

void casacore::BaseTable::showColumnInfo ( ostream &  os,
const TableDesc ,
uInt  maxNameLength,
const Array< String > &  columnNames,
Bool  sort,
Bool  cOrder 
) const
private

Show the info of the given columns.

Sort the columns if needed.

void casacore::BaseTable::showStructure ( std::ostream &  ,
Bool  showDataMan,
Bool  showColumns,
Bool  showSubTables,
Bool  sortColumns,
Bool  cOrder 
)

Show the table structure (implementation of Table::showStructure).

Referenced by casacore::Table::showStructure().

virtual void casacore::BaseTable::showStructureExtra ( std::ostream &  ) const
privatevirtual

Show a possible extra table structure header.

It is used by e.g. RefTable to show which table is referenced.

Reimplemented in casacore::RefTable, and casacore::ConcatTable.

BaseTable* casacore::BaseTable::sort ( const Block< String > &  columnNames,
const Block< CountedPtr< BaseCompare > > &  compareObjects,
const Block< Int > &  sortOrder,
int  sortOption 
)

Sort a table on one or more columns of scalars.

virtual const StorageOption& casacore::BaseTable::storageOption ( ) const
pure virtual

Get the storage option used for the table.

Implemented in casacore::ConcatTable, casacore::RefTable, casacore::PlainTable, casacore::MemoryTable, and casacore::NullTable.

Referenced by casacore::Table::storageOption().

BaseTable* casacore::BaseTable::tabAnd ( BaseTable )

Do logical operations on a table.

intersection with another table

const TableDesc& casacore::BaseTable::tableDesc ( ) const
inline

Get the table description.

Definition at line 272 of file BaseTable.h.

References makeTableDesc(), and tdescPtr_p.

Referenced by casacore::Table::tableDesc().

TableInfo& casacore::BaseTable::tableInfo ( )
inline

Get access to the TableInfo object.

Definition at line 298 of file BaseTable.h.

References info_p.

Referenced by casacore::Table::tableInfo().

static TableInfo casacore::BaseTable::tableInfo ( const String tableName)
static

Get the table info of the table with the given name.

An empty object is returned when the table is unknown.

const String& casacore::BaseTable::tableName ( ) const
inline

Get the table name.

Definition at line 195 of file BaseTable.h.

References name_p.

Referenced by casacore::Table::tableName().

int casacore::BaseTable::tableOption ( ) const
inline

Get the table option.

Definition at line 253 of file BaseTable.h.

References option_p.

Referenced by casacore::Table::tableOption().

virtual int casacore::BaseTable::tableType ( ) const
virtual

Get the table type.

By default it returns Table::Plain.

Reimplemented in casacore::ConcatTable, casacore::RefTable, and casacore::MemoryTable.

Referenced by casacore::Table::tableType().

BaseTable* casacore::BaseTable::tabNot ( )

take complement

BaseTable* casacore::BaseTable::tabOr ( BaseTable )

union with another table

BaseTable* casacore::BaseTable::tabSub ( BaseTable )

subtract another table

BaseTable* casacore::BaseTable::tabXor ( BaseTable )

xor with another table

void casacore::BaseTable::throwIfTableExists ( )
protected

Check if the table already exists.

Throw an exception if so.

int casacore::BaseTable::traceId ( ) const
inline

Get the table's trace-id.

Definition at line 486 of file BaseTable.h.

References itsTraceId.

Referenced by casacore::ColumnSet::traceId().

void casacore::BaseTable::trueDeepCopy ( const String newName,
const Record dataManagerInfo,
const StorageOption ,
int  tableOption,
int  endianFormat,
Bool  noRows 
) const
protected

Make a true deep copy of the table.

static void casacore::BaseTable::unlink ( BaseTable )
static

Unlink from a BaseTable.

Delete it if no more references.

virtual void casacore::BaseTable::unlock ( )
pure virtual

Unlock the table.

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

Implemented in casacore::ConcatTable, casacore::RefTable, casacore::PlainTable, casacore::MemoryTable, and casacore::NullTable.

Referenced by casacore::Table::unlock().

void casacore::BaseTable::unmarkForDelete ( Bool  callback,
const String oldName 
)

Unmark the table for delete.

This means the underlying table does not get deleted when destructed. The scratchCallback function is called when needed.

Referenced by casacore::Table::unmarkForDelete().

void casacore::BaseTable::writeEnd ( AipsIO )
protected

End writing a table.

void casacore::BaseTable::writeStart ( AipsIO ,
Bool  bigEndian 
)
protected

Start writing a table.

It does a putstart and writes nrrow_p. It should be ended by calling writeEnd.

Member Data Documentation

Bool casacore::BaseTable::delete_p
protected

Definition at line 498 of file BaseTable.h.

Referenced by isMarkedForDelete().

TableInfo casacore::BaseTable::info_p
protected

Definition at line 499 of file BaseTable.h.

Referenced by tableInfo().

int casacore::BaseTable::itsTraceId
protected

Definition at line 501 of file BaseTable.h.

Referenced by traceId().

Bool casacore::BaseTable::madeDir_p
protected

Definition at line 500 of file BaseTable.h.

String casacore::BaseTable::name_p
protected

Definition at line 495 of file BaseTable.h.

Referenced by tableName().

Bool casacore::BaseTable::noWrite_p
protected

Definition at line 497 of file BaseTable.h.

Referenced by doNotWrite(), and shouldNotWrite().

uInt casacore::BaseTable::nrlink_p
protected

Definition at line 491 of file BaseTable.h.

uInt casacore::BaseTable::nrrow_p
protected

Definition at line 492 of file BaseTable.h.

Referenced by checkRowNumber(), and nrow().

uInt casacore::BaseTable::nrrowToAdd_p
protected

Definition at line 493 of file BaseTable.h.

Referenced by checkRowNumber().

int casacore::BaseTable::option_p
protected

Definition at line 496 of file BaseTable.h.

Referenced by tableOption().

TableDesc* casacore::BaseTable::tdescPtr_p
protected

Definition at line 494 of file BaseTable.h.

Referenced by tableDesc().


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