Loading...
Searching...
No Matches
casacore::SubTableDesc Class Reference
tables package (libcasa_tables) » Tables_module

More...

`#include <SubTabDesc.h>`

## Public Member Functions

| SubTableDesc (const String &columnName, const String &comment, const String &tableDescName, int options=0)
| Construct from a table description with the given name.
| SubTableDesc (const String &columnName, const String &comment, const TableDesc &, int options=0)
| Construct from the given table description, which will be copied and frozen.
| SubTableDesc (const String &columnName, const String &comment, TableDesc *, int options=0)
| Construct from the given table description, which will be used directly.
| SubTableDesc (const SubTableDesc &)
| Copy constructor (copy semantics).
| ~SubTableDesc ()
SubTableDesc & | operator= (const SubTableDesc &)
| Assignment (copy semantics).
BaseColumnDesc * | clone () const
| Clone this column description to another.
TableDesc * | tableDesc ()
| Get the table description.
String | className () const
| Get the name of this class.
PlainColumn * | makeColumn (ColumnSet *) const
| Create a Column column object out of this.
void | show (ostream &os) const
| Show the column.
Public Member Functions inherited from 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.
| BaseColumnDesc (const BaseColumnDesc &)
| Copy constructor (copy semantics).
virtual | ~BaseColumnDesc ()
TableRecord & | rwKeywordSet ()
| Get access to the set of keywords.
const TableRecord & | keywordSet () const
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).
void | setName (const String &name)
| Set the name of the column (for a rename).

## Static Public Member Functions

static BaseColumnDesc * | makeDesc (const String &name)
| Create the object from AipsIO (this function is registered).

## Protected Member Functions

virtual void | putDesc (AipsIO &) const
| Put the object.
virtual void | getDesc (AipsIO &)
| Get the object.
Protected Member Functions inherited from casacore::BaseColumnDesc
BaseColumnDesc & | operator= (const BaseColumnDesc &)
| Assignment (copy semantics).
void | putFile (AipsIO &, const TableAttr &) const
| Put the object.
void | getFile (AipsIO &, const TableAttr &)
| Get the object.
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.

## Private Member Functions

Bool | readTableDesc ()
| Read table description (if passed by name).
void | handleAdd (ColumnDescSet &)
| Handle the addition of the subtable description (clear the flag).

## Private Attributes

TableDesc * | tabDescPtr_p
String | tabDescTyp_p
Bool | byName_p
Bool | allocSelf_p
Bool | shallowCopy_p

## Friends

class | ColumnDesc

## Additional Inherited Members

Protected Attributes inherited from casacore::BaseColumnDesc
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

## Detailed Description

Description of columns containing tables

### Intended use:

Public interface

### Review Status

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

### Prerequisite

- TableDesc
- BaseColumnDesc

### Etymology

SubTableDesc holds a description of a subtable contained in the columns of the parent table.

### Synopsis

SubTableDesc describes a table column containing subtables. The semantics of subtables are described below. The column description is constructed using a table description describing the subtable. This subtable decription or its name is stored with the column description. When a table containing this column gets created, the subtable description gets copied and this copy is thereafter frozen.

Constructing a column description for a subtable can be done in 3 ways:

- It can be constructed with the name of a table description kept in a file. Only this name will be stored with the column description. Only when the table column gets created, it will read the newest version of this table description. This is a completely dynamic way of defining the column. When the subtable description in the file changes, this column in newly created tables gets the latest version.
- It can be constructed with a given table description. This means that a copy of that description will be made. The frozen subtable description will be stored with the column description. This is a completely static way of defining the column.
- It can be constructed with a pointer to a table description. This means that a copy will only be made when the column description gets written. Thus changes to the subtable description will as long as possible be reflected in the column description. This is a mix of the first two ways.

A column can be direct or indirect. Direct columns will be written directly in the table file. All cells in the column must have the same description and it is therefore not possible to change a description. The subtables in indirect columns will be stored in separate files. The cells in indirect columns can contain different tables.

### Example

// First build the new description of a subtable.
// Define keyword subkey (integer) having value 10.
// Define columns ra and dec (double).
TableDesc subTableDesc("tTableDesc_sub", "1", TableDesc::New);
subTableDesc.keywordSet().keysInt()("subkey") = 10;
subTableDesc.addColumn (TpDouble, "ra");
subTableDesc.addColumn (TpDouble, "dec");
// Now create a new table description
TableDesc td("tTableDesc", "1", TableDesc::New);
// Add columns containing subtables.
// This is done in 3 slighty different ways, which all have
// their own (dis)advantages.
// This is described in detail at the SubTableDesc constructors.
td.addColumn (SubTableDesc("sub1", "subtable by name","tTableDesc_sub"));
td.addColumn (SubTableDesc("sub2", "subtable copy", subTableDesc));
td.addColumn (SubTableDesc("sub3", "subtable pointer", &subTableDesc));
casacore::SubTableDesc::SubTableDesc
SubTableDesc(const String &columnName, const String &comment, const String &tableDescName, int options=0)
Construct from a table description with the given name.
casacore::TableDesc
Definition TableDesc.h:189
casacore::TableDesc::New
@ New
Definition TableDesc.h:193

### Motivation

Several column description classes are needed to allow the user to define attributes which are special for each column type. For columns containing a table this is the table description.

### To Do

- Probably only direct table descriptions should be allowed. Indirect arrays can have a shape in the description (although they can have #dim), so tables should behave similarly.

Definition at line 141 of file SubTabDesc.h.

## Constructor & Destructor Documentation

## SubTableDesc() [1/4]

casacore::SubTableDesc::SubTableDesc | ( | const String & | columnName,
|  | const String & | comment,
|  | const String & | tableDescName,
|  | int | options = 0 )

Construct from a table description with the given name.

The description does not need to exist yet. Only when the table gets created, the description will be read and must exist. This means that the table description is not frozen; the most recent description will be used when creating the column.

References casacore::BaseColumnDesc::comment(), and casacore::BaseColumnDesc::options().

Referenced by operator=(), and SubTableDesc().

## SubTableDesc() [2/4]

casacore::SubTableDesc::SubTableDesc | ( | const String & | columnName,
|  | const String & | comment,
|  | const TableDesc & | ,
|  | int | options = 0 )

Construct from the given table description, which will be copied and frozen.

References casacore::BaseColumnDesc::comment(), and casacore::BaseColumnDesc::options().

## SubTableDesc() [3/4]

casacore::SubTableDesc::SubTableDesc | ( | const String & | columnName,
|  | const String & | comment,
|  | TableDesc * | ,
|  | int | options = 0 )

Construct from the given table description, which will be used directly.

The description gets frozen when the column is written. Care should be taken, because the given table description must not be deleted before the column description gets destructed.

References casacore::BaseColumnDesc::comment(), and casacore::BaseColumnDesc::options().

## SubTableDesc() [4/4]

casacore::SubTableDesc::SubTableDesc | ( | const SubTableDesc & |  | ) |

Copy constructor (copy semantics).

References SubTableDesc().

## ~SubTableDesc()

casacore::SubTableDesc::~SubTableDesc | ( |  | ) |

## Member Function Documentation

## className()

String casacore::SubTableDesc::className | ( |  | ) | const

virtual

Get the name of this class.

Implements casacore::BaseColumnDesc.

## clone()

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

virtual

Clone this column description to another.

Implements casacore::BaseColumnDesc.

References casacore::BaseColumnDesc::BaseColumnDesc().

## getDesc()

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

protected virtual

Get the object.

Implements casacore::BaseColumnDesc.

## handleAdd()

void casacore::SubTableDesc::handleAdd | ( | ColumnDescSet & |  | ) |

private virtual

Handle the addition of the subtable description (clear the flag).

Reimplemented from casacore::BaseColumnDesc.

## makeColumn()

PlainColumn * casacore::SubTableDesc::makeColumn | ( | ColumnSet * |  | ) | const

virtual

Create a Column column object out of this.

This is used by class ColumnSet to construct a table column object.

Implements casacore::BaseColumnDesc.

## makeDesc()

BaseColumnDesc * casacore::SubTableDesc::makeDesc | ( | const String & | name | ) |

static

Create the object from AipsIO (this function is registered).

References casacore::BaseColumnDesc::BaseColumnDesc(), and casacore::BaseColumnDesc::name().

## operator=()

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

Assignment (copy semantics).

References SubTableDesc().

## putDesc()

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

protected virtual

Put the object.

Implements casacore::BaseColumnDesc.

## readTableDesc()

Bool casacore::SubTableDesc::readTableDesc | ( |  | ) |

private

Read table description (if passed by name).

If the table description is not found, a False value is returned.

## show()

void casacore::SubTableDesc::show | ( | ostream & | os | ) | const

virtual

Show the column.

Implements casacore::BaseColumnDesc.

## tableDesc()

TableDesc * casacore::SubTableDesc::tableDesc | ( |  | ) |

virtual

Get the table description.

### Thrown Exceptions

- TableNoFile

Reimplemented from casacore::BaseColumnDesc.

## Friends And Related Symbol Documentation

## ColumnDesc

friend class ColumnDesc

friend

Definition at line 144 of file SubTabDesc.h.

References ColumnDesc.

Referenced by ColumnDesc.

## Member Data Documentation

## allocSelf_p

Bool casacore::SubTableDesc::allocSelf_p

private

Definition at line 208 of file SubTabDesc.h.

## byName_p

Bool casacore::SubTableDesc::byName_p

private

Definition at line 207 of file SubTabDesc.h.

## shallowCopy_p

Bool casacore::SubTableDesc::shallowCopy_p

private

Definition at line 209 of file SubTabDesc.h.

## tabDescPtr_p

TableDesc* casacore::SubTableDesc::tabDescPtr_p

private

Definition at line 205 of file SubTabDesc.h.

## tabDescTyp_p

String casacore::SubTableDesc::tabDescTyp_p

private

Definition at line 206 of file SubTabDesc.h.

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

- tables/Tables/SubTabDesc.h