28 #ifndef TABLES_REFTABLE_H
29 #define TABLES_REFTABLE_H
33 #include <casacore/casa/aips.h>
34 #include <casacore/tables/Tables/BaseTable.h>
35 #include <casacore/casa/BasicSL/String.h>
36 #include <casacore/casa/Arrays/Vector.h>
287 Bool byColumn)
const;
323 Bool determineOrder)
const;
363 std::map<String,String>& nameMap,
const TableDesc & tableDesc() const
Get the table description.
int tableOption() const
Get the table option.
Abstract base class for a data manager.
LockType
Define the possible lock types.
Vector< rownr_t > rowStorage_p
static void getLayout(TableDesc &desc, AipsIO &ios)
Return the layout of a table (i.e.
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 addRownrRange(rownr_t startRownr, rownr_t endRownr)
virtual TableRecord & rwKeywordSet()
Get read/write access to the table keyword set.
virtual Record dataManagerInfo() const
Get the data manager info.
virtual Bool canRemoveRow() const
Test if it is possible to remove a row from this 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.
virtual void addColumn(const ColumnDesc &columnDesc, const DataManager &dataManager, Bool addToParent)
virtual Bool canRemoveColumn(const Vector< String > &columnNames) const
Test if columns can be removed (yes).
virtual DataManager * findDataManager(const String &name, Bool byColumn) const
Find the data manager with the given name or for the given column.
virtual void unlock()
Unlock the table.
virtual ~RefTable()
The destructor flushes (i.e.
void refSub(rownr_t nr1, const rownr_t *rows1, rownr_t nr2, const rownr_t *rows2)
void showStructureExtra(std::ostream &) const
Show the extra table structure info (name of root table).
virtual void addColumn(const ColumnDesc &columnDesc, const String &dataManager, Bool byName, Bool addToParent)
virtual void removeAllRow()
Remove the given row.
RefTable(BaseTable *, const Vector< rownr_t > &rowNumbers)
A RefTable with the given row numbers is constructed.
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).
void copyRefTable(const String &newName, int tableOption)
Copy a RefTable that is not persistent.
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 BaseTable * root()
Get parent of this table.
void addRownr(rownr_t rownr)
Add a rownr to reference table.
virtual const TableLock & lockOptions() const
Get the locking info.
void makeRefCol()
Create the RefColumn objects for all columns in the description.
virtual TableRecord & keywordSet()
Get readonly access to the table keyword set.
std::map< String, String > nameMap_p
RefTable(BaseTable *, Bool rowOrder, rownr_t initialNrrow)
Create a reference table object referencing the given BaseTable object.
virtual void removeRow(rownr_t rownr)
Remove the given row.
virtual uInt getModifyCounter() const
Get the modify counter.
void addRefCol(const TableDesc &tdesc)
Add multiple columns.
virtual Bool lock(FileLocker::LockType, uInt nattempts)
Try to lock the table for read or write access.
virtual Bool canRenameColumn(const String &columnName) const
Test if a column can be renamed (yes).
rownr_t rootRownr(rownr_t rownr) const
Get rownr in root table.
void writeRefTable(Bool fsync)
Write a reference table.
void setup(BaseTable *btp, const Vector< String > &columnNames)
Setup the main parts of the object.
RefTable(BaseTable *, const Vector< Bool > &rowMask)
Create a reference table object out of a mask.
virtual void renameHypercolumn(const String &newName, const String &oldName)
Rename a hypercolumn.
void refXor(rownr_t nr1, const rownr_t *rows1, rownr_t nr2, const rownr_t *rows2)
virtual void getPartNames(Block< String > &names, Bool recursive) const
Get the names of the tables this table consists of.
RefTable & operator=(const RefTable &)
Assignment is forbidden, because copying a table requires some more knowledge (like table name of res...
virtual void addColumn(const ColumnDesc &columnDesc, Bool addToParent)
Add one or more columns to the table.
virtual Bool asBigEndian() const
Is the table stored in big or little endian format?
virtual TableDesc actualTableDesc() const
Get the actual table description.
virtual BaseColumn * getColumn(uInt columnIndex) const
Get a column object using its index.
virtual Bool rowOrder() const
Tell if the table is in row order.
void getRef(AipsIO &, int option, const TableLock &lockOptions, const TSMOption &tsmOption)
Read a reference table from a file.
virtual void mergeLock(const TableLock &lockOptions)
Merge the given lock info with the existing one.
virtual Vector< rownr_t > * rowStorage()
Get row number vector.
virtual BaseColumn * getColumn(const String &columnName) const
Get a column object using its name.
virtual void flush(Bool fsync, Bool recursive)
Flush the table, i.e.
virtual Vector< rownr_t > rowNumbers() const
Get a vector of row numbers.
void refOr(rownr_t nr1, const rownr_t *rows1, rownr_t nr2, const rownr_t *rows2)
void addRefCol(const ColumnDesc &cd)
Add a column.
RefTable(const RefTable &)
Copy constructor is forbidden, because copying a table requires some more knowledge (like table name ...
void setNrrow(rownr_t nrrow)
Set the exact number of rows in the table.
virtual Bool hasLock(FileLocker::LockType) const
Has this process the read or write lock, thus can the table be read or written safely?
virtual void resync()
Resync the Table object with the table file.
virtual Bool isWritable() const
Test if the parent table is opened as writable.
virtual void renameColumn(const String &newName, const String &oldName)
Rename a column.
static void makeDesc(TableDesc &desc, const TableDesc &rootDesc, std::map< String, String > &nameMap, Vector< String > &names)
Make a table description for the given columns.
std::map< String, RefColumn * > colMap_p
virtual Bool isMultiUsed(Bool checkSubTable) const
Is the table in use (i.e.
void refNot(rownr_t nr1, const rownr_t *rows1, rownr_t nrmain)
RefTable(BaseTable *, const Vector< String > &columnNames)
Create a reference table object via projection (i.e.
static rownr_t * getStorage(Vector< rownr_t > &rownrs)
Get the internal pointer in a rowStorage vector.
virtual void removeColumn(const Vector< String > &columnNames)
Remove columns.
virtual void addColumn(const TableDesc &tableDesc, const DataManager &dataManager, Bool addToParent)
Bool checkAddColumn(const String &name, Bool addToParent)
Check if a column can be added.
virtual void reopenRW()
Try to reopen the table (the underlying one) for read/write access.
virtual int tableType() const
It returns the type of the parent table.
virtual const StorageOption & storageOption() const
Get the storage option used for the table.
Vector< rownr_t > rootRownr(const Vector< rownr_t > &rownrs) const
Get vector of rownrs in root table.
String: the storage and methods of handling collections of characters.
this file contains all the compiler specific defines
bool Bool
Define the standard types used by Casacore.
uInt64 rownr_t
Define the type of a row number in a table.