ScaRecordColDesc.h
Classes
- ScalarRecordColumnDesc -- Class to define columns of scalar records in tables (full description)
Interface
- Public Members
- explicit ScalarRecordColumnDesc (const String& name)
- ScalarRecordColumnDesc (const String& name, const String& comment)
- ScalarRecordColumnDesc (const String& name, const String& comment, const String& dataManName, const String& dataManGroup)
- ScalarRecordColumnDesc (const ScalarRecordColumnDesc&)
- ~ScalarRecordColumnDesc()
- ScalarRecordColumnDesc& operator= (const ScalarRecordColumnDesc&)
- virtual BaseColumnDesc* clone() const
- virtual String className() const
- virtual PlainColumn* makeColumn (ColumnSet*) const
- virtual void show (ostream& os) const
- Private Members
- static BaseColumnDesc* makeDesc (const String& name)
- virtual void putDesc (AipsIO&) const
- virtual void getDesc (AipsIO&)
- Public Members
- ScalarRecordColumnDesc (SimpleOrderedMap<String, BaseColumnDesc* (*)(const String&)>&)
Review Status
- Reviewed By:
- Wim Brouw
- Date Reviewed:
- 1998/12/09
- Programs:
- Tests:
Prerequisite
Etymology
This class builds descriptions of table columns where each cell (which
may also be called a row) will hold a scalar record value.
Synopsis
ScalarRecordColumnDesc is the class for defining a
table column containing scalar record values. The only record class
supported is TableRecord.
This class is similar to the templated class
ScalarColumnDesc used
to define column descriptions for scalars with a standard data type.
The data managers handle a record as an indirect Vector of uChar,
because class
ScalarRecordColumnData
converts a record to such a vector before passing it to the data manager.
This class is derived from
BaseColumnDesc, thus the functions
in there also apply to this class.
Once a column description is setup satisfactorily, it must be added
to a table description before it can be used by the table system.
Example
TableDesc tabDesc("tTableDesc", "1", TableDesc::New);
// Add a scalar integer column ac, define keywords for it
// and define a default value 0.
ScalarRecordColumnDesc<Int> acColumn("ac");
acColumn.rwKeywordSet().define ("scale", Complex(0));
acColumn.rwKeywordSet().define ("unit", "");
acColumn.setDefault (0);
tabDesc.addColumn (acColumn);
// Add another column, now with data type String..
// This can be added directly, because no special things like
// keywords or default values have to be set.
tabDesc.addColumn (ScalarRecordColumnDesc<String>("name", "comments"));
Motivation
This class resembles the templated class
ScalarColumnDesc
a lot, but is different enough to make that templated class not usable
for records.
In principle it could have been a template specialization,
but not all compilers support specializations so well.
To Do
A List of bugs, limitations, extensions or planned refinements.
- Introduce a class ArrayRecordColumnDesc to support arrays of records.
Member Description
Construct the column with the given name.
The data manager type defaults to the StandardStMan storage manager.
The data manager group defaults to the data manager type.
Construct the column with the given name and comment.
The data manager type defaults to the StandardStMan storage manager.
The data manager group defaults to the data manager type.
Construct the column with the given name, comment, and
default data manager type and group.
A blank data manager group defaults to the data manager type.
Copy constructor (copy semantics);
ScalarRecordColumnDesc& operator= (const ScalarRecordColumnDesc&)
Assignment (copy semantics);
Clone this column description.
Get the name of this class. It is used by the registration process.
Create a Column object out of this.
This is used by class ColumnSet to construct a table column object.
virtual void show (ostream& os) const
Show the column.
Create the object from AipsIO (this function is registered
by ColumnDesc.cc).
Put the object.
Get the object.
The purpose of this constructor is to register the makeDesc
function of this class and map it to a name.
ColumnDesc.cc registers such functions by using these constructors.