26#ifndef TABLES_PLAINTABLE_H
27#define TABLES_PLAINTABLE_H
31#include <casacore/casa/aips.h>
32#include <casacore/tables/Tables/BaseTable.h>
33#include <casacore/tables/Tables/TableCache.h>
34#include <casacore/tables/Tables/TableRecord.h>
35#include <casacore/tables/Tables/TableSyncData.h>
36#include <casacore/tables/DataMan/TSMOption.h>
37#include <casacore/casa/IO/AipsIO.h>
101 int endianFormat,
const TSMOption& tsmOption);
264 Bool byColumn)
const;
const TableDesc & tableDesc() const
Get the table description.
int tableOption() const
Get the table option.
OpenOption
Define the possible ByteIO open options.
Abstract base class for a data manager.
LockType
Define the possible lock types.
virtual const TableLock & lockOptions() const
Get the locking info.
static MemoryIO * releaseCallBack(void *plainTableObject, Bool always)
The callback function when a lock is released.
virtual void mergeLock(const TableLock &lockOptions)
Merge the given lock info with the existing one.
virtual void addColumn(const TableDesc &tableDesc, const DataManager &dataManager, Bool)
virtual Bool isMultiUsed(Bool checkSubTables) const
Is the table in use (i.e.
virtual void setTableChanged()
Set the table to being changed.
virtual DataManager * findDataManager(const String &name, Bool byColumn) const
Find the data manager with the given name or for the given column.
PlainTable(MPI_Comm mpiComm, SetupNewTable &, rownr_t nrrow, Bool initialize, const TableLock &lockOptions, int endianFormat, const TSMOption &tsmOption)
MPI version of the constructor.
void setEndian(int endianFormat)
Determine and set the endian format (big or little).
void checkWritable(const char *func) const
Throw an exception if the table is not writable.
virtual void removeColumn(const Vector< String > &columnNames)
Remove columns.
virtual Bool canRemoveColumn(const Vector< String > &columnNames) const
Test if columns can be removed.
PlainTable(const PlainTable &)=delete
Copy constructor is forbidden, because copying a table requires some more knowledge (like table name ...
void syncTable()
Synchronize the table after having acquired a lock which says that main table data has changed.
virtual Bool canRenameColumn(const String &columnName) const
Test if a column can be renamed (yes).
void PlainTableCommon(SetupNewTable &, rownr_t nrrow, Bool initialize, const TableLock &lockOptions, int endianFormat, const TSMOption &tsmOption)
Common part of the constructor shared by MPI and non-MPI.
virtual void renameColumn(const String &newName, const String &oldName)
Rename a column.
virtual uInt getModifyCounter() const
Get the modify counter.
virtual BaseColumn * getColumn(uInt columnIndex) const
Get a column object using its index.
void autoReleaseLock(Bool always=False)
Do a release of an AutoLock when the inspection interval has expired.
MemoryIO * doReleaseCallBack(Bool always)
Bool putFile(Bool always)
When needed, write the table control information in an AipsIO file.
virtual void renameSubTables(const String &newName, const String &oldName)
Rename the subtables (used by rename function).
virtual void renameHypercolumn(const String &newName, const String &oldName)
Rename a hypercolumn.
virtual void resync()
Resync the Table object with the table file.
virtual Record dataManagerInfo() const
Get the data manager info.
static TableCache theirTableCache
PlainTable & operator=(const PlainTable &)=delete
Assignment is forbidden, because copying a table requires some more knowledge (like table name of res...
virtual Bool isWritable() const
Test if the table is opened as writable.
static ByteIO::OpenOption toAipsIOFoption(int tableOption)
Convert a Table option to an AipsIO file option.
virtual void addColumn(const ColumnDesc &columnDesc, const DataManager &dataManager, Bool)
virtual void addColumn(const ColumnDesc &columnDesc, const String &dataManager, Bool byName, Bool)
virtual Bool hasLock(FileLocker::LockType) const
Has this process the read or write lock, thus can the table be read or written safely?
PlainTable(AipsIO &, uInt version, const String &name, const String &type, rownr_t nrrow, int option, const TableLock &lockOptions, const TSMOption &tsmOption, Bool addToCache, uInt locknr)
Construct the object for an existing table.
virtual void flush(Bool fsync, Bool recursive)
Flush the table, i.e.
virtual Bool lock(FileLocker::LockType, uInt nattempts)
Try to lock the table for read or write access.
static void getLayout(TableDesc &desc, AipsIO &ios)
Return the layout of a table (i.e.
virtual TableRecord & keywordSet()
Get readonly access to the table keyword set.
virtual BaseColumn * getColumn(const String &columnName) const
Get a column object using its name.
virtual TableDesc actualTableDesc() const
Get the actual table description.
virtual void removeRow(rownr_t rownr)
Remove the given row.
virtual void reopenRW()
Try to reopen the table for read/write access.
virtual void addColumn(const ColumnDesc &columnDesc, Bool)
Add a column to the table.
virtual void unlock()
Unlock the table.
virtual TableRecord & rwKeywordSet()
Get read/write access to the table keyword set.
virtual const StorageOption & storageOption() const
Get the storage option used for the table.
virtual Bool canRemoveRow() const
Test if it is possible to remove a row from this table.
std::shared_ptr< ColumnSet > colSetPtr_p
virtual ~PlainTable()
The destructor flushes (i.e.
virtual void addRow(rownr_t nrrow, Bool initialize)
Add one or more rows and possibly initialize them.
virtual Bool canAddRow() const
Test if it is possible to add a row to this table.
PlainTable(SetupNewTable &, rownr_t nrrow, Bool initialize, const TableLock &lockOptions, int endianFormat, const TSMOption &tsmOption)
Construct the object for a new table.
virtual Bool asBigEndian() const
Is the table stored in big or little endian format?
TableLockData * lockPtr_p
static TableCache & tableCache()
Get access to the TableCache.
void closeObject()
Close the object which is called by the destructor.
Create a new table - define shapes, data managers, etc.
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.