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
30//# Includes
31#include <casacore/casa/aips.h>
32#include <casacore/tables/Tables/BaseColDesc.h>
33
34namespace casacore { //# NAMESPACE CASACORE - BEGIN
35
36//# Forward Declarations
37class PlainColumn;
38class ColumnSet;
39
40
41// <summary>
42// Class to define columns of scalar records in tables
43// </summary>
44
45// <reviewed reviewer="Wim Brouw" date="1998/12/09" tests="tTableDesc">
46// </reviewed>
47
48// <use visibility=export>
49
50// <prerequisite>
51// <li> <linkto class=ColumnDesc>ColumnDesc</linkto>
52// <li> <linkto class=TableDesc>TableDesc</linkto>
53// <li> <linkto class=TableRecord>TableRecord</linkto>
54// </prerequisite>
55
56// <etymology>
57// This class builds descriptions of table columns where each cell (which
58// may also be called a row) will hold a scalar record value.
59// </etymology>
60
61// <synopsis>
62// ScalarRecordColumnDesc is the class for defining a
63// table column containing scalar record values. The only record class
64// supported is <linkto class=TableRecord>TableRecord</linkto>.
65// <br>
66// This class is similar to the templated class
67// <linkto class=ScalarColumnDesc>ScalarColumnDesc</linkto> used
68// to define column descriptions for scalars with a standard data type.
69// <p>
70// The data managers handle a record as an indirect Vector of uChar,
71// because class
72// <linkto class=ScalarRecordColumnData>ScalarRecordColumnData</linkto>
73// converts a record to such a vector before passing it to the data manager.
74// <p>
75// This class is derived from
76// <linkto class=BaseColumnDesc>BaseColumnDesc</linkto>, thus the functions
77// in there also apply to this class.
78// <br>
79// Once a column description is setup satisfactorily, it must be added
80// to a table description before it can be used by the table system.
81// </synopsis>
82
83// <example>
84// <srcblock>
85// TableDesc tabDesc("tTableDesc", "1", TableDesc::New);
86//
87// // Add a scalar integer column ac, define keywords for it
88// // and define a default value 0.
89// ScalarRecordColumnDesc<Int> acColumn("ac");
90// acColumn.rwKeywordSet().define ("scale", Complex(0));
91// acColumn.rwKeywordSet().define ("unit", "");
92// acColumn.setDefault (0);
93// tabDesc.addColumn (acColumn);
94//
95// // Add another column, now with data type String..
96// // This can be added directly, because no special things like
97// // keywords or default values have to be set.
98// tabDesc.addColumn (ScalarRecordColumnDesc<String>("name", "comments"));
99// </srcblock>
100// </example>
101
102// <motivation>
103// This class resembles the templated class
104// <linkto class=ScalarColumnDesc>ScalarColumnDesc</linkto>
105// a lot, but is different enough to make that templated class not usable
106// for records.
107// <br>In principle it could have been a template specialization,
108// but not all compilers support specializations so well.
109// </motivation>
110
111// <todo asof="$DATE:$">
112//# A List of bugs, limitations, extensions or planned refinements.
113// <li> Introduce a class ArrayRecordColumnDesc to support arrays of records.
114// </todo>
115
116
118{
119friend class ColumnDesc;
120
121public:
122 // Construct the column with the given name.
123 // The data manager type defaults to the StandardStMan storage manager.
124 // The data manager group defaults to the data manager type.
126
127 // Construct the column with the given name and comment.
128 // The data manager type defaults to the StandardStMan storage manager.
129 // The data manager group defaults to the data manager type.
131
132 // Construct the column with the given name, comment, and
133 // default data manager type and group.
134 // A blank data manager group defaults to the data manager type.
136 const String& dataManName,
137 const String& dataManGroup);
138
139 // Copy constructor (copy semantics);
141
143
144 // Assignment (copy semantics);
146
147 // Clone this column description.
148 virtual BaseColumnDesc* clone() const;
149
150 // Get the name of this class. It is used by the registration process.
151 virtual String className() const;
152
153 // Create a Column object out of this.
154 // This is used by class ColumnSet to construct a table column object.
156
157 // Show the column.
158 virtual void show (ostream& os) const;
159
160 // Create the object from AipsIO (this function is registered
161 // by ColumnDesc.cc).
163
164private:
165 // Put the object.
166 virtual void putDesc (AipsIO&) const;
167
168 // Get the object.
169 virtual void getDesc (AipsIO&);
170};
171
172
173
174} //# NAMESPACE CASACORE - END
175
176#endif
const String & comment() const
Get comment string.
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:223
this file contains all the compiler specific defines
Definition mainpage.dox:28