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 {
45 public:
47 {}
48 virtual void apply (const Slicer& slicer, ArrayBase& arr) = 0;
49 };
50
51 // <summary> Functor to get irregular array slices from a cell</summary>
52 class GetCellSlices : public BaseSlicesFunctor
53 {
54 public:
55 GetCellSlices (const ArrayColumnBase& col, rownr_t rownr)
56 : itsCol(col), itsRow(rownr)
57 {}
58 virtual void apply (const Slicer& slicer, ArrayBase& arr)
59 { itsCol.baseGetSlice (itsRow, slicer, arr); }
60 private:
63 };
64
65 // <summary> Functor to get irregular array slices from a column</summary>
67 {
68 public:
70 : itsCol(col)
71 {}
72 virtual void apply (const Slicer& slicer, ArrayBase& arr)
73 { itsCol.acbGetColumn (slicer, arr, False); }
74 private:
76 };
77
78 // <summary> Functor to put irregular array slices into a cell </summary>
79 class PutCellSlices : public BaseSlicesFunctor
80 {
81 public:
83 : itsCol(col), itsRow(rownr)
84 {}
85 virtual void apply (const Slicer& slicer, ArrayBase& arr)
86 { itsCol.basePutSlice (itsRow, slicer, arr); }
87 private:
90 };
91
92 // <summary> Functor to get irregular array slices from a column</summary>
94 {
95 public:
97 : itsCol(col)
98 {}
99 virtual void apply (const Slicer& slicer, ArrayBase& arr)
100 { itsCol.acbPutColumn (slicer, arr); }
101 private:
103 };
104
105} //# NAMESPACE CASACORE - END
106
107#endif
Non-templated base class for templated Array class.
Definition ArrayBase.h:71
void baseGetSlice(rownr_t rownr, const Slicer &arraySection, ArrayBase &array) const
void acbGetColumn(ArrayBase &array, Bool resize) const
Get the array of all values in a column.
void acbPutColumn(const ArrayBase &array)
Put the array of all values in the column.
void basePutSlice(rownr_t rownr, const Slicer &arraySection, const ArrayBase &array)
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)
this file contains all the compiler specific defines
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