- Direct = 1
- Undefined = 2
- direct table or array
Since there are several types of columns, the class ColumnDesc
cannot handle all details of those column types. Therefore,
to create a column description, an instance of the specialized
classes ArrayColumnDesc
This class also enumerates the possible options
which can be used when defining a column via classes like
ScalarColumnDesc
Copy constructor (copy semantics).
Default constructor (needed for ColumnDescSet).
Assignment (copy semantics).
Get access to the set of keywords.
Get the name of the column.
Get the data type of the column.
Get the name of the default data manager.
Get the data manager group.
Get comment string.
Get comment string (allowing it to be changed).
Get the options. The possible options are defined by the enum Option.
E.g.
Test if column is a scalar.
Test if column is an array.
Test if column is a table.
Get the number of dimensions.
Get table description (in case column contains subtables).
Show the column on cout.
Write into AipsIO.
Read from AipsIO.
Show on ostream.
Serve as default function for registerMap (see below), which catches
all unknown xxxColumnDesc class names.
Check if a column can be handled by ColumnDescSet.
It is called before the column gets actually added, etc..
Check if the column can be added to the table description.
It is implemented for a virtual column to check if the columns
it uses really exist.
Check if a column can be handled by ColumnDescSet.
It is called before the column gets actually added, etc..
Check when a column gets renamed in a table description.
It is not used.
Take action after a column has been handled by ColumnDescSet.
It is called after the column has been actually added, etc..
This gives, for instance, the virtual column class the opportunity
to update the virtual column list.
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.
It is called after handleRename has been called.
Create a PlainColumn column object out of this column description.
Create a RefColumn column object out of this column description.
Set the name of the column.
Store the object in AipsIO.
Get the object from AipsIO.
It uses the registerMap to construct the correct xxxColumnDesc object.
Register all column types. In this way the getFile function
can construct the correct xxxColumnDesc object.
Copyright © 1995 Associated Universities Inc., Washington, D.C.
Example
TableDesc tableDesc("theTableDesc", TableDesc::New);
// Add a float scalar column.
tableDesc.addColumn (ScalarColumnDesc<float> ("NAME");
// Get the description of a column and change the comments.
// In order to change the comments, a reference must be used
// (because the ColumnDesc copy constructor and assign have copy
// semantics).
ColumnDesc& myColDesc = tableDesc.columnDesc ("aName");
myColDesc.comment() += "some more comments";
Motivation
When getting the description of an arbitrary column, a pointer to
that description is needed to allow proper execution of virtual
functions.
An envelope class is needed to hide this from the user.
To Do
Member Description
enum Option
ColumnDesc (const BaseColumnDesc&)
Construct from a column description.
This constructor is merely for the purpose of the automatic
conversion of an object like ScalarColumnDescColumnDesc (const ColumnDesc& that)
ColumnDesc() : colPtr_p(0)
~ColumnDesc()
ColumnDesc& operator= (const ColumnDesc& that)
ScalarKeywordSet& keywordSet()
const ScalarKeywordSet& keywordSet() const
const String& name() const
DataType dataType() const
const String& dataManagerName() const
const String& dataManagerGroup() const
const String& comment() const
String& comment()
int options() const
const ColumnDesc& coldesc = tableDesc.getColumn ("column_name");
if (coldesc.option() & ColumnDesc::Direct == ColumnDesc::Direct) {
// the column has the Direct flag set
}
Bool isScalar() const
Bool isArray() const
Bool isTable() const
Int ndim() const
const TableDesc* tableDesc() const
TableDesc* tableDesc()
void show() const
friend AipsIO& operator<< (AipsIO& ios, const ColumnDesc& cd)
friend AipsIO& operator>> (AipsIO& ios, ColumnDesc& cd)
friend ostream& operator<< (ostream& ios, const ColumnDesc& cd)
static BaseColumnDesc* unknownColumnDesc (const String& name, AipsIO&)
Thrown Exceptions
ColumnDesc (BaseColumnDesc*)
Construct from a pointer (for class BaseColumn).
void checkAdd (const ColumnDescSet& cds) const
void checkRename (const ColumnDescSet& cds, const String& newName) const
void handleAdd (ColumnDescSet& cds)
void handleRename (ColumnDescSet& cds, const String& oldName)
void handleRemove (ColumnDescSet& cds)
void renameAction (const String& newName, const String& oldName)
PlainColumn* makeColumn (ColumnSet* csp)
RefColumn* makeRefColumn (RefTable* rtp, BaseColumn* bcp)
void setName (const String& name)
void putFile (AipsIO&) const
void getFile (AipsIO&)
Thrown Exceptions
void registerColumnDesc()
This function is implemented in ColumnReg.cc.