casacore
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members

More...

#include <ColDescSet.h>

Public Member Functions

 ColumnDescSet ()
 Construct an empty column set. More...
 
 ColumnDescSet (const ColumnDescSet &)
 Copy constructor (copy semantics). More...
 
 ~ColumnDescSet ()
 
ColumnDescSetoperator= (const ColumnDescSet &)
 Assignment (copy semantics). More...
 
ColumnDescoperator[] (const String &name)
 Get a column by its name. More...
 
const ColumnDescoperator[] (const String &name) const
 
ColumnDescoperator[] (uInt index)
 Get a column by its index. More...
 
const ColumnDescoperator[] (uInt index) const
 
uInt ncolumn () const
 Get nr of columns in this set. More...
 
Bool isDefined (const String &name) const
 Test if a column is defined in this set. More...
 
Bool isEqual (const ColumnDescSet &other, Bool &equalDataTypes) const
 Test if this set equals another one. More...
 
Bool isSubset (const ColumnDescSet &other, Bool &equalDataTypes) const
 Test if this set is a subset of another one. More...
 
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. More...
 
Bool isSuperset (const ColumnDescSet &other, Bool &equalDataTypes) const
 Test if this set is a superset of another one. More...
 
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. More...
 
Bool isDisjoint (const ColumnDescSet &other) const
 Test if this and the other column set are disjoint. More...
 
void show (ostream &os) const
 Get const access to the column descriptions. More...
 
void checkSubTableDesc () const
 Check recursevily if the descriptions of all subtables are known. More...
 

Private Member Functions

ColumnDescaddColumn (const ColumnDesc &)
 Add a column. More...
 
ColumnDescaddColumn (const ColumnDesc &, const String &newname)
 Add a column with another name. More...
 
void remove (const String &name)
 Remove a column. More...
 
void rename (const String &newname, const String &oldname)
 Rename a column in the set. More...
 
Bool allExist (const ColumnDescSet &, Bool &equalDataTypes) const
 Test if all columns are part of the other set. More...
 
void add (const ColumnDescSet &set)
 Add another (disjoint) column set. More...
 
void putFile (AipsIO &ios, const TableAttr &) const
 Put the object. More...
 
void getFile (AipsIO &, const TableAttr &)
 Get the object. More...
 

Private Attributes

std::map< String, CountedPtr< ColumnDesc > > cols_p
 The set of all columns. More...
 
Block< void * > colSeq_p
 The order of addition of column descriptions. More...
 

Friends

class TableDesc
 

Detailed Description

Set of table column descriptions

Intended use:

Internal

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.

Definition at line 78 of file ColDescSet.h.

Constructor & Destructor Documentation

◆ ColumnDescSet() [1/2]

casacore::ColumnDescSet::ColumnDescSet ( )

Construct an empty column set.

◆ ColumnDescSet() [2/2]

casacore::ColumnDescSet::ColumnDescSet ( const ColumnDescSet )

Copy constructor (copy semantics).

◆ ~ColumnDescSet()

casacore::ColumnDescSet::~ColumnDescSet ( )

Member Function Documentation

◆ add()

void casacore::ColumnDescSet::add ( const ColumnDescSet set)
private

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.

◆ addColumn() [1/2]

ColumnDesc& casacore::ColumnDescSet::addColumn ( const ColumnDesc )
private

Add a column.

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

Referenced by casacore::TableDesc::addColumn().

◆ addColumn() [2/2]

ColumnDesc& casacore::ColumnDescSet::addColumn ( const ColumnDesc ,
const String newname 
)
private

Add a column with another name.

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

◆ allExist()

Bool casacore::ColumnDescSet::allExist ( const ColumnDescSet ,
Bool equalDataTypes 
) const
private

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.

◆ checkSubTableDesc()

void casacore::ColumnDescSet::checkSubTableDesc ( ) const

Check recursevily if the descriptions of all subtables are known.

Referenced by casacore::TableDesc::checkSubTableDesc().

◆ getFile()

void casacore::ColumnDescSet::getFile ( AipsIO ,
const TableAttr  
)
private

Get the object.

◆ isDefined()

Bool casacore::ColumnDescSet::isDefined ( const String name) const
inline

Test if a column is defined in this set.

Definition at line 114 of file ColDescSet.h.

References cols_p.

Referenced by casacore::TableDesc::isColumn().

◆ isDisjoint()

Bool casacore::ColumnDescSet::isDisjoint ( const ColumnDescSet other) const

Test if this and the other column set are disjoint.

◆ isEqual()

Bool casacore::ColumnDescSet::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.

◆ isStrictSubset()

Bool casacore::ColumnDescSet::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.

Referenced by isStrictSuperset().

◆ isStrictSuperset()

Bool casacore::ColumnDescSet::isStrictSuperset ( const ColumnDescSet other,
Bool equalDataTypes 
) const
inline

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

Definition at line 140 of file ColDescSet.h.

References isStrictSubset().

◆ isSubset()

Bool casacore::ColumnDescSet::isSubset ( const ColumnDescSet other,
Bool equalDataTypes 
) const

Test if this set is a subset of another one.

It is similar to isEqual above.

Referenced by isSuperset().

◆ isSuperset()

Bool casacore::ColumnDescSet::isSuperset ( const ColumnDescSet other,
Bool equalDataTypes 
) const
inline

Test if this set is a superset of another one.

Definition at line 135 of file ColDescSet.h.

References isSubset().

◆ ncolumn()

uInt casacore::ColumnDescSet::ncolumn ( ) const
inline

Get nr of columns in this set.

Definition at line 110 of file ColDescSet.h.

References cols_p.

Referenced by casacore::TableDesc::ncolumn().

◆ operator=()

ColumnDescSet& casacore::ColumnDescSet::operator= ( const ColumnDescSet )

Assignment (copy semantics).

◆ operator[]() [1/4]

ColumnDesc& casacore::ColumnDescSet::operator[] ( const String name)

Get a column by its name.

◆ operator[]() [2/4]

const ColumnDesc& casacore::ColumnDescSet::operator[] ( const String name) const
inline

Definition at line 97 of file ColDescSet.h.

◆ operator[]() [3/4]

ColumnDesc& casacore::ColumnDescSet::operator[] ( uInt  index)
inline

Get a column by its index.

Definition at line 103 of file ColDescSet.h.

References colSeq_p.

◆ operator[]() [4/4]

const ColumnDesc& casacore::ColumnDescSet::operator[] ( uInt  index) const
inline

Definition at line 105 of file ColDescSet.h.

References colSeq_p.

◆ putFile()

void casacore::ColumnDescSet::putFile ( AipsIO ios,
const TableAttr  
) const
private

Put the object.

◆ remove()

void casacore::ColumnDescSet::remove ( const String name)
private

Remove a column.

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

Referenced by casacore::TableDesc::removeColumn().

◆ rename()

void casacore::ColumnDescSet::rename ( const String newname,
const String oldname 
)
private

Rename a column in the set.

An exception is thrown if the new name already exists or if the old name does not exist.

◆ show()

void casacore::ColumnDescSet::show ( ostream &  os) const

Get const access to the column descriptions.

Show the columns in the set.

Friends And Related Function Documentation

◆ TableDesc

friend class TableDesc
friend

Definition at line 80 of file ColDescSet.h.

Member Data Documentation

◆ cols_p

std::map<String,CountedPtr<ColumnDesc> > casacore::ColumnDescSet::cols_p
private

The set of all columns.

Definition at line 194 of file ColDescSet.h.

Referenced by isDefined(), and ncolumn().

◆ colSeq_p

Block<void*> casacore::ColumnDescSet::colSeq_p
private

The order of addition of column descriptions.

Definition at line 198 of file ColDescSet.h.

Referenced by operator[]().


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