ColDescSet.h

Classes

ColumnDescSet -- Set of table column descriptions (full description)

class ColumnDescSet

Interface

Public Members
ColumnDescSet()
ColumnDescSet (const ColumnDescSet&)
~ColumnDescSet()
ColumnDescSet& operator= (const ColumnDescSet&)
ColumnDesc& operator[] (const String& name)
const ColumnDesc& operator[] (const String& name) const
ColumnDesc& operator[] (uInt index)
const ColumnDesc& operator[] (uInt index) const
uInt ncolumn() const
Bool isDefined (const String& name) const
Bool isEqual (const ColumnDescSet& other, Bool& equalDataTypes) const
Bool isSubset (const ColumnDescSet& other, Bool& equalDataTypes) const
Bool isStrictSubset (const ColumnDescSet& other, Bool& equalDataTypes) const
Bool isSuperset (const ColumnDescSet& other, Bool& equalDataTypes) const
Bool isStrictSuperset (const ColumnDescSet& other, Bool& equalDataTypes) const
Bool isDisjoint (const ColumnDescSet& other) const
void show (ostream& os) const
void checkSubTableDesc() const
Private Members
ColumnDesc& addColumn (const ColumnDesc&)
ColumnDesc& addColumn (const ColumnDesc&, const String& newname)
void remove (const String& name)
void rename (const String& newname, const String& oldname)
Bool allExist (const ColumnDescSet&, Bool& equalDataTypes) const
void add (const ColumnDescSet& set)
void putFile (AipsIO& ios, const TableAttr&) const
void getFile (AipsIO&, const TableAttr&)

Description

Review Status

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

Prerequisite

Etymology

ColumnDescSet is the set of column descriptions in a table description.

Synopsis

ColumnDescSet is used by TableDesc to store all column descriptions.

In principle this class is only used internally by the table system. However, there is a function in TableDesc which gives const access to this class. This can be used by the user to call functions like isDisjoint.

Member Description

ColumnDescSet()

Construct an empty column set.

ColumnDescSet (const ColumnDescSet&)

Copy constructor (copy semantics).

~ColumnDescSet()

ColumnDescSet& operator= (const ColumnDescSet&)

Assignment (copy semantics).

ColumnDesc& operator[] (const String& name)
const ColumnDesc& operator[] (const String& name) const

Get a column by its name.

ColumnDesc& operator[] (uInt index)
const ColumnDesc& operator[] (uInt index) const

Get a column by its index.

uInt ncolumn() const

Get nr of columns in this set.

Bool isDefined (const String& name) const

Test if a column is defined in this set.

Bool isEqual (const ColumnDescSet& other, Bool& equalDataTypes) const

Test if this set equals another one. It is equal if the number of columns is equal and all field names in this set occur in the other too. The order of the columns is not important.
The flag equalDataTypes is set to True if the data types of all columns match.

Bool isSubset (const ColumnDescSet& other, Bool& equalDataTypes) const

Test if this set is a subset of another one. It is similar to isEqual above.

Bool isStrictSubset (const ColumnDescSet& other, Bool& equalDataTypes) const

Test if this set is a strict subset of another one, thus if it is a subset and not equal.

Bool isSuperset (const ColumnDescSet& other, Bool& equalDataTypes) const

Test if this set is a superset of another one.

Bool isStrictSuperset (const ColumnDescSet& other, Bool& equalDataTypes) const

Test if this set is a strict superset of another one, thus if it is a superset and not equal.

Bool isDisjoint (const ColumnDescSet& other) const

Test if this and the other column set are disjoint.

void show (ostream& os) const

Get const access to the column descriptions.

Show the columns in the set.

void checkSubTableDesc() const

Check recursevily if the descriptions of all subtables are known.

ColumnDesc& addColumn (const ColumnDesc&)

Add a column. An exception is thrown if a column with this name already exists.

ColumnDesc& addColumn (const ColumnDesc&, const String& newname)

Add a column with another name. An exception is thrown if a column with this name already exists.

void remove (const String& name)

Remove a column. An exception is thrown if the column with this name does not exist.

void rename (const String& newname, const String& oldname)

Rename a column in the set. An exception is thrown if the new name already exists or if the old name does not exist.

Bool allExist (const ColumnDescSet&, Bool& equalDataTypes) const

Test if all columns are part of the other set. The flag equalDataTypes is set to True if the data types of the columns in both sets are the same.

void add (const ColumnDescSet& set)

Add another (disjoint) column set. If the sets are not disjoint (i.e. the other set contains a column with an already existing name, an exception is thrown and nothing of the other set is added.

void putFile (AipsIO& ios, const TableAttr&) const

Put the object.

void getFile (AipsIO&, const TableAttr&)

Get the object