26#ifndef TABLES_COLUMNSET_H
27#define TABLES_COLUMNSET_H
31#include <casacore/casa/aips.h>
32#include <casacore/tables/Tables/TableLockData.h>
33#include <casacore/tables/Tables/BaseTable.h>
34#include <casacore/tables/Tables/StorageOption.h>
35#include <casacore/casa/BasicSL/String.h>
36#include <casacore/casa/Arrays/ArrayFwd.h>
int traceId() const
Get the table's trace-id.
virtual void setTableChanged()
Set the table to being changed.
OpenOption
Define the possible ByteIO open options.
void renameTables(const String &newName, const String &oldName)
Rename the necessary subtables in the column keywords.
void removeRow(rownr_t rownr)
Remove a row from all data managers.
Bool canRenameColumn(const String &columnName) const
Can a column be renamed in the data manager?
void autoReleaseLock()
Inspect the auto lock when the inspection interval has expired and release it when another process ne...
Bool canAddRow() const
Do all data managers and engines allow to add rows?
BaseTable * baseTablePtr_p
void initSomeDataManagers(uInt from, Table &tab)
Let the data managers (from the given index on) initialize themselves.
void linkToTable(BaseTable *baseTableObject)
Link the ColumnSet object to the BaseTable object.
void linkToLockObject(TableLockData *lockObject)
Link the ColumnSet object to the TableLockData object.
void prepareSomeDataManagers(uInt from)
Let the data managers (from the given index on) prepare themselves.
DataManager * findDataManager(const String &name, Bool byColumn=False) const
Find the data manager with the given name or for the given column.
void removeLastDataManager()
Remove the last data manager (used by addColumn after an exception).
PlainColumn * getColumn(uInt columnIndex) const
Get a column by index.
DataManager * getDataManager(uInt seqnr) const
Get the correct data manager.
Bool userLock(FileLocker::LockType, Bool wait)
If needed, get a temporary user lock.
void addColumn(const TableDesc &tableDesc, const DataManager &dataManager, Bool bigEndian, const TSMOption &tsmOption, Table &tab)
void doAddColumn(const ColumnDesc &columnDesc, DataManager *dataManPtr)
Do the actual addition of a column.
void syncColumns(const ColumnSet &other, const TableAttr &defaultAttr)
Synchronize the columns after it appeared that data in the main table file have changed.
std::map< void *, Int > checkRemoveColumn(const Vector< String > &columnNames)
Check if columns to be removed can be removed.
Bool canRemoveColumn(const Vector< String > &columnNames) const
Can the given columns be removed from the data manager?
void invalidateColumnCaches()
Invalidate the column caches for all columns.
void addColumn(const ColumnDesc &columnDesc, const String &dataManager, Bool byName, Bool bigEndian, const TSMOption &tsmOption, Table &tab)
void removeColumn(const Vector< String > &columnNames)
Remove the columns from the map and the data manager.
void setTableChanged()
Set the table to being changed.
std::shared_ptr< MultiFileBase > multiFile_p
void checkReadLock(Bool wait)
Check if the table is locked for read or write.
TableLockData * lockPtr_p
PlainColumn * getColumn(const String &columnName) const
Get a column by name.
Bool putFile(Bool writeTable, AipsIO &, const TableAttr &, Bool fsync)
Write all the data and let the data managers flush their data.
void initDataManagers(rownr_t nrrow, Bool bigEndian, const TSMOption &tsmOption, Table &tab)
Initialize the data managers for a new table.
ColumnSet(TableDesc *, const StorageOption &=StorageOption())
Construct from the table description.
void renameColumn(const String &newName, const String &oldName)
Rename the column in the map.
void checkDataManagerNames(const String &tableName) const
Check if no double data manager names have been given.
void openMultiFile(uInt from, const Table &tab, ByteIO::OpenOption)
Open or create the MultiFile if needed.
rownr_t nrow() const
Get nr of rows.
StorageOption storageOpt_p
int traceId() const
Get the trace-id of the table.
String uniqueDataManagerName(const String &name) const
Make a unique data manager name by appending a suffix _n if needed where n is a number that makes the...
TableDesc actualTableDesc() const
Get the actual table description.
void addColumn(const ColumnDesc &columnDesc, Bool bigEndian, const TSMOption &tsmOption, Table &tab)
Add a column to the table.
void addDataManager(DataManager *)
Add a data manager.
void checkWriteLock(Bool wait)
Bool checkDataManagerName(const String &name, uInt from, const String &tableName, Bool doTthrow=True) const
Check if a data manager name has not already been used.
void initialize(rownr_t startRownr, rownr_t endRownr)
Initialize rows startRownr till endRownr (inclusive).
std::shared_ptr< MultiFileBase > getMultiFile() const
Get the possible MultiFileBase object used to combine files.
Record dataManagerInfo(Bool virtualOnly=False) const
Get the data manager info.
std::map< String, void * > colMap_p
const StorageOption & storageOption() const
Get the storage option.
void addColumn(const ColumnDesc &columnDesc, const DataManager &dataManager, Bool bigEndian, const TSMOption &tsmOption, Table &tab)
Block< void * > blockDataMan_p
Bool canRemoveRow() const
Do all data managers and engines allow to remove rows?
Block< Bool > & dataManChanged()
Get the data manager change flags (used by PlainTable).
Bool areTablesMultiUsed() const
Are subtables used in other processes.
void doLock(FileLocker::LockType, Bool wait)
Check if the table is locked for read or write.
void reopenRW()
Reopen the data managers for read/write.
Block< Bool > dataManChanged_p
void addRow(rownr_t nrrow)
Add rows to all data managers.
rownr_t getFile(AipsIO &, Table &tab, rownr_t nrrow, Bool bigEndian, const TSMOption &tsmOption)
Read the data, reconstruct the data managers, and link those to the table object.
rownr_t resync(rownr_t nrrow, Bool forceSync)
Synchronize the data managers when data in them have changed.
void userUnlock(Bool releaseFlag)
Release a temporary user lock if the given release flag is True.
Abstract base class for a data manager.
LockType
Define the possible lock types.
@ Write
Acquire a write lock.
@ Read
Acquire a read lock.
String: the storage and methods of handling collections of characters.
void autoRelease(Bool always=False)
When the inspection interval has expired, inspect if another process needs the lock.
void release(Bool always=False)
Release the lock.
Bool hasLock(FileLocker::LockType) const
Has this process the read or write lock, thus can the table be read or written safely?
Bool readLocking() const
Is read locking needed?
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.