Loading...
Searching...
No Matches
casacore::StManAipsIO Class Reference
tables package (libcasa_tables) » DataMan_module

AipsIO table storage manager class. More...

`#include <StManAipsIO.h>`

## Public Member Functions

| StManAipsIO ()
| Create an AipsIO storage manager.
| StManAipsIO (const String &storageManagerName)
| Create an AipsIO storage manager with the given name.
| StManAipsIO (const String &storageManagerName, const Record &)
virtual | ~StManAipsIO ()
| StManAipsIO (const StManAipsIO &)=delete
| Forbid copy constructor.
StManAipsIO & | operator= (const StManAipsIO &)=delete
| Forbid assignment.
virtual DataManager * | clone () const
| Clone this object.
virtual String | dataManagerType () const
| Get the type name of the data manager (i.e.
uInt | uniqueNr ()
| Get a unique column number for the column (it is only unique for this storage manager).
StManArrayFile * | openArrayFile (ByteIO::OpenOption opt)
| Open (if needed) the file for indirect arrays with the given mode.
Public Member Functions inherited from casacore::MSMBase
| MSMBase ()
| Create a memory storage manager.
| MSMBase (const String &storageManagerName)
| Create a memory storage manager with the given name.
| MSMBase (const String &storageManagerName, const Record &)
virtual | ~MSMBase ()
virtual String | dataManagerName () const
| Get the name given to this storage manager.
void | setHasPut ()
| Set the hasPut_p flag.
rownr_t | nrow () const
| Get the nr of rows in this storage manager.
virtual Bool | canAddRow () const
| Does the storage manager allow to add rows?
virtual Bool | canRemoveRow () const
| Does the storage manager allow to delete rows?
virtual Bool | canAddColumn () const
| Does the storage manager allow to add columns?
virtual Bool | canRemoveColumn () const
| Does the storage manager allow to delete columns?
Public Member Functions inherited from casacore::DataManager
| DataManager ()
| Default constructor.
virtual | ~DataManager ()
| DataManager (const DataManager &)=delete
| The copy constructor cannot be used for this base class.
DataManager & | operator= (const DataManager &)=delete
| Assignment cannot be used for this base class.
void | dataManagerInfo (Record &info) const
| Add SEQNR and SPEC (the DataManagerSpec subrecord) to the info.
virtual Record | dataManagerSpec () const
| Return a record containing data manager specifications.
virtual Record | getProperties () const
| Get data manager properties that can be modified.
virtual void | setProperties (const Record &spec)
| Modify data manager properties given in record fields.
virtual Bool | isStorageManager () const
| Is the data manager a storage manager?
uInt | sequenceNr () const
| Get the (unique) sequence nr of this data manager.
uInt | ncolumn () const
| Get the nr of columns in this data manager (can be zero).
Bool | asBigEndian () const
| Have the data to be stored in big or little endian canonical format?
const TSMOption & | tsmOption () const
| Get the TSM option.
std::shared_ptr< 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.
String | fileName () const
| Compose a unique filename from the table name and sequence number.
ByteIO::OpenOption | fileOption () const
| Get the AipsIO option of the underlying file.
virtual Bool | isRegular () const
| Is this a regular storage manager?
Table & | table () const
| Get the table this object is associated with.
virtual Bool | canRenameColumn () const
| Does the data manager allow to rename columns?
virtual void | setMaximumCacheSize (uInt nMiB)
| Set the maximum cache size (in bytes) to be used by a storage manager.
virtual void | showCacheStatistics (std::ostream &) const
| Show the data manager's IO statistics.
DataManagerColumn * | createScalarColumn (const String &columnName, int dataType, const String &dataTypeId)
| Create a column in the data manager on behalf of a table column.
DataManagerColumn * | createDirArrColumn (const String &columnName, int dataType, const String &dataTypeId)
| Create a direct array column.
DataManagerColumn * | createIndArrColumn (const String &columnName, int dataType, const String &dataTypeId)
| Create an indirect array column.
DataManager * | getClone () const
| Has the object already been cloned?
void | setClone (DataManager *clone) const
| Set the pointer to the clone.

## Static Public Member Functions

static DataManager * | makeObject (const String &dataManagerType, const Record &spec)
| Make the object from the string.
Static Public Member Functions inherited from casacore::MSMBase
static DataManager * | makeObject (const String &dataManagerType, const Record &spec)
| Make the object from the string.
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.
static DataManagerCtor | getCtor (const String &dataManagerType)
| Get the "constructor" of a data manager (thread-safe).
static Bool | isRegistered (const String &dataManagerType)
| Test if a data manager is registered (thread-safe).
static DataManager * | unknownDataManager (const String &dataManagerType, const Record &spec)
| Serve as default function for theirRegisterMap, which catches all unknown data manager types.

## Private Member Functions

virtual Bool | flush (AipsIO &, Bool fsync)
| Flush and optionally fsync the data.
virtual void | create64 (rownr_t nrrow)
| Let the storage manager create files as needed for a new table.
virtual rownr_t | open64 (rownr_t nrrow, AipsIO &)
| Open the storage manager file for an existing table and read in the data and let the StManColumnAipsIO objects read their data.
virtual rownr_t | resync64 (rownr_t nrrow)
| Resync the storage manager with the new file contents.
virtual void | reopenRW ()
| Reopen the storage manager files for read/write.
virtual void | deleteManager ()
| The data manager will be deleted (because all its columns are requested to be deleted).
DataManagerColumn * | makeScalarColumn (const String &name, int dataType, const String &dataTypeID)
| Create a column in the storage manager on behalf of a table column.
DataManagerColumn * | makeDirArrColumn (const String &name, int dataType, const String &dataTypeID)
| Create a direct array column.
DataManagerColumn * | makeIndArrColumn (const String &name, int dataType, const String &dataTypeID)
| Create an indirect array column.

## Private Attributes

uInt | uniqnr_p
| Unique nr for column in this storage manager.
StManArrayFile * | iosfile_p
| The file containing the indirect arrays.

## 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.
Protected Member Functions inherited from casacore::DataManager
void | decrementNcolumn ()
| Decrement number of columns (in case a column is deleted).
void | setEndian (Bool bigEndian)
| Tell the data manager if big or little endian format is needed.
void | setTsmOption (const TSMOption &tsmOption)
| Tell the data manager which TSM option to use.
void | setMultiFile (const std::shared_ptr< MultiFileBase > &mfile)
| Tell the data manager that MultiFile can be used.
virtual Bool | hasMultiFileSupport () const
| Does the data manager support use of MultiFile?
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.
Protected Attributes inherited from casacore::MSMBase
String | stmanName_p
| Name given by user to this storage manager.
rownr_t | nrrow_p
| The number of rows in the columns.
rownr_t | nrrowCreate_p
| The number of rows in create().
Block< MSMColumn * > | colSet_p
| The assembly of all columns.
Bool | hasPut_p
| Has anything been put since the last flush?

## Detailed Description

AipsIO table storage manager class.

### Intended use:

Public interface

### Review Status

Reviewed By:
  UNKNOWN
Date Reviewed:
  before2004/08/25

### Prerequisite

- DataManager
- StManColumnAipsIO

### Etymology

StManAipsIO is the storage manager using AipsIO.

### Synopsis

StManAipsIO is a table storage manager based on AipsIO. It holds the data in the columns in memory and writes them to a file when the table gets closed. Only the data of indirect arrays are directly read/written from/to a file. It contains pointers to the underlying StManColumnAipsIO objects, which do the actual data handling.

The AipsIO storage manager does fully support addition and removal of rows and columns.

All data, except indirect columns, for this storage manager are kept in one file. The file name is the table name appended with .N_AipsIO, where N is the (unique) storage manager sequence number. Each column containing indirect arrays is stored in a separate file using class StManIndArrayColumnAipsIO. The name of such a file is the storage manager file name appended with _cM, where M is a unique column sequence number acquired using function uniqueNr().

Definition at line 191 of file StManAipsIO.h.

## Constructor & Destructor Documentation

## StManAipsIO() [1/4]

casacore::StManAipsIO::StManAipsIO | ( |  | ) |

Create an AipsIO storage manager.

Its name will be blank.

Referenced by operator=(), and StManAipsIO().

## StManAipsIO() [2/4]

casacore::StManAipsIO::StManAipsIO | ( | const String & | storageManagerName | ) |

Create an AipsIO 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.

## StManAipsIO() [3/4]

casacore::StManAipsIO::StManAipsIO | ( | const String & | storageManagerName,
|  | const Record & | )

References casacore::Record().

## ~StManAipsIO()

virtual casacore::StManAipsIO::~StManAipsIO | ( |  | ) |

virtual

## StManAipsIO() [4/4]

casacore::StManAipsIO::StManAipsIO | ( | const StManAipsIO & |  | ) |

delete

Forbid copy constructor.

References StManAipsIO().

## Member Function Documentation

## clone()

virtual DataManager * casacore::StManAipsIO::clone | ( |  | ) | const

virtual

Clone this object.

It does not clone StManAipsIOColumn objects possibly used.

Reimplemented from casacore::MSMBase.

## create64()

virtual void casacore::StManAipsIO::create64 | ( | rownr_t | nrrow | ) |

private virtual

Let the storage manager create files as needed for a new table.

This allows a column with an indirect array to create its file.

Reimplemented from casacore::MSMBase.

## dataManagerType()

virtual String casacore::StManAipsIO::dataManagerType | ( |  | ) | const

virtual

Get the type name of the data manager (i.e.

StManAipsIO).

Reimplemented from casacore::MSMBase.

Referenced by makeObject().

## deleteManager()

virtual void casacore::StManAipsIO::deleteManager | ( |  | ) |

private virtual

The data manager will be deleted (because all its columns are requested to be deleted).

So clean up the things needed (e.g. delete files).

Reimplemented from casacore::MSMBase.

## flush()

virtual Bool casacore::StManAipsIO::flush | ( | AipsIO & | ,
|  | Bool | fsync )

private virtual

Flush and optionally fsync the data.

It returns a True status if it had to flush (i.e. if data have changed).

Reimplemented from casacore::MSMBase.

## makeDirArrColumn()

DataManagerColumn * casacore::StManAipsIO::makeDirArrColumn | ( | const String & | name,
|  | int | dataType,
|  | const String & | dataTypeID )

private virtual

Create a direct array column.

Reimplemented from casacore::MSMBase.

References casacore::dataType(), and casacore::name().

## makeIndArrColumn()

DataManagerColumn * casacore::StManAipsIO::makeIndArrColumn | ( | const String & | name,
|  | int | dataType,
|  | const String & | dataTypeID )

private virtual

Create an indirect array column.

Reimplemented from casacore::MSMBase.

References casacore::dataType(), and casacore::name().

## makeObject()

DataManager * casacore::StManAipsIO::makeObject | ( | const String & | dataManagerType,
|  | const Record & | spec )

static

Make the object from the string.

This function gets registered in the DataManager "constructor" map.

References dataManagerType(), and casacore::Record().

## makeScalarColumn()

DataManagerColumn * casacore::StManAipsIO::makeScalarColumn | ( | const String & | name,
|  | int | dataType,
|  | const String & | dataTypeID )

private virtual

Create a column in the storage manager on behalf of a table column.

Create a scalar column.

Reimplemented from casacore::MSMBase.

References casacore::dataType(), and casacore::name().

## open64()

virtual rownr_t casacore::StManAipsIO::open64 | ( | rownr_t | nrrow,
|  | AipsIO & | )

private virtual

Open the storage manager file for an existing table and read in the data and let the StManColumnAipsIO objects read their data.

Reimplemented from casacore::MSMBase.

## openArrayFile()

StManArrayFile * casacore::StManAipsIO::openArrayFile | ( | ByteIO::OpenOption | opt | ) |

Open (if needed) the file for indirect arrays with the given mode.

Return a pointer to the object.

## operator=()

StManAipsIO & casacore::StManAipsIO::operator= | ( | const StManAipsIO & |  | ) |

delete

Forbid assignment.

References StManAipsIO().

## reopenRW()

virtual void casacore::StManAipsIO::reopenRW | ( |  | ) |

private virtual

Reopen the storage manager files for read/write.

Reimplemented from casacore::DataManager.

## resync64()

virtual rownr_t casacore::StManAipsIO::resync64 | ( | rownr_t | nrrow | ) |

private virtual

Resync the storage manager with the new file contents.

This is done by clearing the cache.

Reimplemented from casacore::MSMBase.

## uniqueNr()

uInt casacore::StManAipsIO::uniqueNr | ( |  | ) |

inline

Get a unique column number for the column (it is only unique for this storage manager).

This is used by StManIndArrayColumnAipsIO to create a unique file name.

Definition at line 227 of file StManAipsIO.h.

References uniqnr_p.

## Member Data Documentation

## iosfile_p

StManArrayFile* casacore::StManAipsIO::iosfile_p

private

The file containing the indirect arrays.

Definition at line 282 of file StManAipsIO.h.

## uniqnr_p

uInt casacore::StManAipsIO::uniqnr_p

private

Unique nr for column in this storage manager.

Definition at line 280 of file StManAipsIO.h.

Referenced by uniqueNr().

The documentation for this class was generated from the following file:

- tables/DataMan/StManAipsIO.h