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::TiledColumnStMan Class Reference

Tiled Column Storage Manager. More...

#include <TiledColumnStMan.h>

Inheritance diagram for casa::TiledColumnStMan:
casa::TiledStMan casa::DataManager

List of all members.

Public Member Functions

 TiledColumnStMan (const String &hypercolumnName, const IPosition &tileShape, uInt maximumCacheSize=0)
 Create a TiledDataStMan storage manager for the hypercolumn with the given name.
 TiledColumnStMan (const String &hypercolumnName, const Record &spec)
 ~TiledColumnStMan ()
 
     

virtual DataManagerclone () const
 Clone this object.
virtual Bool canAccessColumn (Bool &reask) const
 TiledColumnStMan can always access a column.
virtual String dataManagerType () const
 Get the type name of the data manager (i.e.

Static Public Member Functions

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

Private Member Functions

 TiledColumnStMan ()
 Create a TiledColumnStMan.
 TiledColumnStMan (const TiledColumnStMan &)
 Forbid copy constructor.
TiledColumnStManoperator= (const TiledColumnStMan &)
 Forbid assignment.
virtual IPosition defaultTileShape () const
 Get the (default) tile shape.
void addRow (uInt nrrow)
 Add rows to the storage manager.
virtual TSMCubegetHypercube (uInt rownr)
 Get the hypercube in which the given row is stored.
virtual TSMCubegetHypercube (uInt rownr, IPosition &position)
 Get the hypercube in which the given row is stored.
virtual void setupCheck (const TableDesc &tableDesc, const Vector< String > &dataNames) const
 Check if the hypercolumn definition fits this storage manager.
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 readHeader (uInt nrrow, Bool firstTime)
 Read the header info.

Private Attributes

IPosition tileShape_p

Detailed Description

Tiled Column Storage Manager.

Intended use:

Public interface

Review Status

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

Prerequisite

Etymology

TiledColumnStMan is the Tiled Storage Manager storing an entire column as one hypercube.

Synopsis

TiledColumnStMan is a derivation from TiledStMan, the abstract tiled storage manager class. A description of the basics of tiled storage managers is given in the Tables module description.

TiledColumnStMan allows the user to create a tiled hypercube for an entire data column and extend it in an automatic way. It is meant to be used for fixed shaped data which have to be accessed in various directions.

The TiledColumnStMan has the following (extra) properties:

Motivation

This tiled storage manager does not require any special action (like calling add/extendHypercube) when used with a column containing equally shaped arrays.

Example

     // Define the table description and the columns in it.
     TableDesc td ("", "1", TableDesc::Scratch);
     td.addColumn (ArrayColumnDesc<float>  ("RA", 1));
     td.addColumn (ArrayColumnDesc<float>  ("Dec", 1));
     td.addColumn (ScalarColumnDesc<float> ("Velocity"));
     td.addColumn (ArrayColumnDesc<float>  ("Image", 2));
     // Define the 3-dim hypercolumn with its data and coordinate columns.
     // Note that its dimensionality must be one higher than the dimensionality
     // of the data cells.
     td.defineHypercolumn ("TSMExample",
                          3,
                          stringToVector ("Image"),
                          stringToVector ("RA,Dec,Velocity"));
     // Now create a new table from the description.
     SetupNewTable newtab("tTiledColumnStMan_tmp.data", td, Table::New);
     // Create a TiledColumnStMan storage manager for the hypercolumn
     // and bind the columns to it.
     // The tile shape has to be specified for the storage manager.
     TiledColumnStMan sm1 ("TSMExample", IPosition(3,16,32,32));
     newtab.bindAll (sm1);
     // Create the table.
     Table table(newtab);
     // Define the values for the coordinates of the hypercube.
     Vector<float> raValues(512);
     Vector<float> DecValues(512);
     indgen (raValues);
     indgen (decValues, float(100));
     ArrayColumn<float> ra (table, "RA");
     ArrayColumn<float> dec (table, "Dec");
     ScalarColumn<float> velocity (table, "Velocity");
     ArrayColumn<float> image (table, "Image");
     Cube<float> imageValues(IPosition(2,512,512));
     indgen (imageValues);
     // Write some data into the data columns.
     uInt i;
     for (i=0; i<64; i++) {
         table.addRow();
        image.put (i, imageValues);
         // The RA and Dec have to be put only once, because they
         // are the same for each row.
         if (i == 0) {
             ra.put (i, raValues);
             dec.put (i, decValues);
         }
         velocity.put (i, float(i));
     }

Definition at line 154 of file TiledColumnStMan.h.


Constructor & Destructor Documentation

casa::TiledColumnStMan::TiledColumnStMan ( const String hypercolumnName,
const IPosition tileShape,
uInt  maximumCacheSize = 0 
)

Create a TiledDataStMan storage manager for the hypercolumn with the given name.

The columns used should have the FixedShape attribute set. The hypercolumn name is also the name of the storage manager. The given tile shape will be used. The given maximum cache size in bytes (default is unlimited) is persistent, thus will be reused when the table is read back. Note that the class ROTiledStManAccessor allows one to overwrite the maximum cache size temporarily. Its description contains a discussion about the effects of setting a maximum cache.
The constructor taking a Record expects fields in the record with the name of the arguments in uppercase. If not defined, their default value is used.

casa::TiledColumnStMan::TiledColumnStMan ( const String hypercolumnName,
const Record spec 
)

     

Create a TiledColumnStMan.

This constructor is private, because it should only be used by makeObject.

Forbid copy constructor.


Member Function Documentation

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

Add rows to the storage manager.

This will extend the hypercube.

Reimplemented from casa::DataManager.

virtual Bool casa::TiledColumnStMan::canAccessColumn ( Bool reask) const [virtual]

TiledColumnStMan can always access a column.

Reimplemented from casa::TiledStMan.

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

Clone this object.

It does not clone TSMColumn objects possibly used.

Implements casa::DataManager.

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

virtual String casa::TiledColumnStMan::dataManagerType ( ) const [virtual]

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

TiledColumnStMan).

Implements casa::DataManager.

virtual IPosition casa::TiledColumnStMan::defaultTileShape ( ) const [private, virtual]

Get the (default) tile shape.

Reimplemented from casa::TiledStMan.

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

virtual TSMCube* casa::TiledColumnStMan::getHypercube ( uInt  rownr) [private, virtual]

Get the hypercube in which the given row is stored.

Implements casa::TiledStMan.

virtual TSMCube* casa::TiledColumnStMan::getHypercube ( uInt  rownr,
IPosition position 
) [private, virtual]

Get the hypercube in which the given row is stored.

It also returns the position of the row in that hypercube.

Implements casa::TiledStMan.

static DataManager* casa::TiledColumnStMan::makeObject ( const String dataManagerType,
const Record spec 
) [static]

Make the object from the type name string.

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

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

Forbid assignment.

virtual void casa::TiledColumnStMan::readHeader ( uInt  nrrow,
Bool  firstTime 
) [private, virtual]

Read the header info.

Implements casa::TiledStMan.

virtual void casa::TiledColumnStMan::setupCheck ( const TableDesc tableDesc,
const Vector< String > &  dataNames 
) const [private, virtual]

Check if the hypercolumn definition fits this storage manager.

Reimplemented from casa::TiledStMan.


Member Data Documentation

Definition at line 240 of file TiledColumnStMan.h.


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