casacore
Loading...
Searching...
No Matches
TVecScaCol.h
Go to the documentation of this file.
1// # TVecScaCol.h: Templated table scalar column vectors
2// # Copyright (C) 1994,1995,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_TVECSCACOL_H
27#define TABLES_TVECSCACOL_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/tables/Tables/TVec.h>
32
33namespace casacore { // # NAMESPACE CASACORE - BEGIN
34
35// # Forward Declarations
36class TableColumn;
37template <class T>
38class ScalarColumn;
39class String;
40
41// <summary>
42// Templated table scalar column vectors
43// </summary>
44
45// <use visibility=local>
46
47// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
48// </reviewed>
49
50// <prerequisite>
51// # Classes you should understand before using this one.
52// <li> TabVecRep
53// </prerequisite>
54
55// <etymology>
56// TabVecScaCol is the class dealing with a table vector representing
57// a column of scalars in a table.
58// </etymology>
59
60// <synopsis>
61// TabVecScaCol objects are a view on a column of scalars in a table.
62// The semantics of these table vectors are the same as the normal
63// vectors. So for example, changing an element in the table vector
64// means changing the corresponding field in the underlying table.
65// </synopsis>
66
67// <motivation>
68// TabVecScaCol is derived from TabVecRep and as such it is a letter for
69// the envelope class TableVector.
70// </motivation>
71
72// <templating arg=T>
73// <li> Default constructor
74// <li> Copy constructor
75// <li> Assignment operator
76// </templating>
77
78// <todo asof="$DATE:$">
79// # A List of bugs, limitations, extensions or planned refinements.
80// </todo>
81
82template <class T>
83class TabVecScaCol : public TabVecRep<T> {
84 // # Make members of parent class known.
85 protected:
86 using TabVecRep<T>::tag_p;
87 using TabVecRep<T>::nrel_p;
88
89 public:
90 // Create a table vector from the given table column.
91 // This constructor is for TableVector and allows elements to be changed.
92 TabVecScaCol(const TableColumn& column);
93
94 // Destruct the object.
96
97 // Nr of elements (ie. #rows in table).
98 rownr_t nelem() const;
99
100 // Get a value.
101 T value(rownr_t index) const;
102
103 // Get a value.
104 void getVal(rownr_t index, T&) const;
105
106 // Put a value.
107 void putVal(rownr_t index, const T&);
108
109 // Set entire vector to a value.
110 void set(const T&);
111
112 protected:
114};
115
116} // namespace casacore
117
118#ifndef CASACORE_NO_AUTO_TEMPLATES
119#include <casacore/tables/Tables/TVecScaCol.tcc>
120#endif // # CASACORE_NO_AUTO_TEMPLATES
121#endif
String: the storage and methods of handling collections of characters.
Definition String.h:355
TabVecTag tag_p
Definition TVec.h:152
TabVecRep()
Create empty table vector.
void putVal(rownr_t index, const T &)
Put a value.
void set(const T &)
Set entire vector to a value.
void getVal(rownr_t index, T &) const
Get a value.
ScalarColumn< T > * colPtr_p
Definition TVecScaCol.h:113
~TabVecScaCol()
Destruct the object.
rownr_t nelem() const
Nr of elements (ie.
TabVecScaCol(const TableColumn &column)
Create a table vector from the given table column.
T value(rownr_t index) const
Get a value.
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44