28 #ifndef TABLES_DATAMANAGER_H
29 #define TABLES_DATAMANAGER_H
360 const String& dataTypeId);
364 const String& dataTypeId);
368 const String& dataTypeId);
431 const String& dataTypeId) = 0;
435 const String& dataTypeId) = 0;
439 const String& dataTypeId) = 0;
445 int dataType,
const String& dataTypeId)
const;
void setMultiFile(MultiFileBase *mfile)
Tell the data manager that MultiFile can be used.
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 m...
static std::recursive_mutex theirMutex
static void registerCtor(const String &type, DataManagerCtor func)
Register a mapping of a data manager type to its static construction function.
Create a new table - define shapes, data managers, etc.
uInt ncolumn() const
Get the nr of columns in this data manager (can be zero).
static std::map< String, DataManagerCtor > initRegisterMap()
Register the main data managers.
static rownr_t MAXROWNR32
Define the highest row number that can be represented as signed 32-bit.
ByteIO::OpenOption fileOption() const
Get the AipsIO option of the underlying file.
Main interface class to a read/write table.
void decrementNcolumn()
Decrement number of columns (in case a column is deleted).
virtual Bool canAddRow() const
Does the data manager allow to add rows? (default no)
virtual uInt open1(uInt nrrow, AipsIO &ios)
virtual Bool flush(AipsIO &ios, Bool fsync)=0
Flush and optionally fsync the data.
Abstract base class to combine multiple files in a single one.
void dataManagerInfo(Record &info) const
Add SEQNR and SPEC (the DataManagerSpec subrecord) to the info.
AipsIO is the object persistency mechanism of Casacore.
virtual void removeRow(uInt rownr)
virtual Record dataManagerSpec() const
Return a record containing data manager specifications.
virtual Bool canRenameColumn() const
Does the data manager allow to rename columns? (default yes)
Abstract base class for a column in a data manager.
virtual void reopenRW()
Reopen the data manager for read/write access.
virtual void resync(uInt nrrow)
const TSMOption & tsmOption() const
Get the TSM option.
String fileName() const
Compose a unique filename from the table name and sequence number.
static DataManagerCtor getCtor(const String &dataManagerType)
Get the "constructor" of a data manager (thread-safe).
virtual Bool hasMultiFileSupport() const
Does the data manager support use of MultiFile? A derived class has to return True if it can use the ...
virtual void deleteManager()=0
The data manager will be deleted (because all its columns are requested to be deleted).
virtual void addRow(uInt nrrow)
Backward compatibility function using uInt instead of rownr_t.
MultiFileBase * multiFile()
Get the MultiFile pointer (can be 0).
String keywordName(const String &keyword) const
Compose a keyword name from the given keyword appended with the sequence number (e.g.
virtual String dataManagerName() const
Return the name of the data manager.
virtual void create64(rownr_t nrrow)
Let the data manager initialize itself for a new table.
Class to manage a set of table columns.
DataManagerColumn * createIndArrColumn(const String &columnName, int dataType, const String &dataTypeId)
Create an indirect array column.
virtual void setMaximumCacheSize(uInt nMiB)
Set the maximum cache size (in bytes) to be used by a storage manager.
virtual void open(uInt nrrow, AipsIO &ios)
virtual void showCacheStatistics(std::ostream &) const
Show the data manager's IO statistics.
void setClone(DataManager *clone) const
Set the pointer to the clone.
static Bool isRegistered(const String &dataManagerType)
Test if a data manager is registered (thread-safe).
virtual void addRow64(rownr_t nrrow)
Add rows to all columns.
virtual Bool canRemoveColumn() const
Does the data manager allow to delete columns? (default no)
virtual Bool canRemoveRow() const
Does the data manager allow to delete rows? (default no)
virtual DataManagerColumn * makeScalarColumn(const String &columnName, int dataType, const String &dataTypeId)=0
Create a column in the data manager on behalf of a table column.
virtual void removeRow64(rownr_t rownr)
Delete a row from all columns.
virtual DataManagerColumn * makeIndArrColumn(const String &columnName, int dataType, const String &dataTypeId)=0
Create an indirect array column.
virtual Record getProperties() const
Get data manager properties that can be modified.
virtual void create(uInt nrrow)
virtual void setProperties(const Record &spec)
Modify data manager properties given in record fields.
void setTsmOption(const TSMOption &tsmOption)
Tell the data manager which TSM option to use.
virtual void prepare()
Let the data manager initialize itself further.
DataManager & operator=(const DataManager &)
Assignment cannot be used for this base class.
Options for the Tiled Storage Manager Access.
A hierarchical collection of named fields of various types.
virtual Bool canReallocateColumns() const
Tell if the data manager wants to reallocate the data manager column objects.
bool Bool
Define the standard types used by Casacore.
void linkToTable(Table &tab)
Link the data manager to the Table object.
virtual void removeColumn(DataManagerColumn *)
Delete a column.
virtual DataManagerColumn * reallocateColumn(DataManagerColumn *column)
Reallocate the column object if it is part of this data manager.
virtual DataManagerColumn * makeDirArrColumn(const String &columnName, int dataType, const String &dataTypeId)=0
Create a direct array column.
virtual Bool isRegular() const
Is this a regular storage manager? It is regular if it allows addition of rows and writing data in th...
DataManager * getClone() const
Has the object already been cloned?
DataManager()
Default constructor.
uInt sequenceNr() const
Get the (unique) sequence nr of this data manager.
virtual rownr_t open64(rownr_t nrrow, AipsIO &ios)
Let the data manager initialize itself for an existing table.
uInt64 rownr_t
Define the type of a row number in a table.
virtual String dataManagerType() const =0
Return the type name of the data manager (in fact its class name).
virtual DataManager * clone() const =0
Make a clone of the derived object.
virtual void addColumn(DataManagerColumn *)
Add a column.
OpenOption
Define the possible ByteIO open options.
Abstract base class for a data manager.
virtual uInt resync1(uInt nrrow)
void setEndian(Bool bigEndian)
Tell the data manager if big or little endian format is needed.
virtual Bool isStorageManager() const
Is the data manager a storage manager? The default is yes.
String: the storage and methods of handling collections of characters.
virtual Bool canAddColumn() const
Does the data manager allow to add columns? (default no)
MultiFileBase * multiFile_p
Table & table() const
Get the table this object is associated with.
DataManagerColumn * createDirArrColumn(const String &columnName, int dataType, const String &dataTypeId)
Create a direct array column.
void checkDataType(const DataManagerColumn *colPtr, const String &columnName, int dataType, const String &dataTypeId) const
Check if the data type of the created data manager column is correct.
DataManagerColumn * createScalarColumn(const String &columnName, int dataType, const String &dataTypeId)
Create a column in the data manager on behalf of a table column.
virtual rownr_t resync64(rownr_t nrrow)
Resync the data by rereading cached data from the file.
void setSeqnr(uInt nr)
Set the sequence number of this data manager.
Bool asBigEndian() const
Have the data to be stored in big or little endian canonical format?
static DataManager * unknownDataManager(const String &dataManagerType, const Record &spec)
Serve as default function for theirRegisterMap, which catches all unknown data manager types...
static std::map< String, DataManagerCtor > theirRegisterMap
Declare the mapping of the data manager type name to a static "makeObject" function.