casacore
Loading...
Searching...
No Matches
ArrayColumnFunc.h
Go to the documentation of this file.
1// # ArrayColumnFunbc.h: Functors to operate on an ArrayColumn
2// # Copyright (C) 2009
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_ARRAYCOLUMNFUNC_H
27#define TABLES_ARRAYCOLUMNFUNC_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/tables/Tables/ArrayColumnBase.h>
32#include <casacore/casa/Arrays/Slicer.h>
33#include <casacore/casa/Arrays/ArrayBase.h>
34
35namespace casacore { // # NAMESPACE CASACORE - BEGIN
36
37// <summary> Abstract baseclass for slices functors </summary>
38// <synopsis>
39// There are several ArrayColumn functions to get or put irregular array
40// slices. ArrayColumnBase::handleSlices is used to perform all common
41// operations using a functor derived from this base class.
42// </synopsis>
44 public:
45 virtual ~BaseSlicesFunctor() {}
46 virtual void apply(const Slicer& slicer, ArrayBase& arr) = 0;
47};
48
49// <summary> Functor to get irregular array slices from a cell</summary>
50class GetCellSlices : public BaseSlicesFunctor {
51 public:
52 GetCellSlices(const ArrayColumnBase& col, rownr_t rownr) : itsCol(col), itsRow(rownr) {}
53 virtual void apply(const Slicer& slicer, ArrayBase& arr) {
54 itsCol.baseGetSlice(itsRow, slicer, arr);
55 }
56
57 private:
60};
61
62// <summary> Functor to get irregular array slices from a column</summary>
64 public:
65 GetColumnSlices(const ArrayColumnBase& col) : itsCol(col) {}
66 virtual void apply(const Slicer& slicer, ArrayBase& arr) {
67 itsCol.acbGetColumn(slicer, arr, False);
68 }
69
70 private:
72};
73
74// <summary> Functor to put irregular array slices into a cell </summary>
75class PutCellSlices : public BaseSlicesFunctor {
76 public:
77 PutCellSlices(ArrayColumnBase& col, rownr_t rownr) : itsCol(col), itsRow(rownr) {}
78 virtual void apply(const Slicer& slicer, ArrayBase& arr) {
79 itsCol.basePutSlice(itsRow, slicer, arr);
80 }
81
82 private:
85};
86
87// <summary> Functor to get irregular array slices from a column</summary>
89 public:
91 virtual void apply(const Slicer& slicer, ArrayBase& arr) { itsCol.acbPutColumn(slicer, arr); }
93 private:
95};
96
97} // namespace casacore
98
99#endif
Non-templated base class for templated Array class.
Definition ArrayBase.h:69
virtual void apply(const Slicer &slicer, ArrayBase &arr)=0
Functor to get irregular array slices from a cell.
GetCellSlices(const ArrayColumnBase &col, rownr_t rownr)
const ArrayColumnBase & itsCol
virtual void apply(const Slicer &slicer, ArrayBase &arr)
Functor to get irregular array slices from a column.
const ArrayColumnBase & itsCol
GetColumnSlices(const ArrayColumnBase &col)
virtual void apply(const Slicer &slicer, ArrayBase &arr)
Functor to put irregular array slices into a cell.
ArrayColumnBase & itsCol
PutCellSlices(ArrayColumnBase &col, rownr_t rownr)
virtual void apply(const Slicer &slicer, ArrayBase &arr)
Functor to get irregular array slices from a column.
PutColumnSlices(ArrayColumnBase &col)
virtual void apply(const Slicer &slicer, ArrayBase &arr)
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
const Bool False
Definition aipstype.h:42
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44