casa
5.7.0-16
|
Class indicating a null Table object. More...
#include <NullTable.h>
Public Member Functions | |
NullTable () | |
Default constructor. More... | |
virtual | ~NullTable () |
virtual Bool | isNull () const |
The table is a null table. More... | |
virtual void | reopenRW () |
All functions throw a "null table" exception. More... | |
virtual Bool | asBigEndian () const |
Is the table stored in big or little endian format? More... | |
virtual const StorageOption & | storageOption () const |
Get the storage option used for the table. More... | |
virtual Bool | isMultiUsed (Bool checkSubTable) const |
Is the table in use (i.e. More... | |
virtual const TableLock & | lockOptions () const |
Get the locking info. More... | |
virtual void | mergeLock (const TableLock &lockOptions) |
Merge the given lock info with the existing one. More... | |
virtual Bool | hasLock (FileLocker::LockType) const |
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) |
Try to lock the table for read or write access. More... | |
virtual void | unlock () |
Unlock the table. More... | |
virtual void | flush (Bool fsync, Bool recursive) |
Flush the table, i.e. More... | |
virtual void | resync () |
Resync the Table object with the table file. More... | |
virtual uInt | getModifyCounter () const |
Get the modify counter. More... | |
virtual Bool | isWritable () const |
Test if this table is writable. More... | |
virtual void | deepCopy (const String &newName, const Record &dataManagerInfo, const StorageOption &, int tableOption, Bool valueCopy, int endianFormat, Bool noRows) const |
virtual TableDesc | actualTableDesc () const |
Get the actual table description. More... | |
virtual Record | dataManagerInfo () const |
Get the data manager info. More... | |
virtual TableRecord & | keywordSet () |
Get readonly access to the table keyword set. More... | |
virtual TableRecord & | rwKeywordSet () |
Get read/write access to the table keyword set. More... | |
virtual BaseColumn * | getColumn (uInt columnIndex) const |
Get a column object using its index. More... | |
virtual BaseColumn * | getColumn (const String &columnName) const |
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, Bool initialize) |
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... | |
virtual DataManager * | findDataManager (const String &name, Bool byColumn) const |
Find the data manager with the given name or for the given column. 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) |
virtual Bool | canRemoveColumn (const Vector< String > &columnNames) const |
Test if columns can be removed. More... | |
virtual void | removeColumn (const Vector< String > &columnNames) |
Remove columns. More... | |
virtual Bool | canRenameColumn (const String &columnName) const |
Test if a column can be renamed. More... | |
virtual void | renameColumn (const String &newName, const String &oldName) |
Rename a column. More... | |
virtual void | renameHypercolumn (const String &newName, const String &oldName) |
Rename a hypercolumn. More... | |
virtual Vector< uInt > | rowNumbers () const |
Get a vector of row numbers. More... | |
virtual BaseTable * | root () |
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 BaseTable * | doSort (PtrBlock< BaseColumn * > &, const Block< CountedPtr< BaseCompare > > &, const Block< Int > &sortOrder, int sortOption) |
Do the actual sort. More... | |
virtual void | renameSubTables (const String &newName, const String &oldName) |
Rename the subtables (used by rename function). More... | |
Public Member Functions inherited from casacore::BaseTable | |
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 void | setTableChanged () |
Set the table to being changed. More... | |
void | doNotWrite () |
Do not write the table (used in in case of exceptions). 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 String & | tableName () 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 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 TableDesc & | tableDesc () const |
Get the table description. More... | |
void | showStructure (std::ostream &, Bool showDataMan, Bool showColumns, Bool showSubTables, Bool sortColumns, Bool cOrder) |
Show the table structure (implementation of Table::showStructure). More... | |
TableInfo & | tableInfo () |
Get access to the TableInfo object. More... | |
virtual void | flushTableInfo () |
Write the TableInfo object. More... | |
uInt | nrow () const |
Get number of rows. More... | |
void | removeRow (const Vector< uInt > &rownrs) |
BaseTable * | select (const TableExprNode &, uInt maxRow, uInt offset) |
Select rows using the given expression (which can be null). More... | |
BaseTable * | select (uInt maxRow, uInt offset) |
Select maxRow rows and skip first offset rows. More... | |
BaseTable * | select (const Vector< uInt > &rownrs) |
Select rows using a vector of row numbers. More... | |
BaseTable * | select (const Block< Bool > &mask) |
Select rows using a mask block. More... | |
BaseTable * | project (const Block< String > &columnNames) |
Project the given columns (i.e. More... | |
BaseTable * | tabAnd (BaseTable *) |
Do logical operations on a table. More... | |
BaseTable * | tabOr (BaseTable *) |
union with another table More... | |
BaseTable * | tabSub (BaseTable *) |
subtract another table More... | |
BaseTable * | tabXor (BaseTable *) |
xor with another table More... | |
BaseTable * | tabNot () |
take complement More... | |
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. More... | |
BaseTableIterator * | makeIterator (const Block< String > &columnNames, const Block< CountedPtr< BaseCompare > > &, const Block< Int > &orders, int option) |
Create an iterator. More... | |
void | addColumns (const TableDesc &tableDesc, const Record &dmInfo, Bool addToParent) |
Add one or more columns to the table. More... | |
Bool | checkRemoveColumn (const Vector< String > &columnNames, Bool throwException) const |
Check if the set of columns can be removed. More... | |
RefTable * | makeRefTable (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... | |
Private Member Functions | |
NullTable (const NullTable &) | |
Copy constructor is forbidden, because copying a table requires some more knowledge (like table name of result). More... | |
NullTable & | operator= (const NullTable &) |
Assignment is forbidden, because copying a table requires some more knowledge (like table name of result). More... | |
TableError | makeError (const String &name) const |
Make an exception message with the name of the function. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from casacore::BaseTable | |
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 inherited from casacore::BaseTable | |
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... | |
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 inherited from casacore::BaseTable | |
uInt | nrlink_p |
uInt | nrrow_p |
uInt | nrrowToAdd_p |
TableDesc * | tdescPtr_p |
String | name_p |
int | option_p |
Bool | noWrite_p |
Bool | delete_p |
TableInfo | info_p |
Bool | madeDir_p |
int | itsTraceId |
Class indicating a null Table object.
Internal
NullTable represents a null table object, i.e. a Table object without an underlying table.
NullTable is used to represent a null table. The default Table constructor used to a create a null pointer which resulted in core dumps when the Table object was actually used. The NullTable object makes it possible to catch such cases and throw an appropriate exception.
Definition at line 68 of file NullTable.h.
casacore::NullTable::NullTable | ( | ) |
Default constructor.
|
virtual |
|
private |
Copy constructor is forbidden, because copying a table requires
some more knowledge (like table name of result).
Declaring it private, makes it unusable.
|
virtual |
Get the actual table description.
Implements casacore::BaseTable.
|
virtual |
Add one or more columns to the table.
The default implementation throws an "invalid operation" exception.
Reimplemented from casacore::BaseTable.
|
virtual |
Reimplemented from casacore::BaseTable.
|
virtual |
Reimplemented from casacore::BaseTable.
|
virtual |
Reimplemented from casacore::BaseTable.
Add one or more rows and possibly initialize them.
This will fail for tables not supporting addition of rows.
Reimplemented from casacore::BaseTable.
|
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 from casacore::BaseTable.
|
virtual |
Is the table stored in big or little endian format?
Implements casacore::BaseTable.
|
virtual |
Test if it is possible to add a row to this table.
Reimplemented from casacore::BaseTable.
|
virtual |
Test if columns can be removed.
Implements casacore::BaseTable.
|
virtual |
Test if it is possible to remove a row from this table.
Reimplemented from casacore::BaseTable.
Test if a column can be renamed.
Implements casacore::BaseTable.
|
virtual |
Get the data manager info.
Implements casacore::BaseTable.
|
virtual |
Reimplemented from casacore::BaseTable.
|
virtual |
Do the actual sort.
The default implementation is suitable for almost all cases. Only in RefTable a smarter implementation is provided.
Reimplemented from casacore::BaseTable.
|
virtual |
Find the data manager with the given name or for the given column.
Implements casacore::BaseTable.
|
virtual |
Get a column object using its index.
Implements casacore::BaseTable.
|
virtual |
Get a column object using its name.
Implements casacore::BaseTable.
|
virtual |
Get the modify counter.
Implements casacore::BaseTable.
|
virtual |
Has this process the read or write lock, thus can the table be read or written safely?
Implements casacore::BaseTable.
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.
Implements casacore::BaseTable.
|
virtual |
The table is a null table.
Reimplemented from casacore::BaseTable.
|
virtual |
Test if this table is writable.
This tells if values can be put into a column.
Implements casacore::BaseTable.
|
virtual |
Get readonly access to the table keyword set.
Implements casacore::BaseTable.
|
virtual |
Try to lock the table for read or write access.
Implements casacore::BaseTable.
|
virtual |
Get the locking info.
Implements casacore::BaseTable.
|
private |
Make an exception message with the name of the function.
|
virtual |
Merge the given lock info with the existing one.
Implements casacore::BaseTable.
Assignment is forbidden, because copying a table requires some more knowledge (like table name of result).
Declaring it private, makes it unusable.
Remove columns.
Implements casacore::BaseTable.
|
virtual |
Remove rows.
This will fail for tables not supporting removal of rows.
Tip: The following code fragments do NOT have the same result:
because in the first fragment removing row 10 turns the former row 21 into row 20;
Reimplemented from casacore::BaseTable.
|
virtual |
Rename a column.
Implements casacore::BaseTable.
|
virtual |
Rename a hypercolumn.
Implements casacore::BaseTable.
|
virtual |
Rename the subtables (used by rename function).
Reimplemented from casacore::BaseTable.
|
virtual |
All functions throw a "null table" exception.
Implements casacore::BaseTable.
|
virtual |
Resync the Table object with the table file.
Implements casacore::BaseTable.
|
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 from casacore::BaseTable.
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 from casacore::BaseTable.
|
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 from casacore::BaseTable.
By the default the table cannot return the storage of rownrs.
That can only be done by a RefTable, where it is implemented.
Reimplemented from casacore::BaseTable.
|
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.
|
virtual |
Get the storage option used for the table.
Implements casacore::BaseTable.
|
virtual |
Unlock the table.
This will also synchronize the table data, thus force the data to be written to disk.
Implements casacore::BaseTable.