casa
$Rev:20696$
|
Class for a table held in memory. More...
#include <MemoryTable.h>
Public Member Functions | |
MemoryTable (SetupNewTable &, uInt nrrow, Bool initialize) | |
Create the table in memory using the definitions in the SetupNewTable object. | |
virtual | ~MemoryTable () |
The destructor deletes all data. | |
virtual void | reopenRW () |
Try to reopen the table (the underlying one) for read/write access. | |
virtual Bool | asBigEndian () const |
Is the table stored in big or little endian format? It returns the endian format of the machine. | |
virtual Bool | isMultiUsed (Bool checkSubTable) const |
Is the table in use (i.e. | |
virtual const TableLock & | lockOptions () const |
Get the locking info. | |
virtual void | mergeLock (const TableLock &lockOptions) |
Merge the given lock info with the existing one. | |
virtual Bool | hasLock (FileLocker::LockType) const |
Has this process the read or write lock, thus can the table be read or written safely? It always returns True. | |
virtual Bool | lock (FileLocker::LockType, uInt nattempts) |
Locking the table is a no-op. | |
virtual void | unlock () |
Unlocking the table is a no-op. | |
virtual void | flush (Bool fsync, Bool recursive) |
Flushing the table is a no-op. | |
virtual void | resync () |
Resyncing the Table is a no-op. | |
virtual uInt | getModifyCounter () const |
Get the modify counter. | |
virtual Bool | isWritable () const |
Test if the table is opened as writable. | |
virtual void | copy (const String &newName, int tableOption) const |
Copy the table and all its subtables. | |
virtual void | deepCopy (const String &newName, const Record &dataManagerInfo, int tableOption, Bool, int endianFormat, Bool noRows) const |
virtual void | rename (const String &newName, int tableOption) |
Rename the table. | |
virtual int | tableType () const |
Get the table type (Table::Memory). | |
virtual TableDesc | actualTableDesc () const |
Get the actual table description. | |
virtual Record | dataManagerInfo () const |
Get the data manager info. | |
virtual TableRecord & | keywordSet () |
Get readonly access to the table keyword set. | |
virtual TableRecord & | rwKeywordSet () |
Get read/write access to the table keyword set. | |
virtual void | flushTableInfo () |
Write the TableInfo object. | |
virtual BaseColumn * | getColumn (uInt columnIndex) const |
Get a column object using its index. | |
virtual BaseColumn * | getColumn (const String &columnName) const |
Get a column object using its name. | |
virtual Bool | canAddRow () const |
Test if it is possible to add a row to this table (yes). | |
virtual void | addRow (uInt nrrow=1, Bool initialize=True) |
Add one or more rows and possibly initialize them. | |
virtual Bool | canRemoveRow () const |
Test if it is possible to remove a row from this table (yes). | |
virtual void | removeRow (uInt rownr) |
Remove the given row. | |
virtual void | addColumn (const ColumnDesc &columnDesc, Bool addToParent) |
Add a column to the table. | |
virtual void | addColumn (const ColumnDesc &columnDesc, const String &dataManager, Bool byName, Bool addToParent) |
virtual void | addColumn (const ColumnDesc &columnDesc, const DataManager &dataManager, Bool addToParent) |
virtual void | addColumn (const TableDesc &tableDesc, const DataManager &dataManager, Bool addToParent) |
virtual Bool | canRemoveColumn (const Vector< String > &columnNames) const |
Test if columns can be removed (yes). | |
virtual void | removeColumn (const Vector< String > &columnNames) |
Remove columns. | |
virtual Bool | canRenameColumn (const String &columnName) const |
Test if a column can be renamed (yes). | |
virtual void | renameColumn (const String &newName, const String &oldName) |
Rename a column. | |
virtual void | renameHypercolumn (const String &newName, const String &oldName) |
Rename a hypercolumn. | |
virtual DataManager * | findDataManager (const String &name, Bool byColumn) const |
Find the data manager with the given name or for the given column. | |
Private Member Functions | |
MemoryTable (const MemoryTable &) | |
Copy constructor is forbidden, because copying a table requires some more knowledge (like table name of result). | |
MemoryTable & | operator= (const MemoryTable &) |
Assignment is forbidden, because copying a table requires some more knowledge (like table name of result). | |
void | setup (BaseTable *btp) |
Setup the main parts of the object. | |
Private Attributes | |
ColumnSet * | colSetPtr_p |
TableLockData * | lockPtr_p |
Class for a table held in memory.
Internal
MemoryTable holds all its data in memory. It means that the data is not persistent. However, it can be copied to another table to make the data persistent. Furthermore it is a table as all other tables, so all table functions can be applied to it. Some functions (e.g. lock) won't do anything. Also all table operations like sorting, selecting, and iterating can be used.
The constructor accepts a SetupNewTable object which can contain bindings of columns to any data manager. All bindings to storage managers will be replaced by a binding to the memory based storage manager MemoryStMan . Also all unbound columns will be bound to MemoryStMan. Thus it is still possible that a column is bound to a virtual column engine like CompressComplex .
Definition at line 82 of file MemoryTable.h.
casa::MemoryTable::MemoryTable | ( | SetupNewTable & | , |
uInt | nrrow, | ||
Bool | initialize | ||
) |
Create the table in memory using the definitions in the SetupNewTable object.
virtual casa::MemoryTable::~MemoryTable | ( | ) | [virtual] |
The destructor deletes all data.
casa::MemoryTable::MemoryTable | ( | const MemoryTable & | ) | [private] |
Copy constructor is forbidden, because copying a table requires some more knowledge (like table name of result).
Declaring it private, makes it unusable.
virtual TableDesc casa::MemoryTable::actualTableDesc | ( | ) | const [virtual] |
Get the actual table description.
Implements casa::BaseTable.
virtual void casa::MemoryTable::addColumn | ( | const ColumnDesc & | columnDesc, |
Bool | addToParent | ||
) | [virtual] |
Add a column to the table.
If the DataManager is not a virtual engine, MemoryStMan will be used. The last Bool argument is not used in MemoryTable, but can be used in other classes derived from BaseTable.
Reimplemented from casa::BaseTable.
virtual void casa::MemoryTable::addColumn | ( | const ColumnDesc & | columnDesc, |
const String & | dataManager, | ||
Bool | byName, | ||
Bool | addToParent | ||
) | [virtual] |
Reimplemented from casa::BaseTable.
virtual void casa::MemoryTable::addColumn | ( | const ColumnDesc & | columnDesc, |
const DataManager & | dataManager, | ||
Bool | addToParent | ||
) | [virtual] |
Reimplemented from casa::BaseTable.
virtual void casa::MemoryTable::addColumn | ( | const TableDesc & | tableDesc, |
const DataManager & | dataManager, | ||
Bool | addToParent | ||
) | [virtual] |
Reimplemented from casa::BaseTable.
virtual void casa::MemoryTable::addRow | ( | uInt | nrrow = 1 , |
Bool | initialize = True |
||
) | [virtual] |
Add one or more rows and possibly initialize them.
This will fail for tables not supporting addition of rows.
Reimplemented from casa::BaseTable.
virtual Bool casa::MemoryTable::asBigEndian | ( | ) | const [virtual] |
Is the table stored in big or little endian format? It returns the endian format of the machine.
Implements casa::BaseTable.
virtual Bool casa::MemoryTable::canAddRow | ( | ) | const [virtual] |
Test if it is possible to add a row to this table (yes).
Reimplemented from casa::BaseTable.
virtual Bool casa::MemoryTable::canRemoveColumn | ( | const Vector< String > & | columnNames | ) | const [virtual] |
Test if columns can be removed (yes).
Implements casa::BaseTable.
virtual Bool casa::MemoryTable::canRemoveRow | ( | ) | const [virtual] |
Test if it is possible to remove a row from this table (yes).
Reimplemented from casa::BaseTable.
virtual Bool casa::MemoryTable::canRenameColumn | ( | const String & | columnName | ) | const [virtual] |
Test if a column can be renamed (yes).
Implements casa::BaseTable.
virtual void casa::MemoryTable::copy | ( | const String & | newName, |
int | tableOption | ||
) | const [virtual] |
Copy the table and all its subtables.
It copies the contents of each row to get a real copy.
Reimplemented from casa::BaseTable.
virtual Record casa::MemoryTable::dataManagerInfo | ( | ) | const [virtual] |
Get the data manager info.
Implements casa::BaseTable.
virtual void casa::MemoryTable::deepCopy | ( | const String & | newName, |
const Record & | dataManagerInfo, | ||
int | tableOption, | ||
Bool | , | ||
int | endianFormat, | ||
Bool | noRows | ||
) | const [virtual] |
Reimplemented from casa::BaseTable.
virtual DataManager* casa::MemoryTable::findDataManager | ( | const String & | name, |
Bool | byColumn | ||
) | const [virtual] |
Find the data manager with the given name or for the given column.
There is only one storage manager (MemoryStMan) with name MSM.
Implements casa::BaseTable.
virtual void casa::MemoryTable::flush | ( | Bool | fsync, |
Bool | recursive | ||
) | [virtual] |
Flushing the table is a no-op.
Implements casa::BaseTable.
virtual void casa::MemoryTable::flushTableInfo | ( | ) | [virtual] |
virtual BaseColumn* casa::MemoryTable::getColumn | ( | uInt | columnIndex | ) | const [virtual] |
Get a column object using its index.
Implements casa::BaseTable.
virtual BaseColumn* casa::MemoryTable::getColumn | ( | const String & | columnName | ) | const [virtual] |
Get a column object using its name.
Implements casa::BaseTable.
virtual uInt casa::MemoryTable::getModifyCounter | ( | ) | const [virtual] |
virtual Bool casa::MemoryTable::hasLock | ( | FileLocker::LockType | ) | const [virtual] |
Has this process the read or write lock, thus can the table be read or written safely? It always returns True.
Implements casa::BaseTable.
virtual Bool casa::MemoryTable::isMultiUsed | ( | Bool | checkSubTable | ) | const [virtual] |
Is the table in use (i.e.
open) in another process? It always returns False.
Implements casa::BaseTable.
virtual Bool casa::MemoryTable::isWritable | ( | ) | const [virtual] |
virtual TableRecord& casa::MemoryTable::keywordSet | ( | ) | [virtual] |
Get readonly access to the table keyword set.
Implements casa::BaseTable.
virtual Bool casa::MemoryTable::lock | ( | FileLocker::LockType | , |
uInt | nattempts | ||
) | [virtual] |
Locking the table is a no-op.
Implements casa::BaseTable.
virtual const TableLock& casa::MemoryTable::lockOptions | ( | ) | const [virtual] |
virtual void casa::MemoryTable::mergeLock | ( | const TableLock & | lockOptions | ) | [virtual] |
MemoryTable& casa::MemoryTable::operator= | ( | const MemoryTable & | ) | [private] |
Assignment is forbidden, because copying a table requires some more knowledge (like table name of result).
Declaring it private, makes it unusable.
virtual void casa::MemoryTable::removeColumn | ( | const Vector< String > & | columnNames | ) | [virtual] |
Remove columns.
Implements casa::BaseTable.
virtual void casa::MemoryTable::removeRow | ( | uInt | rownr | ) | [virtual] |
Remove the given row.
Reimplemented from casa::BaseTable.
virtual void casa::MemoryTable::rename | ( | const String & | newName, |
int | tableOption | ||
) | [virtual] |
virtual void casa::MemoryTable::renameColumn | ( | const String & | newName, |
const String & | oldName | ||
) | [virtual] |
Rename a column.
Implements casa::BaseTable.
virtual void casa::MemoryTable::renameHypercolumn | ( | const String & | newName, |
const String & | oldName | ||
) | [virtual] |
Rename a hypercolumn.
Implements casa::BaseTable.
virtual void casa::MemoryTable::reopenRW | ( | ) | [virtual] |
Try to reopen the table (the underlying one) for read/write access.
It does nothing.
Implements casa::BaseTable.
virtual void casa::MemoryTable::resync | ( | ) | [virtual] |
Resyncing the Table is a no-op.
Implements casa::BaseTable.
virtual TableRecord& casa::MemoryTable::rwKeywordSet | ( | ) | [virtual] |
Get read/write access to the table keyword set.
Implements casa::BaseTable.
void casa::MemoryTable::setup | ( | BaseTable * | btp | ) | [private] |
virtual int casa::MemoryTable::tableType | ( | ) | const [virtual] |
Get the table type (Table::Memory).
Reimplemented from casa::BaseTable.
virtual void casa::MemoryTable::unlock | ( | ) | [virtual] |
Unlocking the table is a no-op.
Implements casa::BaseTable.
ColumnSet* casa::MemoryTable::colSetPtr_p [private] |
Definition at line 224 of file MemoryTable.h.
TableLockData* casa::MemoryTable::lockPtr_p [private] |
Definition at line 225 of file MemoryTable.h.