casacore
Loading...
Searching...
No Matches
ScaRecordColDesc.h
Go to the documentation of this file.
1// # ScaRecordColDesc.h: Class for description of table scalar record columns
2// # Copyright (C) 1998,2000
3// # Associated Universities, Inc. Washington DC, USA.
4// #
5// # This library is free software; you can redistribute it and/or modify it
6// # under the terms of the GNU Library General Public License as published by
7// # the Free Software Foundation; either version 2 of the License, or (at your
8// # option) any later version.
9// #
10// # This library is distributed in the hope that it will be useful, but WITHOUT
11// # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12// # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13// # License for more details.
14// #
15// # You should have received a copy of the GNU Library General Public License
16// # along with this library; if not, write to the Free Software Foundation,
17// # Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18// #
19// # Correspondence concerning AIPS++ should be addressed as follows:
20// # Internet email: casa-feedback@nrao.edu.
21// # Postal address: AIPS++ Project Office
22// # National Radio Astronomy Observatory
23// # 520 Edgemont Road
24// # Charlottesville, VA 22903-2475 USA
25
26#ifndef TABLES_SCARECORDCOLDESC_H
27#define TABLES_SCARECORDCOLDESC_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/tables/Tables/BaseColDesc.h>
32
33namespace casacore { // # NAMESPACE CASACORE - BEGIN
34
35// # Forward Declarations
36class PlainColumn;
37class ColumnSet;
38
39// <summary>
40// Class to define columns of scalar records in tables
41// </summary>
42
43// <reviewed reviewer="Wim Brouw" date="1998/12/09" tests="tTableDesc">
44// </reviewed>
45
46// <use visibility=export>
47
48// <prerequisite>
49// <li> <linkto class=ColumnDesc>ColumnDesc</linkto>
50// <li> <linkto class=TableDesc>TableDesc</linkto>
51// <li> <linkto class=TableRecord>TableRecord</linkto>
52// </prerequisite>
53
54// <etymology>
55// This class builds descriptions of table columns where each cell (which
56// may also be called a row) will hold a scalar record value.
57// </etymology>
58
59// <synopsis>
60// ScalarRecordColumnDesc is the class for defining a
61// table column containing scalar record values. The only record class
62// supported is <linkto class=TableRecord>TableRecord</linkto>.
63// <br>
64// This class is similar to the templated class
65// <linkto class=ScalarColumnDesc>ScalarColumnDesc</linkto> used
66// to define column descriptions for scalars with a standard data type.
67// <p>
68// The data managers handle a record as an indirect Vector of uChar,
69// because class
70// <linkto class=ScalarRecordColumnData>ScalarRecordColumnData</linkto>
71// converts a record to such a vector before passing it to the data manager.
72// <p>
73// This class is derived from
74// <linkto class=BaseColumnDesc>BaseColumnDesc</linkto>, thus the functions
75// in there also apply to this class.
76// <br>
77// Once a column description is setup satisfactorily, it must be added
78// to a table description before it can be used by the table system.
79// </synopsis>
80
81// <example>
82// <srcblock>
83// TableDesc tabDesc("tTableDesc", "1", TableDesc::New);
84//
85// // Add a scalar integer column ac, define keywords for it
86// // and define a default value 0.
87// ScalarRecordColumnDesc<Int> acColumn("ac");
88// acColumn.rwKeywordSet().define ("scale", Complex(0));
89// acColumn.rwKeywordSet().define ("unit", "");
90// acColumn.setDefault (0);
91// tabDesc.addColumn (acColumn);
92//
93// // Add another column, now with data type String..
94// // This can be added directly, because no special things like
95// // keywords or default values have to be set.
96// tabDesc.addColumn (ScalarRecordColumnDesc<String>("name", "comments"));
97// </srcblock>
98// </example>
99
100// <motivation>
101// This class resembles the templated class
102// <linkto class=ScalarColumnDesc>ScalarColumnDesc</linkto>
103// a lot, but is different enough to make that templated class not usable
104// for records.
105// <br>In principle it could have been a template specialization,
106// but not all compilers support specializations so well.
107// </motivation>
108
109// <todo asof="$DATE:$">
110// # A List of bugs, limitations, extensions or planned refinements.
111// <li> Introduce a class ArrayRecordColumnDesc to support arrays of records.
112// </todo>
113
115 friend class ColumnDesc;
116
117 public:
118 // Construct the column with the given name.
119 // The data manager type defaults to the StandardStMan storage manager.
120 // The data manager group defaults to the data manager type.
122
123 // Construct the column with the given name and comment.
124 // The data manager type defaults to the StandardStMan storage manager.
125 // The data manager group defaults to the data manager type.
127
128 // Construct the column with the given name, comment, and
129 // default data manager type and group.
130 // A blank data manager group defaults to the data manager type.
131 ScalarRecordColumnDesc(const String& name, const String& comment, const String& dataManName,
132 const String& dataManGroup);
133
134 // Copy constructor (copy semantics);
136
138
139 // Assignment (copy semantics);
141
142 // Clone this column description.
143 virtual BaseColumnDesc* clone() const;
144
145 // Get the name of this class. It is used by the registration process.
146 virtual String className() const;
147
148 // Create a Column object out of this.
149 // This is used by class ColumnSet to construct a table column object.
151
152 // Show the column.
153 virtual void show(ostream& os) const;
154
155 // Create the object from AipsIO (this function is registered
156 // by ColumnDesc.cc).
158
159 private:
160 // Put the object.
161 virtual void putDesc(AipsIO&) const;
162
163 // Get the object.
164 virtual void getDesc(AipsIO&);
165};
166
167} // namespace casacore
168
169#endif
const String & comment() const
Get comment string.
BaseColumnDesc(const String &name, const String &comment, const String &dataManagerType, const String &dataManagerGroup, DataType, const String &dataTypeId, Int options, uInt ndim, const IPosition &shape, Bool isScalar, Bool isArray, Bool isTable)
Construct the column base object.
const String & name() const
Get the name of the column.
ScalarRecordColumnDesc(const ScalarRecordColumnDesc &)
Copy constructor (copy semantics);.
virtual void getDesc(AipsIO &)
Get the object.
ScalarRecordColumnDesc & operator=(const ScalarRecordColumnDesc &)
Assignment (copy semantics);.
virtual BaseColumnDesc * clone() const
Clone this column description.
ScalarRecordColumnDesc(const String &name, const String &comment, const String &dataManName, const String &dataManGroup)
Construct the column with the given name, comment, and default data manager type and group.
virtual void putDesc(AipsIO &) const
Put the object.
virtual PlainColumn * makeColumn(ColumnSet *) const
Create a Column object out of this.
ScalarRecordColumnDesc(const String &name)
Construct the column with the given name.
virtual String className() const
Get the name of this class.
virtual void show(ostream &os) const
Show the column.
static BaseColumnDesc * makeDesc(const String &name)
Create the object from AipsIO (this function is registered by ColumnDesc.cc).
ScalarRecordColumnDesc(const String &name, const String &comment)
Construct the column with the given name and comment.
String: the storage and methods of handling collections of characters.
Definition String.h:355
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28