MemoryTable.h
Classes
- MemoryTable -- Class for a table held in memory (full description)
Interface
- Public Members
- MemoryTable (SetupNewTable&, uInt nrrow, Bool initialize)
- virtual ~MemoryTable()
- virtual void reopenRW()
- virtual Bool asBigEndian() const
- virtual Bool isMultiUsed (Bool checkSubTable) const
- virtual const TableLock& lockOptions() const
- virtual void mergeLock (const TableLock& lockOptions)
- virtual Bool hasLock (FileLocker::LockType) const
- virtual Bool lock (FileLocker::LockType, uInt nattempts)
- virtual void unlock()
- virtual void flush (Bool sync)
- virtual void resync()
- virtual uInt getModifyCounter() const
- virtual Bool isWritable() const
- virtual void copy (const String& newName, int tableOption) const
- virtual void deepCopy (const String& newName, const Record& dataManagerInfo, int tableOption, Bool) const
- virtual void rename (const String& newName, int tableOption)
- virtual int tableType() const
- virtual TableDesc actualTableDesc() const
- virtual Record dataManagerInfo() const
- virtual TableRecord& keywordSet()
- virtual TableRecord& rwKeywordSet()
- virtual void flushTableInfo()
- virtual BaseColumn* getColumn (uInt columnIndex) const
- virtual BaseColumn* getColumn (const String& columnName) const
- virtual Bool canAddRow() const
- virtual void addRow (uInt nrrow = 1, Bool initialize = True)
- virtual Bool canRemoveRow() const
- virtual void removeRow (uInt rownr)
- virtual void addColumn (const ColumnDesc& columnDesc)
- virtual void addColumn (const ColumnDesc& columnDesc, const String& dataManager, Bool byName)
- virtual void addColumn (const ColumnDesc& columnDesc, const DataManager& dataManager)
- virtual void addColumn (const TableDesc& tableDesc, const DataManager& dataManager)
- virtual Bool canRemoveColumn (const Vector<String>& columnNames) const
- virtual void removeColumn (const Vector<String>& columnNames)
- virtual Bool canRenameColumn (const String& columnName) const
- virtual void renameColumn (const String& newName, const String& oldName)
- virtual DataManager* findDataManager (const String& dataManagerName) const
- Private Members
- MemoryTable (const MemoryTable&)
- MemoryTable& operator= (const MemoryTable&)
- void setup (BaseTable* btp)
Prerequisite
Synopsis
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.
Member Description
Create the table in memory using the definitions in the
SetupNewTable object.
The destructor deletes all data.
Try to reopen the table (the underlying one) for read/write access.
It does nothing.
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. open) in another process?
It always returns False.
Get the locking info.
It returns PermanentLocking.
Merge the given lock info with the existing one.
It does nothing.
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 sync)
Flushing the table is a no-op.
virtual void resync()
Resyncing the Table is a no-op.
Get the modify counter. It always returns 0.
virtual Bool isWritable() const
Test if the table is opened as writable. It always returns True.
virtual void copy (const String& newName, int tableOption) const
virtual void deepCopy (const String& newName, const Record& dataManagerInfo, int tableOption, Bool) const
Copy the table and all its subtables.
It copies the contents of each row to get a real copy.
virtual void rename (const String& newName, int tableOption)
Rename the table. The tableOption is ignored.
virtual int tableType() const
Get the table type (Table::Memory).
Get the actual table description.
Get the data manager info.
Get readonly access to the table keyword set.
Get read/write access to the table keyword set.
Write the TableInfo object. It does not do anything.
Get a column object using its index.
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.
This will fail for tables not supporting addition of rows.
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)
virtual void addColumn (const ColumnDesc& columnDesc, const String& dataManager, Bool byName)
virtual void addColumn (const ColumnDesc& columnDesc, const DataManager& dataManager)
virtual void addColumn (const TableDesc& tableDesc, const DataManager& dataManager)
Add a column to the table.
If the DataManager is not a virtual engine, MemoryStMan will be used.
Test if columns can be removed (yes).
Remove columns.
Test if a column can be renamed (yes).
Rename a column.
Find the data manager with the given name.
There is only one storage manager (MemoryStMan) with name MSM.
Copy constructor is forbidden, because copying a table requires
some more knowledge (like table name of result).
Declaring it private, makes it unusable.
MemoryTable& operator= (const MemoryTable&)
Assignment is forbidden, because copying a table requires
some more knowledge (like table name of result).
Declaring it private, makes it unusable.
Setup the main parts of the object.
Create the initial name map from the table description.
This map maps a name to the name in the original table.
A rename might change the map.
Create the RefColumn objects.
Create the initial TableInfo as a copy of the original BaseTable.