casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AsdmColumn.h
Go to the documentation of this file.
1 //# AsdmColumn.h: A column in the ASDM Storage Manager
2 //# Copyright (C) 2012
3 //# Associated Universities, Inc. Washington DC, USA.
4 //# (c) European Southern Observatory, 2012
5 //# Copyright by ESO (in the framework of the ALMA collaboration)
6 //#
7 //# This library is free software; you can redistribute it and/or modify it
8 //# under the terms of the GNU Library General Public License as published by
9 //# the Free Software Foundation; either version 2 of the License, or (at your
10 //# option) any later version.
11 //#
12 //# This library is distributed in the hope that it will be useful, but WITHOUT
13 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
15 //# License for more details.
16 //#
17 //# You should have receied a copy of the GNU Library General Public License
18 //# along with this library; if not, write to the Free Software Foundation,
19 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
20 //#
21 //# Correspondence concerning AIPS++ should be addressed as follows:
22 //# Internet email: aips2-request@nrao.edu.
23 //# Postal address: AIPS++ Project Office
24 //# National Radio Astronomy Observatory
25 //# 520 Edgemont Road
26 //# Charlottesville, VA 22903-2475 USA
27 //#
28 //# $Id: AsdmColumn.h 19324 2011-11-21 07:29:55Z diepen $
29 
30 #ifndef ASDM_ASDMCOLUMN_H
31 #define ASDM_ASDMCOLUMN_H
32 
33 
34 //# Includes
35 #include <asdmstman/AsdmStMan.h>
37 #include <casa/Arrays/IPosition.h>
38 #include <casa/Containers/Block.h>
39 #include <casa/OS/Conversion.h>
40 
41 namespace casa {
42 
43 // <summary>
44 // A column in the ASDM Storage Manager.
45 // </summary>
46 
47 // <use visibility=local>
48 
49 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tAsdmStMan.cc">
50 // </reviewed>
51 
52 // <prerequisite>
53 //# Classes you should understand before using this one.
54 // <li> <linkto class=AsdmStMan>AsdmStMan</linkto>
55 // </prerequisite>
56 
57 // <synopsis>
58 // For each column a specific Column class exists.
59 // </synopsis>
60 
62 {
63 public:
64  explicit AsdmColumn (AsdmStMan* parent, int dtype)
65  : casacore::StManColumn (dtype),
66  itsParent (parent)
67  {}
68  virtual ~AsdmColumn();
69  // All columns are not writable.
70  // However, we let AsdmColumn::isWritable() return true. If an actual write is done,
71  // an exception will be thrown. This ensures that the StMan will work with MSMainColumns.
72  virtual casacore::Bool isWritable() const;
73  // Set column shape of fixed shape columns; it does nothing.
74  virtual void setShapeColumn (const casacore::IPosition& shape);
75  // Prepare the column. By default it does nothing.
76  virtual void prepareCol();
77 
78 protected:
79 
80  template <typename T>
81  void getSlice (casacore::uInt rowNumber,
82  const casacore::Slicer & slicer,
83  casacore::Array<T> * destination);
84 
86 };
87 
88 // <summary>DATA column in the ASDM Storage Manager.</summary>
89 // <use visibility=local>
90 class AsdmDataColumn : public AsdmColumn
91 {
92 public:
93  explicit AsdmDataColumn (AsdmStMan* parent, int dtype)
94  : AsdmColumn(parent, dtype) {}
95  virtual ~AsdmDataColumn();
98  virtual void getSliceComplexV (casacore::uInt rowNumber, const casacore::Slicer & slicer,
100 };
101 
102 // <summary>FLOAT_DATA column in the ASDM Storage Manager.</summary>
103 // <use visibility=local>
104 class AsdmFloatDataColumn : public AsdmColumn
105 {
106 public:
107  explicit AsdmFloatDataColumn (AsdmStMan* parent, int dtype)
108  : AsdmColumn(parent, dtype) {}
109  virtual ~AsdmFloatDataColumn();
110  virtual casacore::IPosition shape (casacore::uInt rownr);
111  virtual void getArrayfloatV (casacore::uInt rowNr, casacore::Array<casacore::Float> * dataPtr);
112  virtual void getSlicefloatV (casacore::uInt rowNumber, const casacore::Slicer & slicer,
113  casacore::Array<casacore::Float> * destination);
114 };
115 
116 // <summary>FLAG column in the ASDM Storage Manager.</summary>
117 // <use visibility=local>
118 class AsdmFlagColumn : public AsdmColumn
119 {
120 public:
121  explicit AsdmFlagColumn (AsdmStMan* parent, int dtype)
122  : AsdmColumn(parent, dtype) {}
123  virtual ~AsdmFlagColumn();
124  virtual casacore::IPosition shape (casacore::uInt rownr);
125  virtual void getArrayBoolV (casacore::uInt rowNr,
127  virtual void getSliceBoolV (casacore::uInt rowNumber, const casacore::Slicer & slicer,
128  casacore::Array<casacore::Bool> * destination);
129 };
130 
131 // <summary>WEIGHT column in the ASDM Storage Manager.</summary>
132 // <use visibility=local>
133 class AsdmWeightColumn : public AsdmColumn
134 {
135 public:
136  explicit AsdmWeightColumn (AsdmStMan* parent, int dtype)
137  : AsdmColumn(parent, dtype) {}
138  virtual ~AsdmWeightColumn();
139  virtual casacore::IPosition shape (casacore::uInt rownr);
140  virtual void getArrayfloatV (casacore::uInt rowNr,
142  virtual void getSlicefloatV (casacore::uInt rowNumber, const casacore::Slicer & slicer,
143  casacore::Array<casacore::Float> * destination);
144 };
145 
146 // <summary>SIGMA column in the ASDM Storage Manager.</summary>
147 // <use visibility=local>
148 class AsdmSigmaColumn : public AsdmColumn
149 {
150 public:
151  explicit AsdmSigmaColumn (AsdmStMan* parent, int dtype)
152  : AsdmColumn(parent, dtype) {}
153  virtual ~AsdmSigmaColumn();
154  virtual casacore::IPosition shape (casacore::uInt rownr);
155  virtual void getArrayfloatV (casacore::uInt rowNr,
157  virtual void getSlicefloatV (casacore::uInt rowNumber, const casacore::Slicer & slicer,
158  casacore::Array<casacore::Float> * destination);
159 };
160 
161 
162 } //# end namespace
163 
164 #endif
AsdmColumn(AsdmStMan *parent, int dtype)
Definition: AsdmColumn.h:64
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
virtual ~AsdmDataColumn()
AsdmFlagColumn(AsdmStMan *parent, int dtype)
Definition: AsdmColumn.h:122
AsdmSigmaColumn(AsdmStMan *parent, int dtype)
Definition: AsdmColumn.h:152
AsdmStMan * itsParent
Definition: AsdmColumn.h:85
void getSlice(casacore::uInt rowNumber, const casacore::Slicer &slicer, casacore::Array< T > *destination)
virtual void getSlicefloatV(casacore::uInt rowNumber, const casacore::Slicer &slicer, casacore::Array< casacore::Float > *destination)
virtual void getSliceBoolV(casacore::uInt rowNumber, const casacore::Slicer &slicer, casacore::Array< casacore::Bool > *destination)
Get the array value in the given row.
AsdmWeightColumn(AsdmStMan *parent, int dtype)
Definition: AsdmColumn.h:137
virtual casacore::IPosition shape(casacore::uInt rownr)
Get the shape of the item in the given row.
virtual casacore::IPosition shape(casacore::uInt rownr)
Get the shape of the item in the given row.
virtual ~AsdmFlagColumn()
virtual ~AsdmSigmaColumn()
AsdmDataColumn(AsdmStMan *parent, int dtype)
Definition: AsdmColumn.h:94
DATA column in the ASDM Storage Manager.
Definition: AsdmColumn.h:91
The Storage Manager for the main table of a raw ASDM casacore::MS.
Definition: AsdmStMan.h:122
virtual casacore::IPosition shape(casacore::uInt rownr)
Get the shape of the item in the given row.
virtual void getSliceComplexV(casacore::uInt rowNumber, const casacore::Slicer &slicer, casacore::Array< casacore::Complex > *destination)
virtual casacore::IPosition shape(casacore::uInt rownr)
Get the shape of the item in the given row.
virtual void getSlicefloatV(casacore::uInt rowNumber, const casacore::Slicer &slicer, casacore::Array< casacore::Float > *destination)
virtual void getSlicefloatV(casacore::uInt rowNumber, const casacore::Slicer &slicer, casacore::Array< casacore::Float > *destination)
virtual void getArrayfloatV(casacore::uInt rowNr, casacore::Array< casacore::Float > *dataPtr)
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
virtual void getArrayBoolV(casacore::uInt rowNr, casacore::Array< casacore::Bool > *dataPtr)
Get the array value in the given row.
template &lt;class T, class U&gt; class vector;
Definition: MSFlagger.h:37
Specify which elements to extract from an n-dimensional array.
Definition: Slicer.h:289
virtual casacore::IPosition shape(casacore::uInt rownr)
Get the shape of the item in the given row.
virtual ~AsdmColumn()
virtual IPosition shape(uInt rownr)
Get the shape of the item in the given row.
virtual void getArrayfloatV(casacore::uInt rowNr, casacore::Array< casacore::Float > *dataPtr)
virtual void prepareCol()
Prepare the column.
virtual casacore::Bool isWritable() const
All columns are not writable.
Base table column storage manager class.
Definition: StManColumn.h:102
AsdmFloatDataColumn(AsdmStMan *parent, int dtype)
Definition: AsdmColumn.h:108
virtual void getArrayfloatV(casacore::uInt rowNr, casacore::Array< casacore::Float > *dataPtr)
virtual void setShapeColumn(const casacore::IPosition &shape)
Set column shape of fixed shape columns; it does nothing.
A column in the ASDM Storage Manager.
Definition: AsdmColumn.h:61
unsigned int uInt
Definition: aipstype.h:51
virtual void getArrayComplexV(casacore::uInt rowNr, casacore::Array< casacore::Complex > *dataPtr)
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42