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

Give access to some TiledDataStMan functions. More...

#include <TiledDataStManAccessor.h>

Inheritance diagram for casacore::TiledDataStManAccessor:
casacore::ROTiledStManAccessor casacore::RODataManAccessor

Public Member Functions

 TiledDataStManAccessor (const Table &table, const String &dataManagerName)
 Construct the object for the data manager in the table. More...
 
 TiledDataStManAccessor ()
 
 ~TiledDataStManAccessor ()
 
 TiledDataStManAccessor (const TiledDataStManAccessor &that)
 Copy constructor (reference semantics). More...
 
TiledDataStManAccessoroperator= (const TiledDataStManAccessor &that)
 Assignment (reference semantics). More...
 
void addHypercube (const IPosition &cubeShape, const IPosition &tileShape, const Record &values)
 Add a hypercube. More...
 
void extendHypercube (uInt incrInLastDim, const Record &values)
 Extend the hypercube with the given number of elements in the last dimension. More...
 
- Public Member Functions inherited from casacore::ROTiledStManAccessor
 ROTiledStManAccessor ()
 Default constructor should be used with care. More...
 
 ROTiledStManAccessor (const Table &table, const String &name, Bool byColumn=False)
 Construct the object for a data manager in the table given the name of the data manager or the column. More...
 
virtual ~ROTiledStManAccessor ()
 
 ROTiledStManAccessor (const ROTiledStManAccessor &that)
 Copy constructor (reference semantics). More...
 
ROTiledStManAccessoroperator= (const ROTiledStManAccessor &that)
 Assignment (reference semantics). More...
 
void setMaximumCacheSize (uInt nMiB)
 Set the maximum cache size (in MibiByte) to be used by a hypercube in the storage manager. More...
 
uInt maximumCacheSize () const
 Get the maximum cache size (in MiB). More...
 
uInt cacheSize (uInt rownr) const
 Get the current cache size (in buckets) for the hypercube in the given row. More...
 
const IPositionhypercubeShape (uInt rownr) const
 Get the hypercube shape of the data in the given row. More...
 
const IPositiontileShape (uInt rownr) const
 Get the tile shape of the data in the given row. More...
 
uInt bucketSize (uInt rownr) const
 Get the bucket size (in bytes) of the hypercube in the given row. More...
 
const RecordvalueRecord (uInt rownr) const
 Get coordinate and id values of the hypercube in the given row. More...
 
uInt nhypercubes () const
 Return the number of hypercubes. More...
 
uInt getCacheSize (uInt hypercube) const
 Get the current cache size (in buckets) for the given hypercube. More...
 
const IPositiongetHypercubeShape (uInt hypercube) const
 Get the shape of the given hypercube. More...
 
const IPositiongetTileShape (uInt hypercube) const
 Get the tile shape of the given hypercube. More...
 
uInt getBucketSize (uInt hypercube) const
 Get the bucket size (in bytes) of the given hypercube. More...
 
const RecordgetValueRecord (uInt hypercube) const
 Get coordinate and id values of the given hypercube. More...
 
uInt calcCacheSize (uInt rownr, const IPosition &sliceShape, const IPosition &axisPath) const
 Calculate the cache size (in buckets) for accessing the hypercube containing the given row. More...
 
uInt calcCacheSize (uInt rownr, const IPosition &sliceShape, const IPosition &windowStart, const IPosition &windowLength, const IPosition &axisPath) const
 
void setCacheSize (uInt rownr, const IPosition &sliceShape, const IPosition &axisPath, Bool forceSmaller=True)
 Set the cache size using the corresponding calcCacheSize function mentioned above. More...
 
void setCacheSize (uInt rownr, const IPosition &sliceShape, const IPosition &windowStart, const IPosition &windowLength, const IPosition &axisPath, Bool forceSmaller=True)
 
void setCacheSize (uInt rownr, uInt nbuckets, Bool forceSmaller=True)
 Set the cache size for accessing the hypercube containing the given row. More...
 
void setHypercubeCacheSize (uInt hypercube, uInt nbuckets, Bool forceSmaller=True)
 This version allows setting the tile cache for a particular hypercube. More...
 
void clearCaches ()
 Clear the caches used by the hypercubes in this storage manager. More...
 
- Public Member Functions inherited from casacore::RODataManAccessor
 RODataManAccessor ()
 Construct an empty object. More...
 
 RODataManAccessor (const Table &table, const String &name, Bool byColumn)
 Construct the accessor object for a data manager in the table. More...
 
virtual ~RODataManAccessor ()
 
void setProperties (const Record &) const
 Set data manager properties using the fields in the record. More...
 
Record getProperties () const
 Get data manager properties as a record. More...
 
String dataManagerType () const
 Get the data manager type. More...
 
String dataManagerName () const
 Get the data manager name. More...
 
uInt dataManagerSeqNr () const
 Get the data manager sequence nr. More...
 
void showCacheStatistics (ostream &os) const
 Show IO statistics. More...
 

Private Attributes

TiledDataStMantiledDataManPtr_p
 

Additional Inherited Members

- Protected Member Functions inherited from casacore::ROTiledStManAccessor
DataManagergetDataManager () const
 Get the data manager. More...
 
- Protected Member Functions inherited from casacore::RODataManAccessor
DataManagerbaseDataManager () const
 Get the data manager for the given data manager or column name. More...
 

Detailed Description

Give access to some TiledDataStMan functions.

Intended use:

Public interface

Review Status

Reviewed By:
Gareth Hunt
Date Reviewed:
94Nov17

Prerequisite

Synopsis

The Table system has one or more storage managers underneath. These storage managers are invisible and there is no way to get access to them. However, the TiledDataStMan storage manager is quite specific. It has a few functions which need to be called by the user, in particular the functions defining and extending a hypercube.

The class TiledDataStManAccessor gives the user the means to access a TiledDataStMan object and to call the functions mentioned above. It can only be constructed for a table opened for read/write (because the functions in it need write access).

Motivation

In principle a pointer to TiledDataStMan could be used. However, that would give access to all public functions. Furthermore it could not distinguish between read/write and readonly tables.

Example

// Open a table for write.
Table table ("someName", Table::Update);
// Get access to the tiled data storage manager with name UVdata.
TiledDataStManAccessor accessor (Table, "UVdata");
// Add a hypercube to it (requires addition of rows).
// Define the values of the ID and coordinate columns.
// (The coordinate vectors have to be filled in one way or another).
Vector<double> timeVector(70);
Vector<double> baselineVector(60);
Vector<double> freqVector(50);
Vector<double> polVector(4);
Record values;
values.define ("ID", 4); // ID=4
values.define ("time", timeVector);
values.define ("baseline", baselineVector);
values.define ("freq", freqVector);
values.define ("pol", polVector);
table.addRow (4200);
accessor.addHypercube (IPosition(4,4,50,60,70), // cube shape
IPosition(4,4,5,6,7), // tile shape
values); // id/coord values

To Do

Definition at line 116 of file TiledDataStManAccessor.h.

Constructor & Destructor Documentation

casacore::TiledDataStManAccessor::TiledDataStManAccessor ( const Table table,
const String dataManagerName 
)

Construct the object for the data manager in the table.

An exception is thrown if the data manager type does not match the type of this TiledDataStManAccessor object. Also an exception is thrown if the table is not open for read/write.

casacore::TiledDataStManAccessor::TiledDataStManAccessor ( )
casacore::TiledDataStManAccessor::~TiledDataStManAccessor ( )
casacore::TiledDataStManAccessor::TiledDataStManAccessor ( const TiledDataStManAccessor that)

Copy constructor (reference semantics).

Member Function Documentation

void casacore::TiledDataStManAccessor::addHypercube ( const IPosition cubeShape,
const IPosition tileShape,
const Record values 
)

Add a hypercube.

The possible coordinate- and id-values have to be given in the record (where the field names should be equal to the coordinate and id column names).

void casacore::TiledDataStManAccessor::extendHypercube ( uInt  incrInLastDim,
const Record values 
)

Extend the hypercube with the given number of elements in the last dimension.

The record should contain the id values (to get the correct hypercube) and coordinate values for the elements added.

TiledDataStManAccessor& casacore::TiledDataStManAccessor::operator= ( const TiledDataStManAccessor that)

Assignment (reference semantics).

Member Data Documentation

TiledDataStMan* casacore::TiledDataStManAccessor::tiledDataManPtr_p
private

Definition at line 152 of file TiledDataStManAccessor.h.


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