Loading...
Searching...
No Matches
casacore::BaseColumnDesc Class Referenceabstract
tables package (libcasa_tables) » Tables_module » Tables_module_internal_classes

More...

`#include <BaseColDesc.h>`

## Public Member Functions

| BaseColumnDesc (const String &name, const String &comment, const String &dataManagerType, const String &dataManagerGroup, DataType, const String &dataTypeId, Int options, uInt ndim, const IPosition &shape, Bool isScalar, Bool isArray, Bool isTable)
| Construct the column base object.
| BaseColumnDesc (const BaseColumnDesc &)
| Copy constructor (copy semantics).
virtual | ~BaseColumnDesc ()
TableRecord & | rwKeywordSet ()
| Get access to the set of keywords.
const TableRecord & | keywordSet () const
virtual void | show (ostream &os) const =0
| Show the column.
const String & | name () const
| Get the name of the column.
DataType | dataType () const
| Get the data type of the column.
const String & | dataTypeId () const
| Get the type id for non-standard data types (i.e.
const String & | dataManagerType () const
| Get the type name of the default data manager.
String & | dataManagerType ()
| Get the type name of the default data manager.
const String & | dataManagerGroup () const
| Get the data manager group.
String & | dataManagerGroup ()
| Get the data manager group.
void | setDefaultDataManager (Bool always)
| Set the data manager type and group to the default.
const String & | comment () const
| Get comment string.
String & | comment ()
| Get comment string (allowing it to be changed).
Int | options () const
| Get the options.
Bool | isScalar () const
| Test if column is scalar, array or table.
Bool | isArray () const
Bool | isTable () const
Int | ndim () const
| Get the number of dimensions.
const IPosition & | shape () const
| Get the predefined shape.
void | setNdim (uInt ndim)
| Set the number of dimensions.
void | setShape (const IPosition &shape)
| Set the predefined shape.
void | setShape (const IPosition &shape, Bool directOption)
void | setOptions (Int options)
| Set the options to the given value.
uInt | maxLength () const
| Get the maximum value length.
void | setMaxLength (uInt maxLength)
| Set the maximum value length.
const TableDesc * | tableDesc () const
| Get table description (in case column contains subtables).
virtual TableDesc * | tableDesc ()
virtual BaseColumnDesc * | clone () const =0
| Clone a column description (creating a new column description object).
virtual String | className () const =0
| Get the underlying class name.
void | setName (const String &name)
| Set the name of the column (for a rename).

## Protected Member Functions

BaseColumnDesc & | operator= (const BaseColumnDesc &)
| Assignment (copy semantics).
void | putFile (AipsIO &, const TableAttr &) const
| Put the object.
void | getFile (AipsIO &, const TableAttr &)
| Get the object.
virtual void | putDesc (AipsIO &) const =0
| Put the derived object.
virtual void | getDesc (AipsIO &)=0
| Get the derived object.
virtual PlainColumn * | makeColumn (ColumnSet *) const =0
| Make a PlainColumn object out of the description.
RefColumn * | makeRefColumn (RefTable *, BaseColumn *) const
| Make a RefColumn object out of the description.
virtual ConcatColumn * | makeConcatColumn (ConcatTable *) const
| Make a ConcatColumn object out of the description.

## Protected Attributes

String | colName_p
String | comment_p
String | dataManType_p
String | dataManGroup_p
DataType | dtype_p
String | dtypeId_p
Int | option_p
Int | nrdim_p
IPosition | shape_p
uInt | maxLength_p
TableRecord * | keySetPtr_p
Bool | isScalar_p
Bool | isArray_p
Bool | isTable_p

## Private Member Functions

virtual void | checkAdd (const ColumnDescSet &cds) const
| Check if a column can be handled by ColumnDescSet.
virtual void | checkRename (const ColumnDescSet &cds, const String &newName) const
virtual void | handleAdd (ColumnDescSet &cds)
| Take action after a column has been handled by ColumnDescSet.
virtual void | handleRename (ColumnDescSet &cds, const String &oldName)
virtual void | handleRemove (ColumnDescSet &cds)
virtual void | renameAction (const String &newName, const String &oldName)
| This function allows each column to act upon a rename of another column.

## Friends

class | ColumnDesc

## Detailed Description

An abstract base class for table column descriptions

### Intended use:

Internal

### Review Status

Reviewed By:
  Paul Shannon
Date Reviewed:
  1994/08/11
Test programs:
  none

### Prerequisite

- Tables module (see especially Tables.h, the module header file)
- The description of letter/envelope class design, and its application to the family of classes of which BaseColumnDesc is a part, in ColumnDesc.h
- TableDesc

### Etymology

"Base" indicates that this is a base class for the specialized column description classes.

### Synopsis

BaseColumnDesc is an abstract class describing a column in a table. Various XXXXColumnDesc classes are derived from it to describe the various types of columns, among them ArrayColumnDesc<T> and ScalarcolumnDesc<T>. These derived classes are used to construct a column description which can be added to the TableDesc.

BaseColumnDesc contains functions common to all kinds of column descriptions. It contains a TableRecord to attach simple keywords to the column description (e.g. to define a scale-factor). This keyword set serves as the initial keyword set for the column when a table gets instantiated from a table description.

The ColumnDesc class is an envelope around BaseColumnDesc, which can be used to get information about existing column descriptions.

### Motivation

This abstract base class defines the common features required of all concrete column description classes. It also provides the hook (for letter objects) required by ColumnDesc, the envelope class.

Definition at line 105 of file BaseColDesc.h.

## Constructor & Destructor Documentation

## BaseColumnDesc() [1/2]

casacore::BaseColumnDesc::BaseColumnDesc | ( | const String & | name,
|  | const String & | comment,
|  | const String & | dataManagerType,
|  | const String & | dataManagerGroup,
|  | DataType | ,
|  | const String & | dataTypeId,
|  | Int | options,
|  | uInt | ndim,
|  | const IPosition & | shape,
|  | Bool | isScalar,
|  | Bool | isArray,
|  | Bool | isTable )

Construct the column base object.

References comment(), dataManagerGroup(), dataManagerType(), dataTypeId(), isArray(), isScalar(), isTable(), name(), ndim(), options(), and shape().

Referenced by BaseColumnDesc(), clone(), casacore::ScalarColumnDesc< T >::clone(), casacore::ScalarRecordColumnDesc::clone(), casacore::SubTableDesc::clone(), casacore::ScalarColumnDesc< T >::makeDesc(), casacore::ScalarRecordColumnDesc::makeDesc(), casacore::SubTableDesc::makeDesc(), operator=(), and tableDesc().

## BaseColumnDesc() [2/2]

casacore::BaseColumnDesc::BaseColumnDesc | ( | const BaseColumnDesc & |  | ) |

Copy constructor (copy semantics).

References BaseColumnDesc().

## ~BaseColumnDesc()

virtual casacore::BaseColumnDesc::~BaseColumnDesc | ( |  | ) |

virtual

## Member Function Documentation

## checkAdd()

virtual void casacore::BaseColumnDesc::checkAdd | ( | const ColumnDescSet & | cds | ) | const

private virtual

Check if a column can be handled by ColumnDescSet.

This gives, for instance, the virtual column class the opportunity to check if the used columns exist.

## checkRename()

virtual void casacore::BaseColumnDesc::checkRename | ( | const ColumnDescSet & | cds,
|  | const String & | newName ) const

private virtual

## className()

virtual String casacore::BaseColumnDesc::className | ( |  | ) | const

pure virtual

Get the underlying class name.

Implemented in casacore::ArrayColumnDescBase, casacore::ScalarColumnDesc< T >, casacore::ScalarRecordColumnDesc, and casacore::SubTableDesc.

## clone()

virtual BaseColumnDesc * casacore::BaseColumnDesc::clone | ( |  | ) | const

pure virtual

Clone a column description (creating a new column description object).

Implemented in casacore::ArrayColumnDesc< T >, casacore::ScalarColumnDesc< T >, casacore::ScalarRecordColumnDesc, and casacore::SubTableDesc.

References BaseColumnDesc().

## comment() [1/2]

String & casacore::BaseColumnDesc::comment | ( |  | ) |

inline

Get comment string (allowing it to be changed).

Definition at line 175 of file BaseColDesc.h.

References comment_p.

## comment() [2/2]

const String & casacore::BaseColumnDesc::comment | ( |  | ) | const

inline

Get comment string.

Definition at line 171 of file BaseColDesc.h.

References comment_p.

Referenced by casacore::ArrayColumnDescBase::ArrayColumnDescBase(), BaseColumnDesc(), casacore::ScalarColumnDesc< T >::ScalarColumnDesc(), casacore::ScalarColumnDesc< T >::ScalarColumnDesc(), casacore::ScalarColumnDesc< T >::ScalarColumnDesc(), casacore::ScalarRecordColumnDesc::ScalarRecordColumnDesc(), casacore::ScalarRecordColumnDesc::ScalarRecordColumnDesc(), casacore::SubTableDesc::SubTableDesc(), casacore::SubTableDesc::SubTableDesc(), and casacore::SubTableDesc::SubTableDesc().

## dataManagerGroup() [1/2]

String & casacore::BaseColumnDesc::dataManagerGroup | ( |  | ) |

inline

Get the data manager group.

(allowing it to be changed)

Definition at line 163 of file BaseColDesc.h.

References dataManGroup_p.

## dataManagerGroup() [2/2]

const String & casacore::BaseColumnDesc::dataManagerGroup | ( |  | ) | const

inline

Get the data manager group.

Definition at line 158 of file BaseColDesc.h.

References dataManGroup_p.

Referenced by casacore::ArrayColumnDescBase::ArrayColumnDescBase(), and BaseColumnDesc().

## dataManagerType() [1/2]

String & casacore::BaseColumnDesc::dataManagerType | ( |  | ) |

inline

Get the type name of the default data manager.

(allowing it to be changed)

Definition at line 154 of file BaseColDesc.h.

References dataManType_p.

## dataManagerType() [2/2]

const String & casacore::BaseColumnDesc::dataManagerType | ( |  | ) | const

inline

Get the type name of the default data manager.

Definition at line 149 of file BaseColDesc.h.

References dataManType_p.

Referenced by casacore::ArrayColumnDescBase::ArrayColumnDescBase(), and BaseColumnDesc().

## dataType()

DataType casacore::BaseColumnDesc::dataType | ( |  | ) | const

inline

Get the data type of the column.

Definition at line 140 of file BaseColDesc.h.

References dtype_p.

## dataTypeId()

const String & casacore::BaseColumnDesc::dataTypeId | ( |  | ) | const

inline

Get the type id for non-standard data types (i.e.

for TpOther). For standard data types the returned string is empty.

Definition at line 145 of file BaseColDesc.h.

References dtypeId_p.

Referenced by casacore::ArrayColumnDescBase::ArrayColumnDescBase(), and BaseColumnDesc().

## getDesc()

virtual void casacore::BaseColumnDesc::getDesc | ( | AipsIO & |  | ) |

protected pure virtual

Get the derived object.

Implemented in casacore::ArrayColumnDescBase, casacore::ScalarColumnDesc< T >, casacore::ScalarRecordColumnDesc, and casacore::SubTableDesc.

## getFile()

void casacore::BaseColumnDesc::getFile | ( | AipsIO & | ,
|  | const TableAttr & | )

protected

Get the object.

It uses getDesc to get the derived object.

## handleAdd()

virtual void casacore::BaseColumnDesc::handleAdd | ( | ColumnDescSet & | cds | ) |

private virtual

Take action after a column has been handled by ColumnDescSet.

This gives, for instance, the virtual column class the opportunity to update the virtual column list.

Reimplemented in casacore::SubTableDesc.

## handleRemove()

virtual void casacore::BaseColumnDesc::handleRemove | ( | ColumnDescSet & | cds | ) |

private virtual

## handleRename()

virtual void casacore::BaseColumnDesc::handleRename | ( | ColumnDescSet & | cds,
|  | const String & | oldName )

private virtual

## isArray()

Bool casacore::BaseColumnDesc::isArray | ( |  | ) | const

inline

Definition at line 186 of file BaseColDesc.h.

References isArray_p.

Referenced by BaseColumnDesc().

## isScalar()

Bool casacore::BaseColumnDesc::isScalar | ( |  | ) | const

inline

Test if column is scalar, array or table.

Definition at line 184 of file BaseColDesc.h.

References isScalar_p.

Referenced by BaseColumnDesc().

## isTable()

Bool casacore::BaseColumnDesc::isTable | ( |  | ) | const

inline

Definition at line 188 of file BaseColDesc.h.

References isTable_p.

Referenced by BaseColumnDesc().

## keywordSet()

const TableRecord & casacore::BaseColumnDesc::keywordSet | ( |  | ) | const

inline

Definition at line 128 of file BaseColDesc.h.

References keySetPtr_p.

## makeColumn()

virtual PlainColumn * casacore::BaseColumnDesc::makeColumn | ( | ColumnSet * |  | ) | const

protected pure virtual

Make a PlainColumn object out of the description.

Implemented in casacore::ArrayColumnDescBase, casacore::ScalarColumnDesc< T >, casacore::ScalarRecordColumnDesc, and casacore::SubTableDesc.

## makeConcatColumn()

virtual ConcatColumn * casacore::BaseColumnDesc::makeConcatColumn | ( | ConcatTable * |  | ) | const

protected virtual

Make a ConcatColumn object out of the description.

The default makes a ConcatColumn object. Derived classes (ScalarColumnDesc) can make more specialized objects.

Reimplemented in casacore::ScalarColumnDesc< T >.

## makeRefColumn()

RefColumn * casacore::BaseColumnDesc::makeRefColumn | ( | RefTable * | ,
|  | BaseColumn * | ) const

protected

Make a RefColumn object out of the description.

## maxLength()

uInt casacore::BaseColumnDesc::maxLength | ( |  | ) | const

inline

Get the maximum value length.

Definition at line 228 of file BaseColDesc.h.

References maxLength_p.

Referenced by setMaxLength().

## name()

const String & casacore::BaseColumnDesc::name | ( |  | ) | const

inline

Get the name of the column.

Definition at line 136 of file BaseColDesc.h.

References colName_p.

Referenced by casacore::ArrayColumnDescBase::ArrayColumnDescBase(), BaseColumnDesc(), casacore::ScalarColumnDesc< T >::makeDesc(), casacore::ScalarRecordColumnDesc::makeDesc(), casacore::SubTableDesc::makeDesc(), casacore::ScalarColumnDesc< T >::ScalarColumnDesc(), casacore::ScalarColumnDesc< T >::ScalarColumnDesc(), casacore::ScalarColumnDesc< T >::ScalarColumnDesc(), casacore::ScalarColumnDesc< T >::ScalarColumnDesc(), casacore::ScalarRecordColumnDesc::ScalarRecordColumnDesc(), casacore::ScalarRecordColumnDesc::ScalarRecordColumnDesc(), casacore::ScalarRecordColumnDesc::ScalarRecordColumnDesc(), and setName().

## ndim()

Int casacore::BaseColumnDesc::ndim | ( |  | ) | const

inline

Get the number of dimensions.

Definition at line 193 of file BaseColDesc.h.

References nrdim_p.

Referenced by casacore::ArrayColumnDescBase::ArrayColumnDescBase(), BaseColumnDesc(), and setNdim().

## operator=()

BaseColumnDesc & casacore::BaseColumnDesc::operator= | ( | const BaseColumnDesc & |  | ) |

protected

Assignment (copy semantics).

References BaseColumnDesc().

## options()

Int casacore::BaseColumnDesc::options | ( |  | ) | const

inline

Get the options.

Definition at line 179 of file BaseColDesc.h.

References option_p.

Referenced by casacore::ArrayColumnDesc< T >::ArrayColumnDesc(), casacore::ArrayColumnDesc< T >::ArrayColumnDesc(), casacore::ArrayColumnDesc< T >::ArrayColumnDesc(), casacore::ArrayColumnDesc< T >::ArrayColumnDesc(), casacore::ArrayColumnDesc< T >::ArrayColumnDesc(), casacore::ArrayColumnDesc< T >::ArrayColumnDesc(), casacore::ArrayColumnDescBase::ArrayColumnDescBase(), BaseColumnDesc(), casacore::ScalarColumnDesc< T >::ScalarColumnDesc(), casacore::ScalarColumnDesc< T >::ScalarColumnDesc(), casacore::ScalarColumnDesc< T >::ScalarColumnDesc(), casacore::ScalarColumnDesc< T >::ScalarColumnDesc(), setOptions(), casacore::SubTableDesc::SubTableDesc(), casacore::SubTableDesc::SubTableDesc(), and casacore::SubTableDesc::SubTableDesc().

## putDesc()

virtual void casacore::BaseColumnDesc::putDesc | ( | AipsIO & |  | ) | const

protected pure virtual

Put the derived object.

Implemented in casacore::ArrayColumnDescBase, casacore::ScalarColumnDesc< T >, casacore::ScalarRecordColumnDesc, and casacore::SubTableDesc.

## putFile()

void casacore::BaseColumnDesc::putFile | ( | AipsIO & | ,
|  | const TableAttr & | ) const

protected

Put the object.

It uses putDesc to put the derived object.

## renameAction()

virtual void casacore::BaseColumnDesc::renameAction | ( | const String & | newName,
|  | const String & | oldName )

private virtual

This function allows each column to act upon a rename of another column.

If the old name is used internally, the column can update itself.

## rwKeywordSet()

TableRecord & casacore::BaseColumnDesc::rwKeywordSet | ( |  | ) |

inline

Get access to the set of keywords.

Definition at line 126 of file BaseColDesc.h.

References keySetPtr_p.

## setDefaultDataManager()

void casacore::BaseColumnDesc::setDefaultDataManager | ( | Bool | always | ) |

Set the data manager type and group to the default.

If always==True they are always set, otherwise only if empty.

## setMaxLength()

void casacore::BaseColumnDesc::setMaxLength | ( | uInt | maxLength | ) |

Set the maximum value length.

So far, this is only possible for columns containing String values. An exception is thrown if the column data type is not TpString. Some storage managers support fixed length strings and can store them more efficiently than variable length strings.

References maxLength().

## setName()

void casacore::BaseColumnDesc::setName | ( | const String & | name | ) |

inline

Set the name of the column (for a rename).

Definition at line 322 of file BaseColDesc.h.

References colName_p, and name().

## setNdim()

void casacore::BaseColumnDesc::setNdim | ( | uInt | ndim | ) |

Set the number of dimensions.

This is only allowed for arrays. ndim can be zero to clear the number of dimensions and the shape. Otherwise it can only be used if the dimensionality has not been defined yet.

References ndim().

## setOptions()

void casacore::BaseColumnDesc::setOptions | ( | Int | options | ) |

Set the options to the given value.

Option ColumnDesc::Direct forces FixedShape. If FixedShape is not given (implicitly or explicitly), the column can have no shape, so its shape is cleared.

References options().

## setShape() [1/2]

void casacore::BaseColumnDesc::setShape | ( | const IPosition & | shape | ) |

Set the predefined shape.

This is only allowed for arrays, for which the shape has not been defined yet. If the dimensionality has already been defined, it must match. It will set the option FixedShape if not set yet.
The first version leaves the Direct option as is. The second version sets the Direct option as given.

References shape().

## setShape() [2/2]

void casacore::BaseColumnDesc::setShape | ( | const IPosition & | shape,
|  | Bool | directOption )

References shape().

## shape()

const IPosition & casacore::BaseColumnDesc::shape | ( |  | ) | const

inline

Get the predefined shape.

If not defined, a zero shape will be returned.

Definition at line 198 of file BaseColDesc.h.

References shape_p.

Referenced by casacore::ArrayColumnDescBase::ArrayColumnDescBase(), BaseColumnDesc(), setShape(), and setShape().

## show()

virtual void casacore::BaseColumnDesc::show | ( | ostream & | os | ) | const

pure virtual

Show the column.

Implemented in casacore::ArrayColumnDescBase, casacore::ScalarColumnDesc< T >, casacore::ScalarRecordColumnDesc, and casacore::SubTableDesc.

## tableDesc() [1/2]

virtual TableDesc * casacore::BaseColumnDesc::tableDesc | ( |  | ) |

virtual

Reimplemented in casacore::SubTableDesc.

## tableDesc() [2/2]

const TableDesc * casacore::BaseColumnDesc::tableDesc | ( |  | ) | const

inline

Get table description (in case column contains subtables).

Definition at line 242 of file BaseColDesc.h.

References BaseColumnDesc().

## Friends And Related Symbol Documentation

## ColumnDesc

friend class ColumnDesc

friend

Definition at line 108 of file BaseColDesc.h.

References ColumnDesc.

Referenced by ColumnDesc.

## Member Data Documentation

## colName_p

String casacore::BaseColumnDesc::colName_p

protected

Definition at line 248 of file BaseColDesc.h.

Referenced by name(), and setName().

## comment_p

String casacore::BaseColumnDesc::comment_p

protected

Definition at line 249 of file BaseColDesc.h.

Referenced by comment(), and comment().

## dataManGroup_p

String casacore::BaseColumnDesc::dataManGroup_p

protected

Definition at line 251 of file BaseColDesc.h.

Referenced by dataManagerGroup(), and dataManagerGroup().

## dataManType_p

String casacore::BaseColumnDesc::dataManType_p

protected

Definition at line 250 of file BaseColDesc.h.

Referenced by dataManagerType(), and dataManagerType().

## dtype_p

DataType casacore::BaseColumnDesc::dtype_p

protected

Definition at line 252 of file BaseColDesc.h.

Referenced by dataType().

## dtypeId_p

String casacore::BaseColumnDesc::dtypeId_p

protected

Definition at line 253 of file BaseColDesc.h.

Referenced by dataTypeId().

## isArray_p

Bool casacore::BaseColumnDesc::isArray_p

protected

Definition at line 260 of file BaseColDesc.h.

Referenced by isArray().

## isScalar_p

Bool casacore::BaseColumnDesc::isScalar_p

protected

Definition at line 259 of file BaseColDesc.h.

Referenced by isScalar().

## isTable_p

Bool casacore::BaseColumnDesc::isTable_p

protected

Definition at line 261 of file BaseColDesc.h.

Referenced by isTable().

## keySetPtr_p

TableRecord* casacore::BaseColumnDesc::keySetPtr_p

protected

Definition at line 258 of file BaseColDesc.h.

Referenced by keywordSet(), and rwKeywordSet().

## maxLength_p

uInt casacore::BaseColumnDesc::maxLength_p

protected

Definition at line 257 of file BaseColDesc.h.

Referenced by maxLength().

## nrdim_p

Int casacore::BaseColumnDesc::nrdim_p

protected

Definition at line 255 of file BaseColDesc.h.

Referenced by ndim().

## option_p

Int casacore::BaseColumnDesc::option_p

protected

Definition at line 254 of file BaseColDesc.h.

Referenced by options().

## shape_p

IPosition casacore::BaseColumnDesc::shape_p

protected

Definition at line 256 of file BaseColDesc.h.

Referenced by shape().

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

- tables/Tables/BaseColDesc.h