casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
casa::StManAipsIO Class Reference

AipsIO table storage manager class. More...

#include <StManAipsIO.h>

Inheritance diagram for casa::StManAipsIO:
casa::DataManager

List of all members.

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 &)
 ~StManAipsIO ()
 
     

DataManagerclone () const
 Clone this object.
String dataManagerType () const
 Get the type name of the data manager (i.e.
String dataManagerName () const
 Get the name given to this storage manager.
uInt uniqueNr ()
 Get a unique column number for the column (it is only unique for this storage manager).
uInt nrow () const
 Get the nr of rows in this storage manager.
void setHasPut ()
 Set the hasPut_p flag.
Bool canAddRow () const
 Does the storage manager allow to add rows? (yes)
Bool canRemoveRow () const
 Does the storage manager allow to delete rows? (yes)
Bool canAddColumn () const
 Does the storage manager allow to add columns? (yes)
Bool canRemoveColumn () const
 Does the storage manager allow to delete columns? (yes)
StManArrayFileopenArrayFile (ByteIO::OpenOption opt)
 Open (if needed) the file for indirect arrays with the given mode.

Static Public Member Functions

static DataManagermakeObject (const String &dataManagerType, const Record &spec)
 Make the object from the string.

Private Member Functions

 StManAipsIO (const StManAipsIO &)
 Forbid copy constructor.
StManAipsIOoperator= (const StManAipsIO &)
 Forbid assignment.
virtual Bool flush (AipsIO &, Bool fsync)
 Flush and optionally fsync the data.
virtual void create (uInt nrrow)
 Let the storage manager create files as needed for a new table.
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.
virtual void resync (uInt 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).
void addRow (uInt nrrow)
 Add rows to all columns.
void removeRow (uInt rownr)
 Delete a row from all columns.
DataManagerColumnmakeScalarColumn (const String &name, int dataType, const String &dataTypeID)
 Create a column in the storage manager on behalf of a table column.
DataManagerColumnmakeDirArrColumn (const String &name, int dataType, const String &dataTypeID)
 Create a direct array column.
DataManagerColumnmakeIndArrColumn (const String &name, int dataType, const String &dataTypeID)
 Create an indirect array column.
void addColumn (DataManagerColumn *)
 Add a column.
void removeColumn (DataManagerColumn *)
 Delete a column.

Private Attributes

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

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


Constructor & Destructor Documentation

Create an AipsIO storage manager.

Its name will be blank.

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

casa::StManAipsIO::StManAipsIO ( const String storageManagerName,
const Record  
)

     

Forbid copy constructor.


Member Function Documentation

void casa::StManAipsIO::addColumn ( DataManagerColumn ) [private, virtual]

Add a column.

Reimplemented from casa::DataManager.

void casa::StManAipsIO::addRow ( uInt  nrrow) [private, virtual]

Add rows to all columns.

Reimplemented from casa::DataManager.

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

Reimplemented from casa::DataManager.

Bool casa::StManAipsIO::canAddRow ( ) const [virtual]

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

Reimplemented from casa::DataManager.

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

Reimplemented from casa::DataManager.

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

Reimplemented from casa::DataManager.

DataManager* casa::StManAipsIO::clone ( ) const [virtual]

Clone this object.

It does not clone StManAipsIOColumn objects possibly used.

Implements casa::DataManager.

virtual void casa::StManAipsIO::create ( uInt  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.

Implements casa::DataManager.

Get the name given to this storage manager.

Reimplemented from casa::DataManager.

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

StManAipsIO).

Implements casa::DataManager.

virtual void casa::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).

Implements casa::DataManager.

virtual Bool casa::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).

Implements casa::DataManager.

DataManagerColumn* casa::StManAipsIO::makeDirArrColumn ( const String name,
int  dataType,
const String dataTypeID 
) [private, virtual]

Create a direct array column.

Implements casa::DataManager.

DataManagerColumn* casa::StManAipsIO::makeIndArrColumn ( const String name,
int  dataType,
const String dataTypeID 
) [private, virtual]

Create an indirect array column.

Implements casa::DataManager.

static DataManager* casa::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* casa::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.

Implements casa::DataManager.

uInt casa::StManAipsIO::nrow ( ) const [inline]

Get the nr of rows in this storage manager.

Definition at line 398 of file StManAipsIO.h.

References nrrow_p.

virtual void casa::StManAipsIO::open ( uInt  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.

Implements casa::DataManager.

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

Return a pointer to the object.

StManAipsIO& casa::StManAipsIO::operator= ( const StManAipsIO ) [private]

Forbid assignment.

void casa::StManAipsIO::removeColumn ( DataManagerColumn ) [private, virtual]

Delete a column.

Reimplemented from casa::DataManager.

void casa::StManAipsIO::removeRow ( uInt  rownr) [private, virtual]

Delete a row from all columns.

Reimplemented from casa::DataManager.

virtual void casa::StManAipsIO::reopenRW ( ) [private, virtual]

Reopen the storage manager files for read/write.

Reimplemented from casa::DataManager.

virtual void casa::StManAipsIO::resync ( uInt  nrrow) [private, virtual]

Resync the storage manager with the new file contents.

This is done by clearing the cache.

Implements casa::DataManager.

void casa::StManAipsIO::setHasPut ( ) [inline]

Set the hasPut_p flag.

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

Definition at line 403 of file StManAipsIO.h.

References hasPut_p, and casa::True.

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

References uniqnr_p.


Member Data Documentation

The assembly of all columns.

Definition at line 492 of file StManAipsIO.h.

Has anything been put since the last flush?

Definition at line 494 of file StManAipsIO.h.

Referenced by setHasPut().

The file containing the indirect arrays.

Definition at line 496 of file StManAipsIO.h.

The number of rows in the columns.

Definition at line 490 of file StManAipsIO.h.

Referenced by nrow().

Name given by user to this storage manager.

Definition at line 486 of file StManAipsIO.h.

Unique nr for column in this storage manager.

Definition at line 488 of file StManAipsIO.h.

Referenced by uniqueNr().


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