28 #ifndef TABLES_BASETABLE_H
29 #define TABLES_BASETABLE_H
57 class BaseTableIterator;
60 template<
class T>
class Vector;
61 template<
class T>
class Block;
62 template<
class T>
class PtrBlock;
160 virtual void unlock() = 0;
166 virtual void resync() = 0;
223 virtual void rename (
const String& newName,
int tableOption);
238 virtual void copy (
const String& newName,
int tableOption)
const;
351 Bool byColumn)
const = 0;
429 Bool throwException)
const;
436 const String& oldName) = 0;
440 const String& oldName) = 0;
467 Bool determineOrder)
const;
BaseTable * select(const TableExprNode &, uInt maxRow, uInt offset)
Select rows using the given expression (which can be null).
virtual void renameHypercolumn(const String &newName, const String &oldName)=0
Rename a hypercolumn.
std::vector< double > Vector
virtual const StorageOption & storageOption() const =0
Get the storage option used for the table.
virtual DataManager * findDataManager(const String &name, Bool byColumn) const =0
Find the data manager with the given name or for the given column.
int tableOption() const
Get the table option.
Bool isColumnWritable(const String &columnName) const
Test if the given column is writable.
virtual Bool isNull() const
Is the table a null table? By default it is not.
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
virtual void mergeLock(const TableLock &lockOptions)=0
Merge the given lock info with the existing one.
virtual int tableType() const
Get the table type.
AipsIO is the object persistency mechanism of Casacore.
virtual Bool canRenameColumn(const String &columnName) const =0
Test if a column can be renamed.
void checkRowNumberThrow(uInt rownr) const
Throw an exception for checkRowNumber.
Bool isColumnStored(const String &columnName) const
Test if the given column is stored (otherwise it is virtual).
virtual void reopenRW()=0
Reopen the table for read/write.
Handle class for a table column expression tree.
BaseTable * tabXor(BaseTable *)
xor with another table
Envelope class for the description of a table column.
virtual BaseTable * doSort(PtrBlock< BaseColumn * > &, const Block< CountedPtr< BaseCompare > > &, const Block< Int > &sortOrder, int sortOption)
Do the actual sort.
virtual const TableLock & lockOptions() const =0
Get the locking info.
virtual void addRow(uInt nrrow=1, Bool initialize=True)
Add one or more rows and possibly initialize them.
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.
void unmarkForDelete(Bool callback, const String &oldName)
Unmark the table for delete.
Base class for table iterator.
BaseTable * tabOr(BaseTable *)
union with another table
virtual uInt getModifyCounter() const =0
Get the modify counter.
virtual TableDesc actualTableDesc() const =0
Get the actual table description.
BaseTable * tabSub(BaseTable *)
subtract another table
void scratchCallback(Bool isScratch, const String &oldName) const
Do the callback for scratch tables (if callback is set).
virtual void rename(const String &newName, int tableOption)
Rename the table.
void getTableInfo()
Read the TableInfo object.
virtual Bool lock(FileLocker::LockType, uInt nattempts)=0
Try to lock the table for read or write access.
virtual void renameSubTables(const String &newName, const String &oldName)
Rename the subtables (used by rename function).
void writeEnd(AipsIO &)
End writing a table.
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...
virtual void getPartNames(Block< String > &names, Bool recursive) const
Get the names of the tables this table consists of.
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
void BaseTableCommon(const String &tableName, int tableOption, uInt nrrow)
Common code shared by the MPI constructor and non-MPI constructor.
virtual Vector< uInt > rowNumbers() const
Get a vector of row numbers.
Bool makeTableDir()
Create the table directory when needed (and possible).
void markForDelete(Bool callback, const String &oldName)
Mark the table for delete.
Options defining how table files are organized.
RefTable * makeRefTable(Bool rowOrder, uInt initialNrrow)
Create a RefTable object.
virtual BaseTable * root()
Get pointer to root table (i.e.
virtual Vector< uInt > * rowStorage()
By the default the table cannot return the storage of rownrs.
BaseTableIterator * makeIterator(const Block< String > &columnNames, const Block< CountedPtr< BaseCompare > > &, const Block< Int > &orders, int option)
Create an iterator.
BaseTable & operator=(const BaseTable &)
Assignment is forbidden, because copying a table requires some more knowledge (like table name of res...
Referenced counted pointer for constant data.
Abstract base class for tables.
Class for a table as a view of another table.
virtual TableRecord & rwKeywordSet()=0
Get read/write access to the table keyword set.
static void unlink(BaseTable *)
Unlink from a BaseTable.
Bool openedForWrite() const
Test if the table is opened for write.
const String & tableName() const
Get the table name.
String makeAbsoluteName(const String &name) const
Make the name absolute.
void checkRowNumber(uInt rownr) const
Check if the row number is valid.
virtual void removeColumn(const Vector< String > &columnNames)=0
Remove columns.
BaseTable * tabAnd(BaseTable *)
Do logical operations on a table.
virtual void copy(const String &newName, int tableOption) const
Copy the table and all its subtables.
virtual void unlock()=0
Unlock the table.
A hierarchical collection of named fields of various types.
bool Bool
Define the standard types used by Casacore.
virtual Bool isWritable() const =0
Test if this table is writable.
virtual void removeRow(uInt rownr)
Remove rows.
BaseTable * project(const Block< String > &columnNames)
Project the given columns (i.e.
void logicCheck(BaseTable *that)
Check if the tables combined in a logical operation have the same root.
int traceId() const
Get the table's trace-id.
Table type, subtype and further info.
virtual BaseColumn * getColumn(uInt columnIndex) const =0
Get a column object using its index.
Class to hold table lock options.
const TableDesc & makeTableDesc() const
Make an empty table description.
A drop-in replacement for Block<T*>.
virtual void resync()=0
Resync the Table object with the table file.
virtual Bool canAddRow() const
Test if it is possible to add a row to this table.
A hierarchical collection of named fields of various types.
template <class T, class U> class vector;
void prepareCopyRename(const String &newName, int tableOption) const
Prepare for copying or renaming a table.
uInt nrow() const
Get number of rows.
Bool isMarkedForDelete() const
Test if the table is marked for delete.
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.
virtual Bool canRemoveColumn(const Vector< String > &columnNames) const =0
Test if columns can be removed.
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.
Bool checkRemoveColumn(const Vector< String > &columnNames, Bool throwException) const
Check if the set of columns can be removed.
Abstract base class for a data manager.
virtual void showStructureExtra(std::ostream &) const
Show a possible extra table structure header.
virtual Record dataManagerInfo() const =0
Get the data manager info.
BaseTable * tabNot()
take complement
virtual Bool canRemoveRow() const
Test if it is possible to remove a row from this table.
virtual void flushTableInfo()
Write the TableInfo object.
void writeStart(AipsIO &, Bool bigEndian)
Start writing a table.
virtual void flush(Bool fsync, Bool recursive)=0
Flush the table, i.e.
String: the storage and methods of handling collections of characters.
virtual Bool isMultiUsed(Bool checkSubTables) const =0
Is the table in use (i.e.
void addColumns(const TableDesc &tableDesc, const Record &dmInfo, Bool addToParent)
Add one or more columns to the table.
virtual void renameColumn(const String &newName, const String &oldName)=0
Rename a column.
Define the structure of a Casacore table.
virtual void addColumn(const ColumnDesc &columnDesc, Bool addToParent)
Add one or more columns to the table.
void showStructure(std::ostream &, Bool showDataMan, Bool showColumns, Bool showSubTables, Bool sortColumns, Bool cOrder)
Show the table structure (implementation of Table::showStructure).
LockType
Define the possible lock types.
const TableDesc & tableDesc() const
Get the table description.
void link()
Link to this BaseTable object (i.e.
Bool shouldNotWrite() const
Should the table be written.
virtual Bool rowOrder() const
Tell if the table is in row order.
virtual Bool asBigEndian() const =0
Is the table stored in big or little endian format?
virtual Bool hasLock(FileLocker::LockType) const =0
Has this process the read or write lock, thus can the table be read or written safely?
TableInfo & tableInfo()
Get access to the TableInfo object.
virtual void setTableChanged()
Set the table to being changed.
void doNotWrite()
Do not write the table (used in in case of exceptions).
virtual void deepCopy(const String &newName, const Record &dataManagerInfo, const StorageOption &, int tableOption, Bool valueCopy, int endianFormat, Bool noRows) const
BaseTable(const String &tableName, int tableOption, uInt nrrow)
Initialize the object.
void showColumnInfo(ostream &os, const TableDesc &, uInt maxNameLength, const Array< String > &columnNames, Bool sort, Bool cOrder) const
Show the info of the given columns.
void throwIfTableExists()
Check if the table already exists.
Abstract base class for a table column.
virtual TableRecord & keywordSet()=0
Get readonly access to the table keyword set.
#define casacore
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.