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

Base class for a column in a plain table. More...

#include <PlainColumn.h>

Inheritance diagram for casacore::PlainColumn:
casacore::BaseColumn casacore::ArrayColumnData< T > casacore::ScalarColumnData< T > casacore::ScalarRecordColumnData

Public Member Functions

 PlainColumn (const BaseColumnDesc *, ColumnSet *)
 
virtual ~PlainColumn ()
 
virtual Bool isWritable () const
 Test if the column is in principle writable. More...
 
virtual Bool isStored () const
 Test if the column is stored (otherwise it is virtual). More...
 
TableRecordrwKeywordSet ()
 Get access to the column keyword set. More...
 
TableRecordkeywordSet ()
 
uInt nrow () const
 Get nr of rows in the column. More...
 
virtual void setShapeColumn (const IPosition &shape)
 Define the shape of all arrays in the column. More...
 
virtual Bool isBound () const
 Test if the column is bound to a storage manager or virtual column engine. More...
 
virtual void bind (DataManager *)
 Bind the column to a data manager. More...
 
virtual void createDataManagerColumn ()=0
 Create a data manager column for a filled column. More...
 
DataManagerdataManager () const
 Get the pointer to the data manager. More...
 
DataManagerColumn *& dataManagerColumn ()
 Get the pointer to the data manager column. More...
 
virtual ColumnCachecolumnCache ()
 Get a pointer to the underlying column cache. More...
 
virtual void setMaximumCacheSize (uInt nbytes)
 Set the maximum cache size (in bytes) to be used by a storage manager. More...
 
void putFile (AipsIO &, const TableAttr &)
 Write the column. More...
 
void getFile (AipsIO &, const ColumnSet &, const TableAttr &)
 Read the column. More...
 
- Public Member Functions inherited from casacore::BaseColumn
 BaseColumn (const BaseColumnDesc *)
 Construct it using the given column description. More...
 
virtual ~BaseColumn ()
 
const ColumnDesccolumnDesc () const
 Get const access to the column description. More...
 
virtual Bool isDefined (uInt rownr) const =0
 Test if the given cell contains a defined value. More...
 
virtual void setShape (uInt rownr, const IPosition &shape)
 Set the shape of the array in the given row. More...
 
virtual void setShape (uInt rownr, const IPosition &shape, const IPosition &tileShape)
 Set the shape and tile shape of the array in the given row. More...
 
virtual uInt ndimColumn () const
 Get the global #dimensions of an array (ie. More...
 
virtual IPosition shapeColumn () const
 Get the global shape of an array (ie. More...
 
virtual uInt ndim (uInt rownr) const
 Get the #dimensions of an array in a particular cell. More...
 
virtual IPosition shape (uInt rownr) const
 Get the shape of an array in a particular cell. More...
 
virtual IPosition tileShape (uInt rownr) const
 Get the tile shape of an array in a particular cell. More...
 
virtual Bool canChangeShape () const
 Ask the data manager if the shape of an existing array can be changed. More...
 
virtual Bool canAccessScalarColumn (Bool &reask) const
 Ask if the data manager can handle a scalar column. More...
 
virtual Bool canAccessArrayColumn (Bool &reask) const
 Ask if the data manager can handle an array column. More...
 
virtual Bool canAccessScalarColumnCells (Bool &reask) const
 Ask if the data manager can handle a collection of cells in a scalar column. More...
 
virtual Bool canAccessArrayColumnCells (Bool &reask) const
 Ask if the data manager can handle a collection of cells in an array column. More...
 
virtual Bool canAccessSlice (Bool &reask) const
 Ask if the data manager can handle a cell slice. More...
 
virtual Bool canAccessColumnSlice (Bool &reask) const
 Ask if the data manager can handle a column slice. More...
 
virtual void initialize (uInt startRownr, uInt endRownr)=0
 Initialize the rows from startRow till endRow (inclusive) with the default value defined in the column description. More...
 
virtual void get (uInt rownr, void *dataPtr) const =0
 Get the value from a particular cell. More...
 
virtual void getSlice (uInt rownr, const Slicer &, void *dataPtr) const
 Get a slice of an N-dimensional array in a particular cell. More...
 
virtual void getScalarColumn (void *dataPtr) const
 Get the vector of all scalar values in a column. More...
 
virtual void getArrayColumn (void *dataPtr) const
 Get the array of all array values in a column. More...
 
virtual void getColumnSlice (const Slicer &, void *dataPtr) const
 Get subsections from all arrays in the column. More...
 
virtual void getScalarColumnCells (const RefRows &rownrs, void *dataPtr) const
 Get the vector of some scalar values in a column. More...
 
virtual void getArrayColumnCells (const RefRows &rownrs, void *dataPtr) const
 Get the array of some array values in a column. More...
 
virtual void getColumnSliceCells (const RefRows &rownrs, const Slicer &, void *dataPtr) const
 Get subsections from some arrays in the column. More...
 
virtual void put (uInt rownr, const void *dataPtr)=0
 Put the value in a particular cell. More...
 
virtual void putSlice (uInt rownr, const Slicer &, const void *dataPtr)
 Put a slice of an N-dimensional array in a particular cell. More...
 
virtual void putScalarColumn (const void *dataPtr)
 Put the vector of all scalar values in the column. More...
 
virtual void putArrayColumn (const void *dataPtr)
 Put the array of all array values in the column. More...
 
virtual void putColumnSlice (const Slicer &, const void *dataPtr)
 Put into subsections of all table arrays in the column. More...
 
virtual void putScalarColumnCells (const RefRows &rownrs, const void *dataPtr)
 Get the vector of some scalar values in a column. More...
 
virtual void putArrayColumnCells (const RefRows &rownrs, const void *dataPtr)
 Get the array of some array values in a column. More...
 
virtual void putColumnSliceCells (const RefRows &rownrs, const Slicer &, const void *dataPtr)
 Put subsections of some arrays in the column. More...
 
void getScalar (uInt rownr, Bool &value) const
 Get the value from the row and convert it to the required type. More...
 
void getScalar (uInt rownr, uChar &value) const
 
void getScalar (uInt rownr, Short &value) const
 
void getScalar (uInt rownr, uShort &value) const
 
void getScalar (uInt rownr, Int &value) const
 
void getScalar (uInt rownr, uInt &value) const
 
void getScalar (uInt rownr, Int64 &value) const
 
void getScalar (uInt rownr, float &value) const
 
void getScalar (uInt rownr, double &value) const
 
void getScalar (uInt rownr, Complex &value) const
 
void getScalar (uInt rownr, DComplex &value) const
 
void getScalar (uInt rownr, String &value) const
 
void getScalar (uInt rownr, TableRecord &value) const
 
void getScalar (uInt rownr, void *value, const String &dataTypeId) const
 Get a scalar for the other data types. More...
 
void putScalar (uInt rownr, const Bool &value)
 Put the value into the row and convert it from the given type. More...
 
void putScalar (uInt rownr, const uChar &value)
 
void putScalar (uInt rownr, const Short &value)
 
void putScalar (uInt rownr, const uShort &value)
 
void putScalar (uInt rownr, const Int &value)
 
void putScalar (uInt rownr, const uInt &value)
 
void putScalar (uInt rownr, const Int64 &value)
 
void putScalar (uInt rownr, const float &value)
 
void putScalar (uInt rownr, const double &value)
 
void putScalar (uInt rownr, const Complex &value)
 
void putScalar (uInt rownr, const DComplex &value)
 
void putScalar (uInt rownr, const String &value)
 
void putScalar (uInt rownr, const Char *value)
 
void putScalar (uInt rownr, const TableRecord &value)
 
virtual void makeSortKey (Sort &, CountedPtr< BaseCompare > &cmpObj, Int order, const void *&dataSave)
 Add this column and its data to the Sort object. More...
 
virtual void makeRefSortKey (Sort &, CountedPtr< BaseCompare > &cmpObj, Int order, const Vector< uInt > &rownrs, const void *&dataSave)
 Do it only for the given row numbers. More...
 
virtual void freeSortKey (const void *&dataSave)
 Free storage on the heap allocated by makeSortkey(). More...
 
virtual void allocIterBuf (void *&lastVal, void *&curVal, CountedPtr< BaseCompare > &cmpObj)
 Allocate value buffers for the table iterator. More...
 
virtual void freeIterBuf (void *&lastVal, void *&curVal)
 Free the value buffers allocated by allocIterBuf. More...
 

Protected Member Functions

int traceId () const
 Get the trace-id of the table. More...
 
virtual void putFileDerived (AipsIO &)=0
 Write the column. More...
 
virtual void getFileDerived (AipsIO &, const ColumnSet &)=0
 Read the column back. More...
 
void checkValueLength (const void *) const
 Check the length of a value. More...
 
void checkValueLength (const String *value) const
 
void checkValueLength (const Array< String > *value) const
 
void checkReadLock (Bool wait) const
 Lock the table before reading or writing. More...
 
void checkWriteLock (Bool wait) const
 
void autoReleaseLock () const
 Inspect the auto lock when the inspection interval has expired and release it when another process needs the lock. More...
 
- Protected Member Functions inherited from casacore::BaseColumn
void throwGetScalar () const
 Throw exceptions for invalid scalar get or put. More...
 
void throwPutScalar () const
 
void throwGetType (const String &type) const
 
void throwPutType (const String &type) const
 

Protected Attributes

DataManagerdataManPtr_p
 
DataManagerColumndataColPtr_p
 
ColumnSetcolSetPtr_p
 
String originalName_p
 
Bool rtraceColumn_p
 
Bool wtraceColumn_p
 
- Protected Attributes inherited from casacore::BaseColumn
const BaseColumnDesccolDescPtr_p
 

Detailed Description

Base class for a column in a plain table.

Intended use:

Internal

Review Status

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

Prerequisite

Etymology

PlainColumn represents any column in a plain table. A plain table is a regular table, i.e. not a table like a RefTable which is a view on a plain table.

Synopsis

Abstract base class for all types of columns in a plain table. It implements the common functionality for all columns in a plain table. Furthermore it defines some virtual functions (on top of the virtual functions defined in BaseColumn) which are specific for plain columns.

Definition at line 84 of file PlainColumn.h.

Constructor & Destructor Documentation

casacore::PlainColumn::PlainColumn ( const BaseColumnDesc ,
ColumnSet  
)
virtual casacore::PlainColumn::~PlainColumn ( )
virtual

Member Function Documentation

void casacore::PlainColumn::autoReleaseLock ( ) const
inlineprotected

Inspect the auto lock when the inspection interval has expired and release it when another process needs the lock.

Definition at line 197 of file PlainColumn.h.

References casacore::ColumnSet::autoReleaseLock(), and colSetPtr_p.

virtual void casacore::PlainColumn::bind ( DataManager )
virtual

Bind the column to a data manager.

void casacore::PlainColumn::checkReadLock ( Bool  wait) const
inlineprotected

Lock the table before reading or writing.

If manual or permanent locking is in effect, it checks if the table is locked.

Definition at line 193 of file PlainColumn.h.

References casacore::ColumnSet::checkReadLock(), and colSetPtr_p.

void casacore::PlainColumn::checkValueLength ( const void *  ) const
inlineprotected

Check the length of a value.

This a meant for String values for which a maximum length is defined. The void* version is a no-op for other values.

Definition at line 190 of file PlainColumn.h.

void casacore::PlainColumn::checkValueLength ( const String value) const
protected
void casacore::PlainColumn::checkValueLength ( const Array< String > *  value) const
protected
void casacore::PlainColumn::checkWriteLock ( Bool  wait) const
inlineprotected

Definition at line 195 of file PlainColumn.h.

References casacore::ColumnSet::checkWriteLock(), and colSetPtr_p.

virtual ColumnCache& casacore::PlainColumn::columnCache ( )
virtual

Get a pointer to the underlying column cache.

Implements casacore::BaseColumn.

virtual void casacore::PlainColumn::createDataManagerColumn ( )
pure virtual

Create a data manager column for a filled column.

Implemented in casacore::ArrayColumnData< T >, casacore::ScalarColumnData< T >, and casacore::ScalarRecordColumnData.

DataManager * casacore::PlainColumn::dataManager ( ) const
inline

Get the pointer to the data manager.

Definition at line 185 of file PlainColumn.h.

References dataManPtr_p.

DataManagerColumn *& casacore::PlainColumn::dataManagerColumn ( )
inline

Get the pointer to the data manager column.

Definition at line 187 of file PlainColumn.h.

References dataColPtr_p.

void casacore::PlainColumn::getFile ( AipsIO ,
const ColumnSet ,
const TableAttr  
)

Read the column.

virtual void casacore::PlainColumn::getFileDerived ( AipsIO ,
const ColumnSet  
)
protectedpure virtual

Read the column back.

The control information is read from the given AipsIO object. This is used to bind the column to the appropriate data manager.

Implemented in casacore::ArrayColumnData< T >, casacore::ScalarColumnData< T >, and casacore::ScalarRecordColumnData.

virtual Bool casacore::PlainColumn::isBound ( ) const
virtual

Test if the column is bound to a storage manager or virtual column engine.

virtual Bool casacore::PlainColumn::isStored ( ) const
virtual

Test if the column is stored (otherwise it is virtual).

Implements casacore::BaseColumn.

virtual Bool casacore::PlainColumn::isWritable ( ) const
virtual

Test if the column is in principle writable.

This does not test if the table itself is writable. That has to be done by the caller.

Implements casacore::BaseColumn.

TableRecord& casacore::PlainColumn::keywordSet ( )
virtual

Implements casacore::BaseColumn.

uInt casacore::PlainColumn::nrow ( ) const
virtual

Get nr of rows in the column.

Implements casacore::BaseColumn.

void casacore::PlainColumn::putFile ( AipsIO ,
const TableAttr  
)

Write the column.

virtual void casacore::PlainColumn::putFileDerived ( AipsIO )
protectedpure virtual

Write the column.

The control information is written into the given AipsIO object, while the data is written by the storage manager.

Implemented in casacore::ArrayColumnData< T >, casacore::ScalarColumnData< T >, and casacore::ScalarRecordColumnData.

TableRecord& casacore::PlainColumn::rwKeywordSet ( )
virtual

Get access to the column keyword set.

Implements casacore::BaseColumn.

virtual void casacore::PlainColumn::setMaximumCacheSize ( uInt  nbytes)
virtual

Set the maximum cache size (in bytes) to be used by a storage manager.

Implements casacore::BaseColumn.

virtual void casacore::PlainColumn::setShapeColumn ( const IPosition shape)
virtual

Define the shape of all arrays in the column.

Reimplemented in casacore::ArrayColumnData< T >.

int casacore::PlainColumn::traceId ( ) const
inlineprotected

Get the trace-id of the table.

Definition at line 149 of file PlainColumn.h.

References colSetPtr_p, and casacore::ColumnSet::traceId().

Member Data Documentation

ColumnSet* casacore::PlainColumn::colSetPtr_p
protected

Definition at line 143 of file PlainColumn.h.

Referenced by autoReleaseLock(), checkReadLock(), checkWriteLock(), and traceId().

DataManagerColumn* casacore::PlainColumn::dataColPtr_p
protected

Definition at line 142 of file PlainColumn.h.

Referenced by dataManagerColumn().

DataManager* casacore::PlainColumn::dataManPtr_p
protected

Definition at line 141 of file PlainColumn.h.

Referenced by dataManager().

String casacore::PlainColumn::originalName_p
protected

Definition at line 144 of file PlainColumn.h.

Bool casacore::PlainColumn::rtraceColumn_p
protected

Definition at line 145 of file PlainColumn.h.

Bool casacore::PlainColumn::wtraceColumn_p
protected

Definition at line 146 of file PlainColumn.h.


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