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> class ScalarColumn;
38class String;
39
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
82
83template<class T>
84class TabVecScaCol : public TabVecRep<T>
85{
86 //# Make members of parent class known.
87protected:
88 using TabVecRep<T>::tag_p;
89 using TabVecRep<T>::nrel_p;
90
91public:
92 // Create a table vector from the given table column.
93 // This constructor is for TableVector and allows elements to be changed.
94 TabVecScaCol (const TableColumn& column);
95
96 // Destruct the object.
98
99 // Nr of elements (ie. #rows in table).
100 rownr_t nelem() const;
101
102 // Get a value.
103 T value (rownr_t index) const;
104
105 // Get a value.
106 void getVal (rownr_t index, T&) const;
107
108 // Put a value.
109 void putVal (rownr_t index, const T&);
110
111 // Set entire vector to a value.
112 void set (const T&);
113
114protected:
116};
117
118
119
120} //# NAMESPACE CASACORE - END
121
122#ifndef CASACORE_NO_AUTO_TEMPLATES
123#include <casacore/tables/Tables/TVecScaCol.tcc>
124#endif //# CASACORE_NO_AUTO_TEMPLATES
125#endif
Templated base class for table vectors.
Definition TVec.h:106
TabVecTag tag_p
Definition TVec.h:158
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:115
~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.
this file contains all the compiler specific defines
Definition mainpage.dox:28
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44