casacore
|
Base class for memory-based table storage manager class. More...
#include <MSMBase.h>
Public Member Functions | |
MSMBase () | |
Create a memory storage manager. More... | |
MSMBase (const String &storageManagerName) | |
Create a memory storage manager with the given name. More... | |
MSMBase (const String &storageManagerName, const Record &) | |
virtual | ~MSMBase () |
virtual DataManager * | clone () const |
Clone this object. More... | |
virtual String | dataManagerType () const |
Get the type name of the data manager (i.e. More... | |
virtual String | dataManagerName () const |
Get the name given to this storage manager. More... | |
void | setHasPut () |
Set the hasPut_p flag. More... | |
rownr_t | nrow () const |
Get the nr of rows in this storage manager. More... | |
virtual Bool | canAddRow () const |
Does the storage manager allow to add rows? (yes) More... | |
virtual Bool | canRemoveRow () const |
Does the storage manager allow to delete rows? (yes) More... | |
virtual Bool | canAddColumn () const |
Does the storage manager allow to add columns? (yes) More... | |
virtual Bool | canRemoveColumn () const |
Does the storage manager allow to delete columns? (yes) More... | |
Public Member Functions inherited from casacore::DataManager | |
DataManager () | |
Default constructor. More... | |
virtual | ~DataManager () |
void | dataManagerInfo (Record &info) const |
Add SEQNR and SPEC (the DataManagerSpec subrecord) to the info. More... | |
virtual Record | dataManagerSpec () const |
Return a record containing data manager specifications. More... | |
virtual Record | getProperties () const |
Get data manager properties that can be modified. More... | |
virtual void | setProperties (const Record &spec) |
Modify data manager properties given in record fields. More... | |
virtual Bool | isStorageManager () const |
Is the data manager a storage manager? The default is yes. More... | |
uInt | sequenceNr () const |
Get the (unique) sequence nr of this data manager. More... | |
uInt | ncolumn () const |
Get the nr of columns in this data manager (can be zero). More... | |
Bool | asBigEndian () const |
Have the data to be stored in big or little endian canonical format? More... | |
const TSMOption & | tsmOption () const |
Get the TSM option. More... | |
MultiFileBase * | multiFile () |
Get the MultiFile pointer (can be 0). More... | |
String | keywordName (const String &keyword) const |
Compose a keyword name from the given keyword appended with the sequence number (e.g. More... | |
String | fileName () const |
Compose a unique filename from the table name and sequence number. More... | |
ByteIO::OpenOption | fileOption () const |
Get the AipsIO option of the underlying file. More... | |
virtual Bool | isRegular () const |
Is this a regular storage manager? It is regular if it allows addition of rows and writing data in them. More... | |
Table & | table () const |
Get the table this object is associated with. More... | |
virtual void | reopenRW () |
Reopen the data manager for read/write access. More... | |
virtual Bool | canRenameColumn () const |
Does the data manager allow to rename columns? (default yes) More... | |
virtual void | setMaximumCacheSize (uInt nMiB) |
Set the maximum cache size (in bytes) to be used by a storage manager. More... | |
virtual void | showCacheStatistics (std::ostream &) const |
Show the data manager's IO statistics. More... | |
DataManagerColumn * | createScalarColumn (const String &columnName, int dataType, const String &dataTypeId) |
Create a column in the data manager on behalf of a table column. More... | |
DataManagerColumn * | createDirArrColumn (const String &columnName, int dataType, const String &dataTypeId) |
Create a direct array column. More... | |
DataManagerColumn * | createIndArrColumn (const String &columnName, int dataType, const String &dataTypeId) |
Create an indirect array column. More... | |
DataManager * | getClone () const |
Has the object already been cloned? More... | |
void | setClone (DataManager *clone) const |
Set the pointer to the clone. More... | |
Static Public Member Functions | |
static DataManager * | makeObject (const String &dataManagerType, const Record &spec) |
Make the object from the string. More... | |
Static Public Member Functions inherited from casacore::DataManager | |
static void | registerCtor (const String &type, DataManagerCtor func) |
Register a mapping of a data manager type to its static construction function. More... | |
static DataManagerCtor | getCtor (const String &dataManagerType) |
Get the "constructor" of a data manager (thread-safe). More... | |
static Bool | isRegistered (const String &dataManagerType) |
Test if a data manager is registered (thread-safe). More... | |
static DataManager * | unknownDataManager (const String &dataManagerType, const Record &spec) |
Serve as default function for theirRegisterMap, which catches all unknown data manager types. More... | |
Protected Attributes | |
String | stmanName_p |
Name given by user to this storage manager. More... | |
rownr_t | nrrow_p |
The number of rows in the columns. More... | |
rownr_t | nrrowCreate_p |
The number of rows in create(). More... | |
PtrBlock< MSMColumn * > | colSet_p |
The assembly of all columns. More... | |
Bool | hasPut_p |
Has anything been put since the last flush? More... | |
Private Member Functions | |
virtual Bool | flush (AipsIO &, Bool fsync) |
Flush and optionally fsync the data. More... | |
virtual void | create64 (rownr_t nrrow) |
Let the storage manager create the nr of rows needed. More... | |
virtual rownr_t | open64 (rownr_t nrrow, AipsIO &) |
Open the storage manager file for an existing table. More... | |
virtual void | prepare () |
Let the data manager initialize itself further. More... | |
virtual rownr_t | resync64 (rownr_t nrrow) |
Resync the storage manager with the new file contents. More... | |
virtual void | deleteManager () |
The data manager will be deleted (because all its columns are requested to be deleted). More... | |
virtual void | addRow64 (rownr_t nrrow) |
Add rows to all columns. More... | |
virtual void | removeRow64 (rownr_t rownr) |
Delete a row from all columns. More... | |
virtual DataManagerColumn * | makeScalarColumn (const String &name, int dataType, const String &dataTypeID) |
Create a column in the storage manager on behalf of a table column. More... | |
virtual DataManagerColumn * | makeDirArrColumn (const String &name, int dataType, const String &dataTypeID) |
Create a direct array column. More... | |
virtual DataManagerColumn * | makeIndArrColumn (const String &name, int dataType, const String &dataTypeID) |
Create an indirect array column. More... | |
virtual Bool | canReallocateColumns () const |
The MemoryStMan wants to do reallocateColumn. More... | |
virtual DataManagerColumn * | reallocateColumn (DataManagerColumn *column) |
Reallocate the column object if it is part of this data manager. More... | |
virtual void | addColumn (DataManagerColumn *) |
Add a column. More... | |
virtual void | removeColumn (DataManagerColumn *) |
Delete a column. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from casacore::DataManager | |
static rownr_t | MAXROWNR32 |
Define the highest row number that can be represented as signed 32-bit. More... | |
Protected Member Functions inherited from casacore::DataManager | |
void | decrementNcolumn () |
Decrement number of columns (in case a column is deleted). More... | |
void | setEndian (Bool bigEndian) |
Tell the data manager if big or little endian format is needed. More... | |
void | setTsmOption (const TSMOption &tsmOption) |
Tell the data manager which TSM option to use. More... | |
void | setMultiFile (MultiFileBase *mfile) |
Tell the data manager that MultiFile can be used. More... | |
virtual Bool | hasMultiFileSupport () const |
Does the data manager support use of MultiFile? A derived class has to return True if it can use the MultiFile. More... | |
void | throwDataTypeOther (const String &columnName, int dataType) const |
Throw an exception in case data type is TpOther, because the storage managers (and maybe other data managers) do not support such columns. More... | |
Base class for memory-based table storage manager class.
Internal
MSMBase is the base class for MemoryStMan.
See class MemoryStMan for the description.
casacore::MSMBase::MSMBase | ( | ) |
Create a memory storage manager.
Its name will be blank.
casacore::MSMBase::MSMBase | ( | const String & | storageManagerName | ) |
Create a memory storage manager with the given name.
Its name can be used later in e.g. Table::addColumn to add a column to this storage manager.
Note that the 2nd constructor is needed for table creation from a record specification.
|
virtual |
|
privatevirtual |
Add a column.
Reimplemented from casacore::DataManager.
|
privatevirtual |
Add rows to all columns.
Reimplemented from casacore::DataManager.
|
virtual |
Does the storage manager allow to add columns? (yes)
Reimplemented from casacore::DataManager.
|
virtual |
Does the storage manager allow to add rows? (yes)
Reimplemented from casacore::DataManager.
|
privatevirtual |
The MemoryStMan wants to do reallocateColumn.
Reimplemented from casacore::DataManager.
|
virtual |
Does the storage manager allow to delete columns? (yes)
Reimplemented from casacore::DataManager.
|
virtual |
Does the storage manager allow to delete rows? (yes)
Reimplemented from casacore::DataManager.
|
virtual |
Clone this object.
It does not clone MSMColumn objects possibly used.
Implements casacore::DataManager.
Reimplemented in casacore::StManAipsIO.
|
privatevirtual |
Let the storage manager create the nr of rows needed.
Reimplemented from casacore::DataManager.
Reimplemented in casacore::StManAipsIO.
|
virtual |
Get the name given to this storage manager.
Reimplemented from casacore::DataManager.
|
virtual |
Get the type name of the data manager (i.e.
Implements casacore::DataManager.
Reimplemented in casacore::StManAipsIO.
|
privatevirtual |
The data manager will be deleted (because all its columns are requested to be deleted).
It does not have to do anything.
Implements casacore::DataManager.
Reimplemented in casacore::StManAipsIO.
Flush and optionally fsync the data.
It does not done anything and always returns a False status.
Implements casacore::DataManager.
Reimplemented in casacore::StManAipsIO.
|
privatevirtual |
Create a direct array column.
Implements casacore::DataManager.
Reimplemented in casacore::StManAipsIO.
|
privatevirtual |
Create an indirect array column.
Implements casacore::DataManager.
Reimplemented in casacore::StManAipsIO.
|
static |
Make the object from the string.
This function gets registered in the DataManager "constructor" map.
|
privatevirtual |
Create a column in the storage manager on behalf of a table column.
Create a scalar column.
Implements casacore::DataManager.
Reimplemented in casacore::StManAipsIO.
|
inline |
Open the storage manager file for an existing table.
It fills the rows with 0 values.
Reimplemented from casacore::DataManager.
Reimplemented in casacore::StManAipsIO.
|
privatevirtual |
Let the data manager initialize itself further.
It creates nr of rows (given to create) if needed. Note this is done after reallocateColumn.
Reimplemented from casacore::DataManager.
|
privatevirtual |
Reallocate the column object if it is part of this data manager.
It returns a pointer to the new column object. It is used to replace an MSMIndColumn object for indirect array with a fixed shape by an MSMDirColumn object.
Reimplemented from casacore::DataManager.
|
privatevirtual |
Delete a column.
Reimplemented from casacore::DataManager.
|
privatevirtual |
Delete a row from all columns.
Reimplemented from casacore::DataManager.
Resync the storage manager with the new file contents.
It adds or removes rows as needed. It cannot know which rows are deleted, so it always deletes the last rows.
Reimplemented from casacore::DataManager.
Reimplemented in casacore::StManAipsIO.
|
inline |
Set the hasPut_p flag.
In this way the StManAipsIOColumn objects can indicate that data have been put.
Definition at line 99 of file MSMBase.h.
References hasPut_p, and casacore::True.
|
protected |
Has anything been put since the last flush?
Definition at line 196 of file MSMBase.h.
Referenced by setHasPut().
|
protected |
|
protected |
|
protected |