casacore
Loading...
Searching...
No Matches
TSMColumn.h
Go to the documentation of this file.
1//# TSMColumn.h: A column in the Tiled Storage Manager
2//# Copyright (C) 1995,1996,1997,1999
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_TSMCOLUMN_H
27#define TABLES_TSMCOLUMN_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <casacore/tables/DataMan/StManColumnBase.h>
32#include <casacore/casa/Arrays/IPosition.h>
33#include <casacore/casa/BasicSL/String.h>
34
35namespace casacore { //# NAMESPACE CASACORE - BEGIN
36
37//# Forward Declarations
38class TiledStMan;
39class TSMDataColumn;
40class TSMCoordColumn;
41class TSMIdColumn;
42
43
44// <summary>
45// A column in the Tiled Storage Manager
46// </summary>
47
48// <use visibility=local>
49
50// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
51// </reviewed>
52
53// <prerequisite>
54//# Classes you should understand before using this one.
55// <li> <linkto class=StManColumn>StManColumn</linkto>
56// <li> <linkto class=TiledStMan>TiledStMan</linkto>
57// </prerequisite>
58
59// <etymology>
60// TSMColumn handles a column for the Tiled Storage Manager.
61// </etymology>
62
63// <synopsis>
64// TSMColumn serves 2 purposes:
65// <ol>
66// <li> It is the initial object for all columns in TiledStMan.
67// <li> It serves as a base class for the specialized TiledStMan
68// column classes dealing with data, coordinates and id values.
69// </ol>
70// The protocol used for creating the derived
71// <linkto class=TSMDataColumn>TSMDataColumn</linkto>,
72// <linkto class=TSMCoordColumn>TSMCoordColumn</linkto>, and
73// <linkto class=TSMIdColumn>TSMIdColumn</linkto>
74// objects is somewhat complicated. It works as follows:
75// <br>
76// When the table is set up, a TSMColumn object gets created for all
77// columns in a TiledStMan storage manager. The TiledStMan initialization
78// function lets each TSMColumn object create its specialized TSMXXColumn
79// object (using make{Coord,Id,Data}Column). At the end of the setup process
80// the TSMColumn objects are deleted and the DataManagerColumn pointers
81// in the BaseColumn objects get replaced by those to the specialized
82// objects. In that way no needless virtual function calls are done.
83// </synopsis>
84
85// <motivation>
86// TSMColumn is needed for the initial DataManagerColumn setup process.
87// It is also useful as a base class for all TiledStMan column objects.
88// </motivation>
89
90//# <todo asof="$DATE:$">
91//# A List of bugs, limitations, extensions or planned refinements.
92//# </todo>
93
94
96{
97public:
98
99 // Create a column of the given type.
100 // It will maintain a pointer to its parent storage manager.
102
103 // Frees up the storage.
104 virtual ~TSMColumn();
105
106 // Forbid assignment.
107 TSMColumn& operator= (const TSMColumn&) = delete;
108
109 // Get the name of the column.
110 const String& columnName() const;
111
112 // Return the data type of the column.
113 virtual int dataType() const;
114
115 // Set the fixed shape of the column.
117
118 // Get the fixed shape of the column.
119 const IPosition& shapeColumn() const;
120
121 // Make a TSM data column object.
122 // Add the pixel length to the total data pixel length.
124
125 // Make a TSM coordinate column object.
127
128 // Make a TSM id column object.
130
131 // Unlink the underlying column.
132 // It clears the pointer and returns its original value.
133 // This is used to get a pointer directly to the underlying TSMXXColumn
134 // object in the BaseColumn classes. In that way only 1 instead
135 // of 2 virtual function calls are needed for a get or put.
137
138
139protected:
140 // The storage manager.
142 // The data type of the data (as defined in DataType.h).
144 // The name of the column.
146 // The fixed shape of the column.
148 // The specialized column object (i.e. data, coordinate or id).
150
151 // The copy constructor can only be used to copy a derived class.
152 TSMColumn (const TSMColumn& that);
153};
154
155
156inline const String& TSMColumn::columnName() const
157 { return name_p; }
158
160 { return columnShape_p; }
161
162
163
164
165} //# NAMESPACE CASACORE - END
166
167#endif
virtual IPosition shape(rownr_t rownr)
Get the shape of the item in the given row.
String: the storage and methods of handling collections of characters.
Definition String.h:223
int dtype_p
The data type of the data (as defined in DataType.h).
Definition TSMColumn.h:143
virtual int dataType() const
Return the data type of the column.
TSMColumn(TiledStMan *stman, int dataType, const String &columnName)
Create a column of the given type.
TSMIdColumn * makeIdColumn()
Make a TSM id column object.
TSMCoordColumn * makeCoordColumn(uInt axesNumber)
Make a TSM coordinate column object.
const String & columnName() const
Get the name of the column.
Definition TSMColumn.h:156
TSMColumn * colPtr_p
The specialized column object (i.e.
Definition TSMColumn.h:149
String name_p
The name of the column.
Definition TSMColumn.h:145
TSMColumn & operator=(const TSMColumn &)=delete
Forbid assignment.
virtual ~TSMColumn()
Frees up the storage.
TSMDataColumn * makeDataColumn()
Make a TSM data column object.
TiledStMan * stmanPtr_p
The storage manager.
Definition TSMColumn.h:141
const IPosition & shapeColumn() const
Get the fixed shape of the column.
Definition TSMColumn.h:159
void setShapeColumn(const IPosition &shape)
Set the fixed shape of the column.
TSMColumn(const TSMColumn &that)
The copy constructor can only be used to copy a derived class.
IPosition columnShape_p
The fixed shape of the column.
Definition TSMColumn.h:147
TSMColumn * unlink()
Unlink the underlying column.
this file contains all the compiler specific defines
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49