casacore
|
An abstract base class for table column descriptions. 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. More... | |
BaseColumnDesc (const BaseColumnDesc &) | |
Copy constructor (copy semantics). More... | |
virtual | ~BaseColumnDesc () |
TableRecord & | rwKeywordSet () |
Get access to the set of keywords. More... | |
const TableRecord & | keywordSet () const |
virtual void | show (ostream &os) const =0 |
Show the column. More... | |
const String & | name () const |
Get the name of the column. More... | |
DataType | dataType () const |
Get the data type of the column. More... | |
const String & | dataTypeId () const |
Get the type id for non-standard data types (i.e. More... | |
const String & | dataManagerType () const |
Get the type name of the default data manager. More... | |
String & | dataManagerType () |
Get the type name of the default data manager. More... | |
const String & | dataManagerGroup () const |
Get the data manager group. More... | |
String & | dataManagerGroup () |
Get the data manager group. More... | |
void | setDefaultDataManager (Bool always) |
Set the data manager type and group to the default. More... | |
const String & | comment () const |
Get comment string. More... | |
String & | comment () |
Get comment string (allowing it to be changed). More... | |
Int | options () const |
Get the options. More... | |
Bool | isScalar () const |
Test if column is scalar, array or table. More... | |
Bool | isArray () const |
Bool | isTable () const |
Int | ndim () const |
Get the number of dimensions. More... | |
const IPosition & | shape () const |
Get the predefined shape. More... | |
void | setNdim (uInt ndim) |
Set the number of dimensions. More... | |
void | setShape (const IPosition &shape) |
Set the predefined shape. More... | |
void | setShape (const IPosition &shape, Bool directOption) |
void | setOptions (Int options) |
Set the options to the given value. More... | |
uInt | maxLength () const |
Get the maximum value length. More... | |
void | setMaxLength (uInt maxLength) |
Set the maximum value length. More... | |
const TableDesc * | tableDesc () const |
Get table description (in case column contains subtables). More... | |
virtual TableDesc * | tableDesc () |
virtual BaseColumnDesc * | clone () const =0 |
Clone a column description (creating a new column description object). More... | |
virtual String | className () const =0 |
Get the underlying class name. More... | |
void | setName (const String &name) |
Set the name of the column (for a rename). More... | |
Protected Member Functions | |
BaseColumnDesc & | operator= (const BaseColumnDesc &) |
Assignment (copy semantics). More... | |
void | putFile (AipsIO &, const TableAttr &) const |
Put the object. More... | |
void | getFile (AipsIO &, const TableAttr &) |
Get the object. More... | |
virtual void | putDesc (AipsIO &) const =0 |
Put the derived object. More... | |
virtual void | getDesc (AipsIO &)=0 |
Get the derived object. More... | |
virtual PlainColumn * | makeColumn (ColumnSet *) const =0 |
Make a PlainColumn object out of the description. More... | |
RefColumn * | makeRefColumn (RefTable *, BaseColumn *) const |
Make a RefColumn object out of the description. More... | |
virtual ConcatColumn * | makeConcatColumn (ConcatTable *) const |
Make a ConcatColumn object out of the description. More... | |
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. More... | |
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. More... | |
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. More... | |
Friends | |
class | ColumnDesc |
An abstract base class for table column descriptions.
Internal
"Base" indicates that this is a base class for the specialized column description classes.
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.
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 107 of file BaseColDesc.h.
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.
casacore::BaseColumnDesc::BaseColumnDesc | ( | const BaseColumnDesc & | ) |
Copy constructor (copy semantics).
|
virtual |
|
privatevirtual |
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 casacore::ColumnDesc::checkAdd().
|
privatevirtual |
Referenced by casacore::ColumnDesc::checkRename().
|
pure virtual |
Get the underlying class name.
Implemented in casacore::ScalarColumnDesc< T >, casacore::SubTableDesc, casacore::ScalarRecordColumnDesc, and casacore::ArrayColumnDescBase.
|
pure virtual |
Clone a column description (creating a new column description object).
Implemented in casacore::ArrayColumnDesc< T >, casacore::ScalarColumnDesc< T >, casacore::SubTableDesc, and casacore::ScalarRecordColumnDesc.
|
inline |
Get comment string.
Definition at line 173 of file BaseColDesc.h.
References comment_p.
Referenced by casacore::ColumnDesc::comment().
|
inline |
Get comment string (allowing it to be changed).
Definition at line 177 of file BaseColDesc.h.
References comment_p.
|
inline |
Get the data manager group.
Definition at line 160 of file BaseColDesc.h.
References dataManGroup_p.
Referenced by casacore::ColumnDesc::dataManagerGroup().
|
inline |
Get the data manager group.
(allowing it to be changed)
Definition at line 165 of file BaseColDesc.h.
References dataManGroup_p.
|
inline |
Get the type name of the default data manager.
Definition at line 151 of file BaseColDesc.h.
References dataManType_p.
Referenced by casacore::ColumnDesc::dataManagerType().
|
inline |
Get the type name of the default data manager.
(allowing it to be changed)
Definition at line 156 of file BaseColDesc.h.
References dataManType_p.
|
inline |
Get the data type of the column.
Definition at line 142 of file BaseColDesc.h.
References dtype_p.
Referenced by casacore::ColumnDesc::dataType().
|
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 147 of file BaseColDesc.h.
References dtypeId_p.
Referenced by casacore::ColumnDesc::dataTypeId().
|
protectedpure virtual |
Get the derived object.
Implemented in casacore::ScalarColumnDesc< T >, casacore::SubTableDesc, casacore::ScalarRecordColumnDesc, and casacore::ArrayColumnDescBase.
Get the object.
It uses getDesc to get the derived object.
|
privatevirtual |
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.
Referenced by casacore::ColumnDesc::handleAdd().
|
privatevirtual |
Referenced by casacore::ColumnDesc::handleRemove().
|
privatevirtual |
Referenced by casacore::ColumnDesc::handleRename().
|
inline |
Definition at line 188 of file BaseColDesc.h.
References isArray_p.
Referenced by casacore::ColumnDesc::isArray().
|
inline |
Test if column is scalar, array or table.
Definition at line 186 of file BaseColDesc.h.
References isScalar_p.
Referenced by casacore::ColumnDesc::isScalar().
|
inline |
Definition at line 190 of file BaseColDesc.h.
References isTable_p.
Referenced by casacore::ColumnDesc::isTable().
|
inline |
Definition at line 130 of file BaseColDesc.h.
References keySetPtr_p.
Referenced by casacore::ColumnDesc::keywordSet().
|
protectedpure virtual |
Make a PlainColumn object out of the description.
Implemented in casacore::ScalarColumnDesc< T >, casacore::SubTableDesc, casacore::ScalarRecordColumnDesc, and casacore::ArrayColumnDescBase.
Referenced by casacore::ColumnDesc::makeColumn().
|
protectedvirtual |
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 >.
Referenced by casacore::ColumnDesc::makeConcatColumn().
|
protected |
Make a RefColumn object out of the description.
Referenced by casacore::ColumnDesc::makeRefColumn().
|
inline |
Get the maximum value length.
Definition at line 230 of file BaseColDesc.h.
References maxLength_p.
Referenced by casacore::ColumnDesc::maxLength().
|
inline |
Get the name of the column.
Definition at line 138 of file BaseColDesc.h.
References colName_p.
Referenced by setName().
|
inline |
Get the number of dimensions.
Definition at line 195 of file BaseColDesc.h.
References nrdim_p.
Referenced by casacore::ColumnDesc::ndim().
|
protected |
Assignment (copy semantics).
|
inline |
Get the options.
Definition at line 181 of file BaseColDesc.h.
References option_p.
Referenced by casacore::ColumnDesc::options().
|
protectedpure virtual |
Put the derived object.
Implemented in casacore::ScalarColumnDesc< T >, casacore::SubTableDesc, casacore::ScalarRecordColumnDesc, and casacore::ArrayColumnDescBase.
Put the object.
It uses putDesc to put the derived object.
|
privatevirtual |
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 casacore::ColumnDesc::renameAction().
|
inline |
Get access to the set of keywords.
Definition at line 128 of file BaseColDesc.h.
References keySetPtr_p.
Referenced by casacore::ColumnDesc::rwKeywordSet().
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.
Referenced by casacore::ColumnDesc::setDefaultDataManager().
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.
Referenced by casacore::ColumnDesc::setMaxLength().
|
inline |
Set the name of the column (for a rename).
Definition at line 324 of file BaseColDesc.h.
References colName_p, and name().
Referenced by casacore::ColumnDesc::setName().
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.
Referenced by casacore::ColumnDesc::setNdim().
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.
Referenced by casacore::ColumnDesc::setOptions().
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.
Referenced by casacore::ColumnDesc::setShape().
|
inline |
Get the predefined shape.
If not defined, a zero shape will be returned.
Definition at line 200 of file BaseColDesc.h.
References shape_p.
Referenced by casacore::ColumnDesc::shape().
|
pure virtual |
Show the column.
Implemented in casacore::ScalarColumnDesc< T >, casacore::SubTableDesc, casacore::ScalarRecordColumnDesc, and casacore::ArrayColumnDescBase.
|
inline |
Get table description (in case column contains subtables).
Definition at line 244 of file BaseColDesc.h.
Referenced by casacore::ColumnDesc::tableDesc().
|
virtual |
Reimplemented in casacore::SubTableDesc.
|
friend |
Definition at line 110 of file BaseColDesc.h.
|
protected |
Definition at line 250 of file BaseColDesc.h.
|
protected |
Definition at line 251 of file BaseColDesc.h.
Referenced by comment().
|
protected |
Definition at line 253 of file BaseColDesc.h.
Referenced by dataManagerGroup().
|
protected |
Definition at line 252 of file BaseColDesc.h.
Referenced by dataManagerType().
|
protected |
Definition at line 254 of file BaseColDesc.h.
Referenced by dataType().
|
protected |
Definition at line 255 of file BaseColDesc.h.
Referenced by dataTypeId().
|
protected |
Definition at line 262 of file BaseColDesc.h.
Referenced by isArray().
|
protected |
Definition at line 261 of file BaseColDesc.h.
Referenced by isScalar().
|
protected |
Definition at line 263 of file BaseColDesc.h.
Referenced by isTable().
|
protected |
Definition at line 260 of file BaseColDesc.h.
Referenced by keywordSet(), and rwKeywordSet().
|
protected |
Definition at line 259 of file BaseColDesc.h.
Referenced by maxLength().
|
protected |
Definition at line 257 of file BaseColDesc.h.
Referenced by ndim().
|
protected |
Definition at line 256 of file BaseColDesc.h.
Referenced by options().
|
protected |
Definition at line 258 of file BaseColDesc.h.
Referenced by shape().