28 #ifndef TABLES_TABLE_H
29 #define TABLES_TABLE_H
58 template<
class T>
class Block;
59 template<
class T>
class CountedPtr;
478 {
return (baseTabPtr_p == 0 ?
True : baseTabPtr_p->isNull()); }
516 Int maxVal=25)
const;
1012 __attribute__ ((deprecated ("Now use TableUtil::
openTable")));
1018 __attribute__ ((deprecated ("Now use TableUtil::openTable")));
1022 __attribute__ ((deprecated ("Now use TableUtil::
canDeleteTable")));
1026 __attribute__ ((deprecated ("Now use TableUtil::canDeleteTable")));
1030 __attribute__ ((deprecated ("Now use TableUtil::
deleteTable")));
1033 __attribute__ ((deprecated ("Now use TableUtil::
getLayout")));
1036 __attribute__ ((deprecated ("Now use TableUtil::
tableInfo")));
1051 uInt lastModCounter_p;
1066 static BaseTable* makeBaseTable (const
String& name, const
String& type,
1075 BaseTable* baseTablePtr() const;
1080 BaseTable* lookCache (const
String& name,
int tableOption,
1090 void showColumnInfo (ostream& os, const
TableDesc&,
uInt maxNameLength,
1097 {
return baseTabPtr_p->root() == other.baseTabPtr_p->root(); }
1100 { baseTabPtr_p->reopenRW(); }
1102 { baseTabPtr_p->flush (fsync, recursive); }
1104 { baseTabPtr_p->resync(); }
1107 {
return baseTabPtr_p->storageOption(); }
1109 {
return baseTabPtr_p->isMultiUsed(checkSubTables); }
1111 {
return baseTabPtr_p->lockOptions(); }
1113 {
return baseTabPtr_p->lock (type, nattempts); }
1120 { baseTabPtr_p->unlock(); }
1122 {
return baseTabPtr_p->hasLock (type); }
1129 {
return baseTabPtr_p == baseTabPtr_p->root(); }
1132 {
return baseTabPtr_p->isWritable(); }
1134 {
return baseTabPtr_p->isColumnWritable (columnName); }
1136 {
return baseTabPtr_p->isColumnWritable (columnIndex); }
1139 {
return baseTabPtr_p->isColumnStored (columnName); }
1141 {
return baseTabPtr_p->isColumnStored (columnIndex); }
1144 { baseTabPtr_p->rename (newName, option); }
1151 { baseTabPtr_p->deepCopy (newName, dataManagerInfo,
StorageOption(),
1153 endianFormat, noRows); }
1161 { baseTabPtr_p->deepCopy (newName, dataManagerInfo, stopt,
1163 endianFormat, noRows); }
1165 { baseTabPtr_p->markForDelete (
True,
""); }
1167 { baseTabPtr_p->unmarkForDelete(
True,
""); }
1169 {
return baseTabPtr_p->isMarkedForDelete(); }
1172 {
return baseTabPtr_p->nrow(); }
1173 inline BaseTable* Table::baseTablePtr()
const
1174 {
return baseTabPtr_p; }
1176 {
return baseTabPtr_p->tableDesc(); }
1178 {
return baseTabPtr_p->keywordSet(); }
1181 {
return baseTabPtr_p->tableInfo(); }
1183 {
return baseTabPtr_p->tableInfo(); }
1185 { baseTabPtr_p->flushTableInfo(); }
1188 {
return baseTabPtr_p->tableName(); }
1190 {
return TableType(baseTabPtr_p->tableType()); }
1192 {
return baseTabPtr_p->tableOption(); }
1195 {
return baseTabPtr_p->canAddRow(); }
1197 {
return baseTabPtr_p->canRemoveRow(); }
1199 {
return baseTabPtr_p->canRemoveColumn (columnNames); }
1201 {
return baseTabPtr_p->canRenameColumn (columnName); }
1204 { baseTabPtr_p->addRow (nrrow, initialize); }
1206 { baseTabPtr_p->removeRow (rownr); }
1208 { baseTabPtr_p->removeRow (rownrs); }
1210 { baseTabPtr_p->addColumn (columnDesc, addToParent); }
1214 { baseTabPtr_p->addColumn (columnDesc, dataManager, byName, addToParent); }
1217 { baseTabPtr_p->addColumn (columnDesc, dataManager, addToParent); }
1220 { baseTabPtr_p->addColumn (tableDesc, dataManager, addToParent); }
1222 const Record&
dataManagerInfo,
Bool addToParent) { baseTabPtr_p->addColumns (tableDesc, dataManagerInfo, addToParent); }
1224 { baseTabPtr_p->removeColumn (columnNames); }
1226 { baseTabPtr_p->renameColumn (newName, oldName); }
1228 { baseTabPtr_p->renameHypercolumn (newName, oldName); }
1231 Bool byColumn)
const
1233 return baseTabPtr_p->findDataManager (name, byColumn);
1242 { baseTabPtr_p->showStructure (os, showDataMans, showColumns,
1243 showSubTables, sortColumns, cOrder); }
void markForDelete()
Mark the table for delete.
Table & operator=(const Table &)
Assignment (reference semantics).
DataManager * findDataManager(const String &name, Bool byColumn=False) const
Find the data manager with the given name or for the given column name.
A 1-D Specialization of the Array class.
void removeColumn(const String &columnName)
Remove columns.
void renameColumn(const String &newName, const String &oldName)
Rename a column.
LockOption
Define the possible table locking options.
Create a new table - define shapes, data managers, etc.
friend AipsIO & operator>>(AipsIO &, Table &)
Read a table from AipsIO (for TypedKeywords<Table>).
EndianFormat
Define the possible endian formats in which table data can be stored.
Table()
Create a null Table object (i.e.
Class defining a plain regular table.
static Vector< String > getLockedTables(FileLocker::LockType=FileLocker::Read, int lockOption=-1)
Get the names of tables locked in this process.
Main interface class to a read/write table.
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
new table, which gets marked for delete
AipsIO is the object persistency mechanism of Casacore.
int tableOption() const
Get the table option.
rownr_t nrow() const
Get the number of rows.
Bool canAddRow() const
Test if it is possible to add a row to this table.
Handle class for a table column expression tree.
Class for a table held in memory.
Table project(const Block< String > &columnNames) const
Project the given columns (i.e.
Bool isMarkedForDelete() const
Test if the table is marked for delete.
void showKeywords(std::ostream &, Bool showSubTables=False, Bool showTabKey=True, Bool showColKey=False, Int maxVal=25) const
Show the table and/or column keywords, possibly also of all subtables.
Envelope class for the description of a table column.
Table::EndianFormat endianFormat() const
Get the endian format in which the table is stored.
static Vector< String > nonWritableFiles(const String &tableName)
Find the non-writable files in a table.
Bool isColumnWritable(const String &columnName) const
Test if the given column is writable.
store table data in big endian (e.g.
void throwIfNull() const
Throw an exception if the object is null, i.e.
TableType tableType() const
Get the table type.
Abstract base class for a node in a table column expression tree.
void ScratchCallback(const String &name, Bool isScratch, const String &oldName)
Define the signature of the function being called when the state of a scratch table changes (i...
Bool isWritable() const
Test if this table is opened as writable.
Table operator-(const Table &) const
Subtract another table.
void removeRow(rownr_t rownr)
Remove the given row(s).
const String & tableName() const
Get the table name.
virtual ~Table()
The destructor flushes (i.e.
void addRow(rownr_t nrrow=1, Bool initialize=False)
Add one or more rows at the end of the table.
rownr_t getLayout(TableDesc &desc, const String &tableName)
Return the layout of a table (i.e.
void showStructure(std::ostream &, Bool showDataMans=True, Bool showColumns=True, Bool showSubTables=False, Bool sortColumns=False, Bool cOrder=False) const
Show the structure of the table.
void rename(const String &newName, TableOption)
Rename the table and all its subtables.
Options defining how table files are organized.
use endian format defined in the aipsrc variable table.endianformat If undefined, it defaults to Loca...
void getTableKeyword(AipsIO &, Bool openWritable)
Read a table from AipsIO (for TableKeywords).
create table (may not exist)
void renameHypercolumn(const String &newName, const String &oldName)
Table operator()(const TableExprNode &, rownr_t maxRow=0, rownr_t offset=0) const
Select rows from a table using an select expression consisting of TableExprNode objects.
TableDesc actualTableDesc() const
Bool isMultiUsed(Bool checkSubTables=False) const
Is the table used (i.e.
Memory related information and utilities. use visibility=export>
Table operator^(const Table &) const
Xor with another table.
Referenced counted pointer for constant data.
Abstract base class for tables.
Class for a table as a view of another table.
TableExprNode nodeRownr(rownr_t origin=0) const
Create a TableExprNode object for the rownumber function.
Table openTable(const String &tableName, Table::TableOption=Table::Old, const TSMOption &=TSMOption())
Try to open a table.
void resync()
Resynchronize the Table object with the table file.
plain table (stored on disk)
RowNumbers rowNumbers() const
Get a vector of row numbers in the root table of rows in this table.
friend AipsIO & operator<<(AipsIO &, const Table &)
Write a table to AipsIO (for TypedKeywords<Table>).
Record dataManagerInfo() const
Return all data managers used and the columns served by them.
void unmarkForDelete()
Unmark the table for delete.
Options for the Tiled Storage Manager Access.
void showKeywordSets(std::ostream &, Bool showTabKey, Bool showColKey, Int maxVal) const
Show the table and/or column keywords of this table.
const TableLock & lockOptions() const
Get the locking options.
TableExprNode keyCol(const String &name, const Vector< String > &fieldNames) const
A hierarchical collection of named fields of various types.
bool Bool
Define the standard types used by Casacore.
Table sort(const String &columnName, int=Sort::Ascending, int=Sort::ParSort) const
Sort a table on one or more columns of scalars.
TableExprNode key(const String &keywordName) const
Create a TableExprNode object for a column or for a keyword in the table keyword set...
Bool lock(FileLocker::LockType=FileLocker::Write, uInt nattempts=0)
Try to lock the table for read or write access (default is write).
TableRecord & rwKeywordSet()
Get read/write access to the table keyword set.
Read/write access to a table column.
Table type, subtype and further info.
static Bool isOpened(const String &tableName)
Is the table used (i.e.
Class to hold table lock options.
TableExprNode col(const String &columnName) const
A hierarchical collection of named fields of various types.
A templated N-D Array class with zero origin. Array<T, Alloc> is a templated, N-dimensional, Array class. The origin is zero, but by default indices are zero-based. This Array class is the base class for the Vector, Matrix, and Cube subclasses.
static uInt nAutoLocks()
Determine the number of locked tables opened with the AutoLock option (Locked table means locked for ...
Bool canRemoveRow() const
Test if it is possible to remove a row from this table.
static String fileName(const String &tableName)
Make the table file name.
void copy(const String &newName, TableOption, Bool noRows=False) const
Copy the table and all its subtables.
const TableDesc & tableDesc() const
Get the table description.
Bool hasLock(FileLocker::LockType=FileLocker::Write) const
Has this process the read or write lock, thus can the table be read or written safely?
uInt64 rownr_t
Define the type of a row number in a table.
Table operator!() const
Take complement.
static Bool isNativeDataType(DataType dtype)
Test if the given data type is native to the table system.
Bool isNull() const
Test if the object is null, i.e.
Bool isSameRoot(const Table &other) const
Is the root table of this table the same as that of the other one?
TableExprNode nodeRandom() const
Create a TableExprNode object for the rand function.
Table operator&(const Table &) const
Do logical operations on a table.
Base class for the Data Manager Accessor classes.
Abstract base class for a data manager.
const TableRecord & keywordSet() const
Get readonly access to the table keyword set.
Bool canRemoveColumn(const String &columnName) const
Test if columns can be removed.
const StorageOption & storageOption() const
Get the storage option used for the table.
static ScratchCallback * setScratchCallback(ScratchCallback *)
Set the pointer to the ScratchCallback function.
void deleteTable(const String &tableName, Bool checkSubTables=False)
Delete the table.
String: the storage and methods of handling collections of characters.
Block< String > getPartNames(Bool recursive=False) const
Get the names of the tables this table consists of.
static void relinquishAutoLocks(Bool all=False)
Unlock locked tables opened with the AutoLock option.
Define the structure of a Casacore table.
Bool isRootTable() const
Test if this table is the root table (ie.
const TableInfo & tableInfo() const
Get access to the TableInfo object.
Bool canDeleteTable(const String &tableName, Bool checkSubTables=False)
Can the table be deleted? If true, function deleteTable can safely be called.
LockType
Define the possible lock types.
TableType
Define the possible table types.
Class to view a concatenation of tables as a single table.
void reopenRW()
Try to reopen the table for read/write access.
void closeSubTables() const
Close all open subtables.
Table copyToMemoryTable(const String &name, Bool noRows=False) const
Make a copy of a table to a MemoryTable object.
store data in the endian format of the machine used
Bool isColumnStored(const String &columnName) const
Test if the given column is stored (otherwise it is virtual).
LatticeExprNode all(const LatticeExprNode &expr)
Table operator|(const Table &) const
Union with another table.
void addColumn(const ColumnDesc &columnDesc, Bool addToParent=True)
Add a column to the table.
Bool hasDataChanged()
Determine if column or keyword table data have changed (or is being changed) since the last time this...
Bool canRenameColumn(const String &columnName) const
Test if a column can be renamed.
void deepCopy(const String &newName, TableOption, Bool valueCopy=False, EndianFormat=AipsrcEndian, Bool noRows=False) const
void flush(Bool fsync=False, Bool recursive=False)
Flush the table, i.e.
void flushTableInfo() const
Write the TableInfo object.
store table data in little endian (e.g.
TableOption
Define the possible options how a table can be opened.
void unlock()
Unlock the table.
static Bool isReadable(const String &tableName, bool throwIf=False)
Test if a table with the given name exists and is readable.