casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::StManAipsIO Class Reference

AipsIO table storage manager class. More...

#include <StManAipsIO.h>

Inheritance diagram for casacore::StManAipsIO:
casacore::DataManager

Public Member Functions

 StManAipsIO ()
 Create an AipsIO storage manager. More...
 
 StManAipsIO (const String &storageManagerName)
 Create an AipsIO storage manager with the given name. More...
 
 StManAipsIO (const String &storageManagerName, const Record &)
 
 ~StManAipsIO ()
 
DataManagerclone () const
 Clone this object. More...
 
String dataManagerType () const
 Get the type name of the data manager (i.e. More...
 
String dataManagerName () const
 Get the name given to this storage manager. More...
 
uInt uniqueNr ()
 Get a unique column number for the column (it is only unique for this storage manager). More...
 
uInt nrow () const
 Get the nr of rows in this storage manager. More...
 
void setHasPut ()
 Set the hasPut_p flag. More...
 
Bool canAddRow () const
 Does the storage manager allow to add rows? (yes) More...
 
Bool canRemoveRow () const
 Does the storage manager allow to delete rows? (yes) More...
 
Bool canAddColumn () const
 Does the storage manager allow to add columns? (yes) More...
 
Bool canRemoveColumn () const
 Does the storage manager allow to delete columns? (yes) More...
 
StManArrayFileopenArrayFile (ByteIO::OpenOption opt)
 Open (if needed) the file for indirect arrays with the given mode. 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...
 
virtual Bool canReallocateColumns () const
 Tell if the data manager wants to reallocate the data manager column objects. More...
 
virtual DataManagerColumnreallocateColumn (DataManagerColumn *column)
 Reallocate the column object if it is part of this data manager. 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 TSMOptiontsmOption () const
 Get the TSM option. More...
 
MultiFileBasemultiFile ()
 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...
 
Tabletable () const
 Get the table this object is associated with. More...
 
virtual Bool canRenameColumn () const
 Does the data manager allow to rename columns? (default yes) More...
 
virtual void setMaximumCacheSize (uInt nbytes)
 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...
 
DataManagerColumncreateScalarColumn (const String &columnName, int dataType, const String &dataTypeId)
 Create a column in the data manager on behalf of a table column. More...
 
DataManagerColumncreateDirArrColumn (const String &columnName, int dataType, const String &dataTypeId)
 Create a direct array column. More...
 
DataManagerColumncreateIndArrColumn (const String &columnName, int dataType, const String &dataTypeId)
 Create an indirect array column. More...
 
DataManagergetClone () 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 DataManagermakeObject (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 DataManagerunknownDataManager (const String &dataManagerType, const Record &spec)
 Serve as default function for theirRegisterMap, which catches all unknown data manager types. More...
 

Private Member Functions

 StManAipsIO (const StManAipsIO &)
 Forbid copy constructor. More...
 
StManAipsIOoperator= (const StManAipsIO &)
 Forbid assignment. More...
 
virtual Bool flush (AipsIO &, Bool fsync)
 Flush and optionally fsync the data. More...
 
virtual void create (uInt nrrow)
 Let the storage manager create files as needed for a new table. More...
 
virtual void open (uInt nrrow, AipsIO &)
 Open the storage manager file for an existing table and read in the data and let the StManColumnAipsIO objects read their data. More...
 
virtual void resync (uInt nrrow)
 Resync the storage manager with the new file contents. More...
 
virtual void reopenRW ()
 Reopen the storage manager files for read/write. More...
 
virtual void deleteManager ()
 The data manager will be deleted (because all its columns are requested to be deleted). More...
 
void addRow (uInt nrrow)
 Add rows to all columns. More...
 
void removeRow (uInt rownr)
 Delete a row from all columns. More...
 
DataManagerColumnmakeScalarColumn (const String &name, int dataType, const String &dataTypeID)
 Create a column in the storage manager on behalf of a table column. More...
 
DataManagerColumnmakeDirArrColumn (const String &name, int dataType, const String &dataTypeID)
 Create a direct array column. More...
 
DataManagerColumnmakeIndArrColumn (const String &name, int dataType, const String &dataTypeID)
 Create an indirect array column. More...
 
void addColumn (DataManagerColumn *)
 Add a column. More...
 
void removeColumn (DataManagerColumn *)
 Delete a column. More...
 

Private Attributes

String stmanName_p
 Name given by user to this storage manager. More...
 
uInt uniqnr_p
 Unique nr for column in this storage manager. More...
 
uInt nrrow_p
 The number of rows in the columns. More...
 
PtrBlock< StManColumnAipsIO * > colSet_p
 The assembly of all columns. More...
 
Bool hasPut_p
 Has anything been put since the last flush? More...
 
StManArrayFileiosfile_p
 The file containing the indirect arrays. More...
 

Additional Inherited Members

- 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...
 

Detailed Description

AipsIO table storage manager class.

Intended use:

Public interface

Review Status

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

Prerequisite

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 367 of file StManAipsIO.h.

Constructor & Destructor Documentation

casacore::StManAipsIO::StManAipsIO ( )

Create an AipsIO storage manager.

Its name will be blank.

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.

casacore::StManAipsIO::StManAipsIO ( const String storageManagerName,
const Record  
)
casacore::StManAipsIO::~StManAipsIO ( )
casacore::StManAipsIO::StManAipsIO ( const StManAipsIO )
private

Forbid copy constructor.

Member Function Documentation

void casacore::StManAipsIO::addColumn ( DataManagerColumn )
privatevirtual

Add a column.

Reimplemented from casacore::DataManager.

void casacore::StManAipsIO::addRow ( uInt  nrrow)
privatevirtual

Add rows to all columns.

Reimplemented from casacore::DataManager.

Bool casacore::StManAipsIO::canAddColumn ( ) const
virtual

Does the storage manager allow to add columns? (yes)

Reimplemented from casacore::DataManager.

Bool casacore::StManAipsIO::canAddRow ( ) const
virtual

Does the storage manager allow to add rows? (yes)

Reimplemented from casacore::DataManager.

Bool casacore::StManAipsIO::canRemoveColumn ( ) const
virtual

Does the storage manager allow to delete columns? (yes)

Reimplemented from casacore::DataManager.

Bool casacore::StManAipsIO::canRemoveRow ( ) const
virtual

Does the storage manager allow to delete rows? (yes)

Reimplemented from casacore::DataManager.

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

Clone this object.

It does not clone StManAipsIOColumn objects possibly used.

Implements casacore::DataManager.

virtual void casacore::StManAipsIO::create ( uInt  nrrow)
privatevirtual

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

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

Implements casacore::DataManager.

String casacore::StManAipsIO::dataManagerName ( ) const
virtual

Get the name given to this storage manager.

Reimplemented from casacore::DataManager.

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

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

StManAipsIO).

Implements casacore::DataManager.

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

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).

Implements casacore::DataManager.

virtual Bool casacore::StManAipsIO::flush ( AipsIO ,
Bool  fsync 
)
privatevirtual

Flush and optionally fsync the data.

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

Implements casacore::DataManager.

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

Create a direct array column.

Implements casacore::DataManager.

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

Create an indirect array column.

Implements casacore::DataManager.

static 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.

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

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

Create a scalar column.

Implements casacore::DataManager.

uInt casacore::StManAipsIO::nrow ( ) const
inline

Get the nr of rows in this storage manager.

Definition at line 404 of file StManAipsIO.h.

References nrrow_p.

virtual void casacore::StManAipsIO::open ( uInt  nrrow,
AipsIO  
)
privatevirtual

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

Implements casacore::DataManager.

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.

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

Forbid assignment.

void casacore::StManAipsIO::removeColumn ( DataManagerColumn )
privatevirtual

Delete a column.

Reimplemented from casacore::DataManager.

void casacore::StManAipsIO::removeRow ( uInt  rownr)
privatevirtual

Delete a row from all columns.

Reimplemented from casacore::DataManager.

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

Reopen the storage manager files for read/write.

Reimplemented from casacore::DataManager.

virtual void casacore::StManAipsIO::resync ( uInt  nrrow)
privatevirtual

Resync the storage manager with the new file contents.

This is done by clearing the cache.

Implements casacore::DataManager.

void casacore::StManAipsIO::setHasPut ( )
inline

Set the hasPut_p flag.

In this way the StManAipsIOColumn objects can indicate that data have been put.

Definition at line 409 of file StManAipsIO.h.

References hasPut_p, and casacore::True.

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 400 of file StManAipsIO.h.

References uniqnr_p.

Member Data Documentation

PtrBlock<StManColumnAipsIO*> casacore::StManAipsIO::colSet_p
private

The assembly of all columns.

Definition at line 498 of file StManAipsIO.h.

Bool casacore::StManAipsIO::hasPut_p
private

Has anything been put since the last flush?

Definition at line 500 of file StManAipsIO.h.

Referenced by setHasPut().

StManArrayFile* casacore::StManAipsIO::iosfile_p
private

The file containing the indirect arrays.

Definition at line 502 of file StManAipsIO.h.

uInt casacore::StManAipsIO::nrrow_p
private

The number of rows in the columns.

Definition at line 496 of file StManAipsIO.h.

Referenced by nrow().

String casacore::StManAipsIO::stmanName_p
private

Name given by user to this storage manager.

Definition at line 492 of file StManAipsIO.h.

uInt casacore::StManAipsIO::uniqnr_p
private

Unique nr for column in this storage manager.

Definition at line 494 of file StManAipsIO.h.

Referenced by uniqueNr().


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