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// <summary>
44// A column in the Tiled Storage Manager
45// </summary>
46
47// <use visibility=local>
48
49// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
50// </reviewed>
51
52// <prerequisite>
53// # Classes you should understand before using this one.
54// <li> <linkto class=StManColumn>StManColumn</linkto>
55// <li> <linkto class=TiledStMan>TiledStMan</linkto>
56// </prerequisite>
57
58// <etymology>
59// TSMColumn handles a column for the Tiled Storage Manager.
60// </etymology>
61
62// <synopsis>
63// TSMColumn serves 2 purposes:
64// <ol>
65// <li> It is the initial object for all columns in TiledStMan.
66// <li> It serves as a base class for the specialized TiledStMan
67// column classes dealing with data, coordinates and id values.
68// </ol>
69// The protocol used for creating the derived
70// <linkto class=TSMDataColumn>TSMDataColumn</linkto>,
71// <linkto class=TSMCoordColumn>TSMCoordColumn</linkto>, and
72// <linkto class=TSMIdColumn>TSMIdColumn</linkto>
73// objects is somewhat complicated. It works as follows:
74// <br>
75// When the table is set up, a TSMColumn object gets created for all
76// columns in a TiledStMan storage manager. The TiledStMan initialization
77// function lets each TSMColumn object create its specialized TSMXXColumn
78// object (using make{Coord,Id,Data}Column). At the end of the setup process
79// the TSMColumn objects are deleted and the DataManagerColumn pointers
80// in the BaseColumn objects get replaced by those to the specialized
81// objects. In that way no needless virtual function calls are done.
82// </synopsis>
83
84// <motivation>
85// TSMColumn is needed for the initial DataManagerColumn setup process.
86// It is also useful as a base class for all TiledStMan column objects.
87// </motivation>
88
89// # <todo asof="$DATE:$">
90// # A List of bugs, limitations, extensions or planned refinements.
91// # </todo>
92
93class TSMColumn : public StManColumnBase {
94 public:
95 // Create a column of the given type.
96 // It will maintain a pointer to its parent storage manager.
98
99 // Frees up the storage.
100 virtual ~TSMColumn();
101
102 // Forbid assignment.
103 TSMColumn& operator=(const TSMColumn&) = delete;
104
105 // Get the name of the column.
106 const String& columnName() const;
107
108 // Return the data type of the column.
109 virtual int dataType() const;
110
111 // Set the fixed shape of the column.
113
114 // Get the fixed shape of the column.
115 const IPosition& shapeColumn() const;
116
117 // Make a TSM data column object.
118 // Add the pixel length to the total data pixel length.
120
121 // Make a TSM coordinate column object.
123
124 // Make a TSM id column object.
126
127 // Unlink the underlying column.
128 // It clears the pointer and returns its original value.
129 // This is used to get a pointer directly to the underlying TSMXXColumn
130 // object in the BaseColumn classes. In that way only 1 instead
131 // of 2 virtual function calls are needed for a get or put.
133
134 protected:
135 // The storage manager.
137 // The data type of the data (as defined in DataType.h).
139 // The name of the column.
141 // The fixed shape of the column.
143 // The specialized column object (i.e. data, coordinate or id).
145
146 // The copy constructor can only be used to copy a derived class.
147 TSMColumn(const TSMColumn& that);
148};
149
150inline const String& TSMColumn::columnName() const { return name_p; }
151
152inline const IPosition& TSMColumn::shapeColumn() const { return columnShape_p; }
153
154} // namespace casacore
155
156#endif
StManColumnBase(int dataType)
Default constructor.
String: the storage and methods of handling collections of characters.
Definition String.h:355
int dtype_p
The data type of the data (as defined in DataType.h).
Definition TSMColumn.h:138
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:150
TSMColumn * colPtr_p
The specialized column object (i.e.
Definition TSMColumn.h:144
String name_p
The name of the column.
Definition TSMColumn.h:140
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:136
const IPosition & shapeColumn() const
Get the fixed shape of the column.
Definition TSMColumn.h:152
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:142
TSMColumn * unlink()
Unlink the underlying column.
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
IPosition shape(const RecordFieldId &) const
Get the actual shape of this field.