casa
$Rev:20696$
|
Templated class for description of table array columns. More...
#include <ArrColDesc.h>
Public Member Functions | |
ArrayColumnDesc (const String &name, Int ndim=-1, int options=0) | |
Construct the column with the given name and dimensionality. | |
ArrayColumnDesc (const String &name, const String &comment, Int ndim=-1, int options=0) | |
Construct the column with the given name, dimensionality, and comment. | |
ArrayColumnDesc (const String &name, const String &comment, const String &dataManName, const String &dataManGroup, Int ndim=-1, int options=0) | |
Construct the column with the given name, dimensionality, comment, and default data manager type and group. | |
ArrayColumnDesc (const String &name, const IPosition &shape, int options=0) | |
Construct the column with the given name and shape. | |
ArrayColumnDesc (const String &name, const String &comment, const IPosition &shape, int options=0) | |
Construct the column with the given name, shape, and comment. | |
ArrayColumnDesc (const String &name, const String &comment, const String &dataManName, const String &dataManGroup, const IPosition &shape, int options=0, int ndim=-1) | |
Construct the column with the given name, shape, comment, and default data manager type and group. | |
ArrayColumnDesc (const ArrayColumnDesc< T > &) | |
Copy constructor (copy semantics);. | |
~ArrayColumnDesc () | |
ArrayColumnDesc< T > & | operator= (const ArrayColumnDesc< T > &) |
Assignment (copy semantics);. | |
BaseColumnDesc * | clone () const |
Clone this column description to another. | |
String | className () const |
Get the name of this class. | |
virtual PlainColumn * | makeColumn (ColumnSet *) const |
Create a Column object out of this. | |
void | show (ostream &os) const |
Show the column. | |
void | registerClass () const |
Register the construction function of this class. | |
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. | |
Friends | |
class | ColumnDesc |
Templated class for description of table array columns.
Public interface
This class builds descriptions of table columns where each cell (which may also be called a row) will hold an array.
ArrayColumnDesc is a templated class for defining a table column containing arrays.
The table values are handled by a data manager. This can be a storage manager to store the values in a file or it can be a virtual column engine to calculate them on-the-fly. Only the basic data types are allowed when storing in a file. These are: Bool, uChar, Short, uShort, Int, uInt, float, double, Complex, DComplex and String.
At table creation time (when a table gets created from a table description), each column needs to be bound to a data manager. If not done explicitly, the table system will bind a column to the default manager defined in the column description.
An array column description consists of the following attributes:
There are several constructors, which allow the definition of most of the above mentioned attributes. Others, like the default keyword set, have to be defined explicitly.
This class is derived from BaseColumnDesc, thus the functions in there also apply to this class.
Once a column description is set up satisfactorily, it must be added to a table description before it can be used by the table system.
TableDesc tabDesc("tTableDesc", "1", TableDesc::New); // Now define array columns. // This one is indirect and has no dimensionality mentioned yet. // Define the keyword UNIT in it. ArrayColumnDesc<Complex> arr1Column("Arr1", "comment for Arr1"); arr1Column.rwKeywordSet().define ("UNIT", "Jy"); tabDesc.addColumn (arr1Column); // This one is indirect and has 3-dim arrays. tabDesc.addColumn (ArrayColumnDesc<Int>("Arr2", "comment for Arr2", 3)); // This one is direct and has 2-dim arrays with axis lengths 4 and 7. tabDesc.addColumn (ArrayColumnDesc<uInt>("Arr3", "comment for Arr1", IPosition(2,4,7), ColumnDesc::Direct));
Several column description classes are needed to allow the user to define attributes which are special for each column type. For scalars the special attribute is the default value. They all have to be templated to support arbitrary data types.
static String dataTypeId(); // (not needed for builtin types)
This should return the unique "name" of the class. Definition at line 180 of file ArrColDesc.h.
casa::ArrayColumnDesc< T >::ArrayColumnDesc | ( | const String & | name, |
Int | ndim = -1 , |
||
int | options = 0 |
||
) | [explicit] |
Construct the column with the given name and dimensionality.
The data manager type defaults to the StandardStman storage manager. The data manager group defaults to the data manager type. Ndim <=0 means that the number of dimensions is free and will be defined when creating the table (rows). Ndim>0 means that the arrays in this column must have the given dimensionality. The possible options are defined in ColumnDesc.h.
casa::ArrayColumnDesc< T >::ArrayColumnDesc | ( | const String & | name, |
const String & | comment, | ||
Int | ndim = -1 , |
||
int | options = 0 |
||
) |
Construct the column with the given name, dimensionality, and comment.
The data manager type defaults to the StandardStman storage manager. The data manager group defaults to the data manager type. Ndim <=0 means that the number of dimensions is free and will be defined when creating the table (rows). Ndim>0 means that the arrays in this column must have the given dimensionality. The possible options are defined in ColumnDesc.h.
casa::ArrayColumnDesc< T >::ArrayColumnDesc | ( | const String & | name, |
const String & | comment, | ||
const String & | dataManName, | ||
const String & | dataManGroup, | ||
Int | ndim = -1 , |
||
int | options = 0 |
||
) |
Construct the column with the given name, dimensionality, comment, and default data manager type and group.
A blank data manager group defaults to the data manager type. Ndim <=0 means that the number of dimensions is free and will be defined when creating the table (rows). Ndim>0 means that the arrays in this column must have the given dimensionality. The possible options are defined in ColumnDesc.h.
casa::ArrayColumnDesc< T >::ArrayColumnDesc | ( | const String & | name, |
const IPosition & | shape, | ||
int | options = 0 |
||
) |
Construct the column with the given name and shape.
The data manager type defaults to the StandardStman storage manager. The data manager group defaults to the data manager type. The possible options are defined in ColumnDesc.h. This constructor can only be used for FixedShape arrays, because the shape of other arrays can only be set per row.
casa::ArrayColumnDesc< T >::ArrayColumnDesc | ( | const String & | name, |
const String & | comment, | ||
const IPosition & | shape, | ||
int | options = 0 |
||
) |
Construct the column with the given name, shape, and comment.
The data manager type defaults to the StandardStman storage manager. The data manager group defaults to the data manager type. The possible options are defined in ColumnDesc.h. This constructor can only be used for FixedShape arrays, because the shape of other arrays can only be set per row.
casa::ArrayColumnDesc< T >::ArrayColumnDesc | ( | const String & | name, |
const String & | comment, | ||
const String & | dataManName, | ||
const String & | dataManGroup, | ||
const IPosition & | shape, | ||
int | options = 0 , |
||
int | ndim = -1 |
||
) |
Construct the column with the given name, shape, comment, and default data manager type and group.
A blank data manager group defaults to the data manager type. The possible options are defined in ColumnDesc.h. This constructor can only be used for FixedShape arrays, because the shape of other arrays can only be set per row. If both ndim and shape are given as > 0, ndim should match the length of shape.
casa::ArrayColumnDesc< T >::ArrayColumnDesc | ( | const ArrayColumnDesc< T > & | ) |
Copy constructor (copy semantics);.
casa::ArrayColumnDesc< T >::~ArrayColumnDesc | ( | ) |
String casa::ArrayColumnDesc< T >::className | ( | ) | const [virtual] |
Get the name of this class.
It is used by the registration process. The template argument gets part of the name.
Implements casa::BaseColumnDesc.
BaseColumnDesc* casa::ArrayColumnDesc< T >::clone | ( | ) | const [virtual] |
Clone this column description to another.
Implements casa::BaseColumnDesc.
virtual void casa::ArrayColumnDesc< T >::getDesc | ( | AipsIO & | ) | [protected, virtual] |
Get the object.
Implements casa::BaseColumnDesc.
virtual PlainColumn* casa::ArrayColumnDesc< T >::makeColumn | ( | ColumnSet * | ) | const [virtual] |
Create a Column object out of this.
This is used by class ColumnSet to construct a table column object.
Implements casa::BaseColumnDesc.
static BaseColumnDesc* casa::ArrayColumnDesc< T >::makeDesc | ( | const String & | name | ) | [static] |
Create the object from AipsIO (this function is registered).
ArrayColumnDesc<T>& casa::ArrayColumnDesc< T >::operator= | ( | const ArrayColumnDesc< T > & | ) |
Assignment (copy semantics);.
virtual void casa::ArrayColumnDesc< T >::putDesc | ( | AipsIO & | ) | const [protected, virtual] |
Put the object.
Implements casa::BaseColumnDesc.
void casa::ArrayColumnDesc< T >::registerClass | ( | ) | const |
Register the construction function of this class.
void casa::ArrayColumnDesc< T >::show | ( | ostream & | os | ) | const [virtual] |
Show the column.
Implements casa::BaseColumnDesc.
friend class ColumnDesc [friend] |
Reimplemented from casa::BaseColumnDesc.
Definition at line 182 of file ArrColDesc.h.