casa::BaseColumnDesc Class Reference
[Tables_internal_classes]

#include <BaseColDesc.h>

Inheritance diagram for casa::BaseColumnDesc:

Inheritance graph
[legend]
Collaboration diagram for casa::BaseColumnDesc:

Collaboration graph
[legend]
List of all members.

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

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.

To Do

Definition at line 105 of file 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 ()
virtual void show (ostream &os) const =0
 Show the column.
const Stringname () const
 Get the name of the column.
DataType dataType () const
 Get the data type of the column.
const StringdataTypeId () const
 Get the type id for non-standard data types (i.e.
const StringdataManagerType () const
 Get the type name of the default data manager.
StringdataManagerType ()
 Get the type name of the default data manager.
const StringdataManagerGroup () const
 Get the data manager group.
StringdataManagerGroup ()
 Get the data manager group.
void setDefaultDataManager (Bool always)
 Set the data manager type and group to the default.
const Stringcomment () const
 Get comment string.
Stringcomment ()
 Get comment string (allowing it to be changed).
int options () const
 Get the options.
Int ndim () const
 Get the number of dimensions.
const IPositionshape () const
 Get the predefined shape.
void setNdim (uInt ndim)
 Set the number of dimensions.
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.
virtual BaseColumnDescclone () 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).
TableRecordrwKeywordSet ()
 Get access to the set of keywords.
const TableRecordkeywordSet () const
Bool isScalar () const
 Test if column is scalar, array or table.
Bool isArray () const
Bool isTable () const
void setShape (const IPosition &shape)
 Set the predefined shape.
void setShape (const IPosition &shape, Bool directOption)
const TableDesctableDesc () const
 Get table description (in case column contains subtables).
virtual TableDesctableDesc ()

Protected Member Functions

BaseColumnDescoperator= (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 PlainColumnmakeColumn (ColumnSet *) const =0
 Make a PlainColumn object out of the description.
RefColumnmakeRefColumn (RefTable *, BaseColumn *) const
 Make a RefColumn 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
TableRecordkeySetPtr_p
Bool isScalar_p
Bool isArray_p
Bool isTable_p

Private Member Functions

virtual void renameAction (const String &newName, const String &oldName)
 This function allows each column to act upon a rename of another column.
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)

Friends

class ColumnDesc


Constructor & Destructor Documentation

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

Thrown Exceptions

casa::BaseColumnDesc::BaseColumnDesc ( const BaseColumnDesc  ) 

Copy constructor (copy semantics).

virtual casa::BaseColumnDesc::~BaseColumnDesc (  )  [virtual]


Member Function Documentation

TableRecord& casa::BaseColumnDesc::rwKeywordSet (  )  [inline]

Get access to the set of keywords.

Definition at line 129 of file BaseColDesc.h.

References keySetPtr_p.

Referenced by casa::ColumnDesc::rwKeywordSet().

const TableRecord& casa::BaseColumnDesc::keywordSet (  )  const [inline]

Definition at line 131 of file BaseColDesc.h.

References keySetPtr_p.

Referenced by casa::ColumnDesc::keywordSet().

virtual void casa::BaseColumnDesc::show ( ostream &  os  )  const [pure virtual]

Show the column.

const String& casa::BaseColumnDesc::name (  )  const [inline]

Get the name of the column.

Definition at line 139 of file BaseColDesc.h.

References colName_p.

Referenced by setName().

DataType casa::BaseColumnDesc::dataType (  )  const [inline]

Get the data type of the column.

Definition at line 143 of file BaseColDesc.h.

References dtype_p.

Referenced by casa::ColumnDesc::dataType().

const String& casa::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 148 of file BaseColDesc.h.

References dtypeId_p.

Referenced by casa::ColumnDesc::dataTypeId().

const String& casa::BaseColumnDesc::dataManagerType (  )  const [inline]

Get the type name of the default data manager.

Definition at line 152 of file BaseColDesc.h.

References dataManType_p.

Referenced by casa::ColumnDesc::dataManagerType().

String& casa::BaseColumnDesc::dataManagerType (  )  [inline]

Get the type name of the default data manager.

(allowing it to be changed)

Definition at line 157 of file BaseColDesc.h.

References dataManType_p.

const String& casa::BaseColumnDesc::dataManagerGroup (  )  const [inline]

Get the data manager group.

Definition at line 161 of file BaseColDesc.h.

References dataManGroup_p.

Referenced by casa::ColumnDesc::dataManagerGroup().

String& casa::BaseColumnDesc::dataManagerGroup (  )  [inline]

Get the data manager group.

(allowing it to be changed)

Definition at line 166 of file BaseColDesc.h.

References dataManGroup_p.

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

Referenced by casa::ColumnDesc::setDefaultDataManager().

const String& casa::BaseColumnDesc::comment (  )  const [inline]

Get comment string.

Definition at line 174 of file BaseColDesc.h.

References comment_p.

Referenced by casa::ColumnDesc::comment().

String& casa::BaseColumnDesc::comment (  )  [inline]

Get comment string (allowing it to be changed).

Definition at line 178 of file BaseColDesc.h.

References comment_p.

int casa::BaseColumnDesc::options (  )  const [inline]

Get the options.

Definition at line 182 of file BaseColDesc.h.

References option_p.

Referenced by casa::ColumnDesc::options().

Bool casa::BaseColumnDesc::isScalar (  )  const [inline]

Test if column is scalar, array or table.

Definition at line 187 of file BaseColDesc.h.

References isScalar_p.

Referenced by casa::ColumnDesc::isScalar().

Bool casa::BaseColumnDesc::isArray (  )  const [inline]

Definition at line 189 of file BaseColDesc.h.

References isArray_p.

Referenced by casa::ColumnDesc::isArray().

Bool casa::BaseColumnDesc::isTable (  )  const [inline]

Definition at line 191 of file BaseColDesc.h.

References isTable_p.

Referenced by casa::ColumnDesc::isTable().

Int casa::BaseColumnDesc::ndim (  )  const [inline]

Get the number of dimensions.

Definition at line 196 of file BaseColDesc.h.

References nrdim_p.

Referenced by casa::ColumnDesc::ndim().

const IPosition& casa::BaseColumnDesc::shape (  )  const [inline]

Get the predefined shape.

If not defined, a zero shape will be returned.

Definition at line 201 of file BaseColDesc.h.

References shape_p.

Referenced by casa::ColumnDesc::shape().

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

Referenced by casa::ColumnDesc::setNdim().

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

Referenced by casa::ColumnDesc::setShape().

void casa::BaseColumnDesc::setShape ( const IPosition shape,
Bool  directOption 
)

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

Referenced by casa::ColumnDesc::setOptions().

uInt casa::BaseColumnDesc::maxLength (  )  const [inline]

Get the maximum value length.

Definition at line 231 of file BaseColDesc.h.

References maxLength_p.

Referenced by casa::ColumnDesc::maxLength().

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

Referenced by casa::ColumnDesc::setMaxLength().

const TableDesc* casa::BaseColumnDesc::tableDesc (  )  const [inline]

Get table description (in case column contains subtables).

Definition at line 245 of file BaseColDesc.h.

Referenced by casa::ColumnDesc::tableDesc().

virtual TableDesc* casa::BaseColumnDesc::tableDesc (  )  [virtual]

BaseColumnDesc& casa::BaseColumnDesc::operator= ( const BaseColumnDesc  )  [protected]

Assignment (copy semantics).

void casa::BaseColumnDesc::putFile ( AipsIO ,
const TableAttr  
) const [protected]

Put the object.

It uses putDesc to put the derived object.

void casa::BaseColumnDesc::getFile ( AipsIO ,
const TableAttr  
) [protected]

Get the object.

It uses getDesc to get the derived object.

virtual void casa::BaseColumnDesc::putDesc ( AipsIO  )  const [protected, pure virtual]

Put the derived object.

virtual void casa::BaseColumnDesc::getDesc ( AipsIO  )  [protected, pure virtual]

Get the derived object.

virtual PlainColumn* casa::BaseColumnDesc::makeColumn ( ColumnSet  )  const [protected, pure virtual]

Make a PlainColumn object out of the description.

Referenced by casa::ColumnDesc::makeColumn().

RefColumn* casa::BaseColumnDesc::makeRefColumn ( RefTable ,
BaseColumn  
) const [protected]

Make a RefColumn object out of the description.

Referenced by casa::ColumnDesc::makeRefColumn().

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

Referenced by casa::ColumnDesc::checkAdd().

virtual void casa::BaseColumnDesc::checkRename ( const ColumnDescSet cds,
const String newName 
) const [private, virtual]

Referenced by casa::ColumnDesc::checkRename().

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

Referenced by casa::ColumnDesc::handleAdd().

virtual void casa::BaseColumnDesc::handleRename ( ColumnDescSet cds,
const String oldName 
) [private, virtual]

Referenced by casa::ColumnDesc::handleRename().

virtual void casa::BaseColumnDesc::handleRemove ( ColumnDescSet cds  )  [private, virtual]

Referenced by casa::ColumnDesc::handleRemove().

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

Referenced by casa::ColumnDesc::renameAction().

virtual BaseColumnDesc* casa::BaseColumnDesc::clone (  )  const [pure virtual]

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

virtual String casa::BaseColumnDesc::className (  )  const [pure virtual]

Get the underlying class name.

void casa::BaseColumnDesc::setName ( const String name  )  [inline]

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

Definition at line 320 of file BaseColDesc.h.

References colName_p, and name().

Referenced by casa::ColumnDesc::setName().


Friends And Related Function Documentation

friend class ColumnDesc [friend]

Definition at line 108 of file BaseColDesc.h.


Member Data Documentation

String casa::BaseColumnDesc::colName_p [protected]

Definition at line 251 of file BaseColDesc.h.

Referenced by name(), and setName().

String casa::BaseColumnDesc::comment_p [protected]

Definition at line 252 of file BaseColDesc.h.

Referenced by comment().

String casa::BaseColumnDesc::dataManType_p [protected]

Definition at line 253 of file BaseColDesc.h.

Referenced by dataManagerType().

String casa::BaseColumnDesc::dataManGroup_p [protected]

Definition at line 254 of file BaseColDesc.h.

Referenced by dataManagerGroup().

DataType casa::BaseColumnDesc::dtype_p [protected]

Definition at line 255 of file BaseColDesc.h.

Referenced by dataType().

String casa::BaseColumnDesc::dtypeId_p [protected]

Definition at line 256 of file BaseColDesc.h.

Referenced by dataTypeId().

int casa::BaseColumnDesc::option_p [protected]

Definition at line 257 of file BaseColDesc.h.

Referenced by options().

Int casa::BaseColumnDesc::nrdim_p [protected]

Definition at line 258 of file BaseColDesc.h.

Referenced by ndim().

IPosition casa::BaseColumnDesc::shape_p [protected]

Definition at line 259 of file BaseColDesc.h.

Referenced by shape().

uInt casa::BaseColumnDesc::maxLength_p [protected]

Definition at line 260 of file BaseColDesc.h.

Referenced by maxLength().

TableRecord* casa::BaseColumnDesc::keySetPtr_p [protected]

Definition at line 261 of file BaseColDesc.h.

Referenced by keywordSet(), and rwKeywordSet().

Bool casa::BaseColumnDesc::isScalar_p [protected]

Definition at line 262 of file BaseColDesc.h.

Referenced by isScalar().

Bool casa::BaseColumnDesc::isArray_p [protected]

Definition at line 263 of file BaseColDesc.h.

Referenced by isArray().

Bool casa::BaseColumnDesc::isTable_p [protected]

Definition at line 264 of file BaseColDesc.h.

Referenced by isTable().


The documentation for this class was generated from the following file:
Generated on Mon Sep 1 22:45:16 2008 for NRAOCASA by  doxygen 1.5.1