casa
$Rev:20696$
|
Description of columns containing tables. 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. | |
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. | |
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 |
Description of columns containing tables.
Public interface
SubTableDesc holds a description of a subtable contained in the columns of the parent table.
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:
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.
// 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));
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.
Definition at line 144 of file SubTabDesc.h.
casa::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.
casa::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.
casa::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.
casa::SubTableDesc::SubTableDesc | ( | const SubTableDesc & | ) |
Copy constructor (copy semantics).
String casa::SubTableDesc::className | ( | ) | const [virtual] |
Get the name of this class.
Implements casa::BaseColumnDesc.
BaseColumnDesc* casa::SubTableDesc::clone | ( | ) | const [virtual] |
Clone this column description to another.
Implements casa::BaseColumnDesc.
virtual void casa::SubTableDesc::getDesc | ( | AipsIO & | ) | [protected, virtual] |
Get the object.
Implements casa::BaseColumnDesc.
void casa::SubTableDesc::handleAdd | ( | ColumnDescSet & | ) | [private, virtual] |
Handle the addition of the subtable description (clear the flag).
Reimplemented from casa::BaseColumnDesc.
PlainColumn* casa::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 casa::BaseColumnDesc.
static BaseColumnDesc* casa::SubTableDesc::makeDesc | ( | const String & | name | ) | [static] |
Create the object from AipsIO (this function is registered).
SubTableDesc& casa::SubTableDesc::operator= | ( | const SubTableDesc & | ) |
Assignment (copy semantics).
virtual void casa::SubTableDesc::putDesc | ( | AipsIO & | ) | const [protected, virtual] |
Put the object.
Implements casa::BaseColumnDesc.
Bool casa::SubTableDesc::readTableDesc | ( | ) | [private] |
Read table description (if passed by name).
If the table description is not found, a False value is returned.
void casa::SubTableDesc::show | ( | ostream & | os | ) | const [virtual] |
Show the column.
Implements casa::BaseColumnDesc.
TableDesc* casa::SubTableDesc::tableDesc | ( | ) | [virtual] |
friend class ColumnDesc [friend] |
Reimplemented from casa::BaseColumnDesc.
Definition at line 147 of file SubTabDesc.h.
Bool casa::SubTableDesc::allocSelf_p [private] |
Definition at line 211 of file SubTabDesc.h.
Bool casa::SubTableDesc::byName_p [private] |
Definition at line 210 of file SubTabDesc.h.
Bool casa::SubTableDesc::shallowCopy_p [private] |
Definition at line 212 of file SubTabDesc.h.
TableDesc* casa::SubTableDesc::tabDescPtr_p [private] |
Definition at line 208 of file SubTabDesc.h.
String casa::SubTableDesc::tabDescTyp_p [private] |
Definition at line 209 of file SubTabDesc.h.