casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ConcatScalarColumn.h
Go to the documentation of this file.
1 //# ConcatScalarColumn.h: A typed scalar column in a concatenated table
2 //# Copyright (C) 2008
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: aips2-request@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 //# $Id$
27 
28 #ifndef TABLES_CONCATSCALARCOLUMN_H
29 #define TABLES_CONCATSCALARCOLUMN_H
30 
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
35 
36 namespace casacore { //# NAMESPACE CASACORE - BEGIN
37 
38  // <summary>
39  // A typed column in a concatenated table
40  // </summary>
41 
42  // <use visibility=local>
43 
44  // <reviewed reviewer="UNKNOWN" date="" tests="">
45  // </reviewed>
46 
47  // <prerequisite>
48  //# Classes you should understand before using this one.
49  // <li> ConcatTable
50  // <li> BaseColumn
51  // </prerequisite>
52 
53  // <etymology>
54  // ConcatTable represents a column in a ConcatTable. A ConcatTable is a table
55  // referencing another table, usually as the result of a select, etc..
56  // </etymology>
57 
58  // <synopsis>
59  // ConcatColumn handles the access of a column in a ConcatTable.
60  // It calls the corresponding function in the referenced column
61  // while converting the given row number to the row number in the
62  // referenced table.
63  // </synopsis>
64 
65  // <motivation>
66  // This class is untyped, i.e. not templated.
67  // Every call is sent to the underlying referenced BaseColumn which
68  // is typed by the virtual function mechanism.
69  // A ConcatColumn can never be used directly. A user always has to
70  // construct a typed ArrayColumn or ScalarColumn object to access a column.
71  // This means everyting is fully type safe.
72  // </motivation>
73 
74  // <todo asof="$DATE:$">
75  //# A List of bugs, limitations, extensions or planned refinements.
76  // <li> Act upon removal of rows or the underlying column
77  // </todo>
78 
79  template<typename T>
81  {
82  public:
83  // Construct the ConcatColumn. It will point to the given column
84  // description, ConcatTable and referenced column.
85  // The ConcatTable will be used to convert the rownr to the rownr
86  // in the referenced column.
88 
90 
91  // Get the vector of all scalar values in a column.
92  virtual void getScalarColumn (void* dataPtr) const;
93 
94  // Get the vector of some scalar values in a column.
95  virtual void getScalarColumnCells (const RefRows& rownrs,
96  void* dataPtr) const;
97 
98  // Put the vector of all scalar values in the column.
99  virtual void putScalarColumn (const void* dataPtr);
100 
101  // Get the vector of some scalar values in a column.
102  virtual void putScalarColumnCells (const RefRows& rownrs,
103  const void* dataPtr);
104 
105  // Handle the creation and deletion of sort keys.
106  // <group>
107  virtual void makeSortKey (Sort& sortobj,
108  CountedPtr<BaseCompare>& cmpObj,
109  Int order,
110  const void*& dataSave);
111  virtual void makeRefSortKey (Sort& sortobj,
112  CountedPtr<BaseCompare>& cmpObj,
113  Int order,
114  const Vector<uInt>& rownrs,
115  const void*& dataSave);
116  virtual void fillSortKey (const Vector<T>* vecPtr,
117  Sort& sortobj,
118  CountedPtr<BaseCompare>& cmpObj,
119  Int order);
120  virtual void freeSortKey (const void*& dataSave);
121  // </group>
122 
123  };
124 
125 } //# NAMESPACE CASACORE - END
126 
127 #ifndef CASACORE_NO_AUTO_TEMPLATES
128 #include <casacore/tables/Tables/ConcatScalarColumn.tcc>
129 #endif //# CASACORE_NO_AUTO_TEMPLATES
130 #endif
virtual void makeSortKey(Sort &sortobj, CountedPtr< BaseCompare > &cmpObj, Int order, const void *&dataSave)
Handle the creation and deletion of sort keys.
int Int
Definition: aipstype.h:50
virtual void putScalarColumn(const void *dataPtr)
Put the vector of all scalar values in the column.
A typed column in a concatenated table.
An abstract base class for table column descriptions.
Definition: BaseColDesc.h:107
virtual void putScalarColumnCells(const RefRows &rownrs, const void *dataPtr)
Get the vector of some scalar values in a column.
virtual void makeRefSortKey(Sort &sortobj, CountedPtr< BaseCompare > &cmpObj, Int order, const Vector< uInt > &rownrs, const void *&dataSave)
Do it only for the given row numbers.
Sort on one or more keys, ascending and/or descending.
Definition: Sort.h:248
Referenced counted pointer for constant data.
Definition: VisModelData.h:42
Class holding the row numbers in a RefTable.
Definition: RefRows.h:85
virtual void fillSortKey(const Vector< T > *vecPtr, Sort &sortobj, CountedPtr< BaseCompare > &cmpObj, Int order)
virtual void getScalarColumnCells(const RefRows &rownrs, void *dataPtr) const
Get the vector of some scalar values in a column.
virtual void getScalarColumn(void *dataPtr) const
Get the vector of all scalar values in a column.
Class to view a concatenation of tables as a single table.
Definition: ConcatTable.h:118
virtual void freeSortKey(const void *&dataSave)
Free storage on the heap allocated by makeSortkey().
A column in a concatenated table.
Definition: ConcatColumn.h:91
ConcatScalarColumn(const BaseColumnDesc *, ConcatTable *)
Construct the ConcatColumn.
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42