casacore
TableColumn.h
Go to the documentation of this file.
1 //# TableColumn.h: Access to a table column
2 //# Copyright (C) 1994,1995,1996,1997,1998,1999,2001,2002
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_TABLECOLUMN_H
29 #define TABLES_TABLECOLUMN_H
30 
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
34 #include <casacore/tables/Tables/BaseColumn.h>
35 #include <casacore/tables/Tables/BaseTable.h>
36 #include <casacore/casa/BasicSL/String.h>
37 #include <casacore/casa/Arrays/IPosition.h>
38 
39 namespace casacore { //# NAMESPACE CASACORE - BEGIN
40 
41 //# Forward Declarations
42 class Table;
43 class BaseTable;
44 
45 
46 //# Check the number of rows in debug mode.
47 #if defined(AIPS_DEBUG)
48 # define TABLECOLUMNCHECKROW(ROWNR) \
49  (checkRowNumber (ROWNR))
50 #else
51 # define TABLECOLUMNCHECKROW(ROWNR)
52 #endif
53 
54 
55 // <summary>
56 // Read/write access to a table column
57 // </summary>
58 
59 // <use visibility=export>
60 
61 // <reviewed reviewer="dschieb" date="1994/08/10" tests="none">
62 // </reviewed>
63 
64 // <prerequisite>
65 // <li> Table
66 // <li> ColumnDesc
67 // </prerequisite>
68 
69 // <synopsis>
70 // The class TableColumn gives read and write access to a column
71 // in a table. In particular access to the column description
72 // (for name, data type, etc.) and to the column keyword set
73 // can be obtained.
74 // Another important function is isDefined, which tests if a
75 // cell (i.e. table row) in a column contains a value.
76 //
77 // The classes ScalarColumn<T> and ArrayColumn<T> have to be
78 // used to get/put the data in the column cells.
79 // However, TableColumn has get functions for the basic data types
80 // (Bool, uChar, Short, uSort, Int, uInt, float, double,
81 // Complex, DComplex and String).
82 // Opposite to the get functions in ScalarColumn<T>, the
83 // TableColumn get functions support data type promotion.
84 //
85 // A default constructor is defined to allow construction of an array
86 // of TableColumn objects. However, this constructs an object not
87 // referencing a column. Functions like get, etc. will fail (i.e. result
88 // in a segmentation fault) when used on such objects. The functions
89 // isNull and throwIfNull can be used to test on this.
90 // The functions attach and reference can fill in the object.
91 // </synopsis>
92 
93 // <example>
94 // See module <linkto module="Tables#open">Tables</linkto>.
95 // </example>
96 
97 
99 {
100 friend class ForwardColumn; //# for function baseColPtr()
101 
102 public:
103 
104  // The default constructor creates a null object, i.e. it
105  // does not reference a table column.
106  // The sole purpose of this constructor is to allow construction
107  // of an array of TableColumn objects.
108  // The functions reference and attach can be used to make a null object
109  // reference a column.
110  // Note that get functions, etc. will cause a segmentation fault
111  // when operating on a null object. It was felt it was too expensive
112  // to test on null over and over again. The user should use the isNull
113  // or throwIfNull function in case of doubt.
114  TableColumn();
115 
116  // Construct the object for a column in the table using its name.
117  TableColumn (const Table&, const String& columnName);
118 
119  // Construct the object for a column in the table using its index.
120  // This allows to loop through all columns in a table as:
121  // <srcblock>
122  // for (uInt=0; i<tab.ncolumn(); i++) {
123  // TableColumn tabcol(tab,i);
124  // }
125  // </srcblock>
126  TableColumn (const Table&, uInt columnIndex);
127 
128  // Copy constructor (reference semantics).
129  TableColumn (const TableColumn&);
130 
131  virtual ~TableColumn();
132 
133  // Assignment has reference semantics.
134  // It copies the object, not the data of that column to this column.
135  // Function <src>putColumn</src> can be used to copy the data of a column.
136  // <br>It does the same as the reference function.
138 
139  // Clone the object.
140  virtual TableColumn* clone() const;
141 
142  // Change the reference to another column.
143  // This is in fact an assignment operator with reference semantics.
144  // It removes the reference to the current column and creates
145  // a reference to the column referenced in the other object.
146  // It will handle null objects correctly.
147  void reference (const TableColumn&);
148 
149  // Attach a column to the object.
150  // This is in fact only a shorthand for
151  // <<br><src> reference (TableColumn (table, columnName)); </src>
152  // <group>
153  void attach (const Table& table, const String& columnName)
154  { reference (TableColumn (table, columnName)); }
155  void attach (const Table& table, uInt columnIndex)
156  { reference (TableColumn (table, columnIndex)); }
157  // </group>
158 
159  // Test if the object is null, i.e. does not reference a column.
160  Bool isNull() const
161  { return (baseColPtr_p == 0 ? True : False); }
162 
163  // Throw an exception if the object is null, i.e.
164  // if function isNull() is True.
165  void throwIfNull() const;
166 
167  // Test if the column can be written to, thus if the column and
168  // the underlying table can be written to.
169  Bool isWritable() const
170  { return baseTabPtr_p->isWritable() && isColWritable_p; }
171 
172  // Test if the column is writable at all (virtual columns might not be).
173  // Note that keywords can always be written, even for virtual columns.
175  { return isColWritable_p; }
176 
177  // Check if the column is writable and throw an exception if not.
178  void checkWritable() const
179  { if (!isWritable()) throwNotWritable(); }
180 
181  // Get readonly access to the column keyword set.
182  const TableRecord& keywordSet() const
183  { return baseColPtr_p->keywordSet(); }
184 
185  // Get read/write access to the column keyword set.
186  // An exception is thrown if the table is not writable.
188 
189  // Get const access to the column description.
190  // ColumnDesc functions have to be used to get the data type, etc..
191  const ColumnDesc& columnDesc() const;
192 
193  // Get the Table object this column belongs to.
194  Table table() const;
195 
196  // Get the number of rows in the column.
197  uInt nrow() const
198  { return baseColPtr_p->nrow(); }
199 
200  // Can the shape of an already existing non-FixedShape array be changed?
201  // This depends on the storage manager. Most storage managers
202  // can handle it, but TiledDataStMan and TiledColumnStMan can not.
204  { return canChangeShape_p; }
205 
206  // Get the global #dimensions of an array (ie. for all cells in column).
207  // This is always set for fixed shape arrays.
208  // Otherwise, 0 will be returned.
209  uInt ndimColumn() const
210  { return baseColPtr_p->ndimColumn(); }
211 
212  // Get the global shape of an array (ie. for all cells in the column).
213  // This is always set for fixed shape arrays.
214  // Otherwise, a 0-dim shape will be returned.
216  { return baseColPtr_p->shapeColumn(); }
217 
218  // Test if the given cell contains a defined value.
219  Bool isDefined (uInt rownr) const
220  { TABLECOLUMNCHECKROW(rownr); return baseColPtr_p->isDefined (rownr); }
221 
222  // Does the column has content in the given row (default is the first row)?
223  // It has if it is defined and does not contain an empty array.
224  Bool hasContent (uInt rownr=0) const;
225 
226  // Get the #dimensions of an array in a particular cell.
227  uInt ndim (uInt rownr) const
228  { TABLECOLUMNCHECKROW(rownr); return baseColPtr_p->ndim (rownr); }
229 
230  // Get the shape of an array in a particular cell.
231  IPosition shape (uInt rownr) const
232  { TABLECOLUMNCHECKROW(rownr); return baseColPtr_p->shape (rownr); }
233 
234  // Get the tile shape of an array in a particular cell.
235  IPosition tileShape (uInt rownr) const
236  { TABLECOLUMNCHECKROW(rownr); return baseColPtr_p->tileShape (rownr); }
237 
238  // Get the value of a scalar in the given row.
239  // Data type promotion is possible.
240  // These functions only work for the standard data types.
241  // <group>
242  void getScalar (uInt rownr, Bool& value) const
243  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr, value); }
244  void getScalar (uInt rownr, uChar& value) const
245  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr, value); }
246  void getScalar (uInt rownr, Short& value) const
247  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr, value); }
248  void getScalar (uInt rownr, uShort& value) const
249  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr, value); }
250  void getScalar (uInt rownr, Int& value) const
251  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr, value); }
252  void getScalar (uInt rownr, uInt& value) const
253  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr, value); }
254  void getScalar (uInt rownr, Int64& value) const
255  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr, value); }
256  void getScalar (uInt rownr, float& value) const
257  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr, value); }
258  void getScalar (uInt rownr, double& value) const
259  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr, value); }
260  void getScalar (uInt rownr, Complex& value) const
261  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr, value); }
262  void getScalar (uInt rownr, DComplex& value) const
263  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr, value); }
264  void getScalar (uInt rownr, String& value) const
265  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr, value); }
266  // </group>
267 
268  // Get the value from the row and convert it to the required type.
269  // This can only be used for scalar columns with a standard data type.
270  // <group>
271  Bool asBool (uInt rownr) const;
272  uChar asuChar (uInt rownr) const;
273  Short asShort (uInt rownr) const;
274  uShort asuShort (uInt rownr) const;
275  Int asInt (uInt rownr) const;
276  uInt asuInt (uInt rownr) const;
277  float asfloat (uInt rownr) const;
278  double asdouble (uInt rownr) const;
279  Complex asComplex (uInt rownr) const;
280  DComplex asDComplex (uInt rownr) const;
281  String asString (uInt rownr) const;
282  // </group>
283 
284  // Get the value of a scalar in the given row.
285  // These functions work for all data types.
286  // Data type promotion is possible for the standard data types.
287  // The functions are primarily meant for ScalarColumn<T>.
288  // <group>
289  void getScalarValue (uInt rownr, Bool* value, const String&) const
290  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr,*value); }
291  void getScalarValue (uInt rownr, uChar* value, const String&) const
292  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr,*value); }
293  void getScalarValue (uInt rownr, Short* value, const String&) const
294  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr,*value); }
295  void getScalarValue (uInt rownr, uShort* value, const String&) const
296  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr,*value); }
297  void getScalarValue (uInt rownr, Int* value, const String&) const
298  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr,*value); }
299  void getScalarValue (uInt rownr, uInt* value, const String&) const
300  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr,*value); }
301  void getScalarValue (uInt rownr, float* value, const String&) const
302  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr,*value); }
303  void getScalarValue (uInt rownr, double* value, const String&) const
304  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr,*value); }
305  void getScalarValue (uInt rownr, Complex* value, const String&) const
306  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr,*value); }
307  void getScalarValue (uInt rownr, DComplex* value, const String&) const
308  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr,*value); }
309  void getScalarValue (uInt rownr, String* value, const String&) const
310  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr,*value); }
311  void getScalarValue (uInt rownr, void* value,
312  const String& dataTypeId) const
313  { TABLECOLUMNCHECKROW(rownr);
314  baseColPtr_p->getScalar (rownr,value,dataTypeId); }
315  // </group>
316 
317  // Copy the value of a cell of that column to a cell of this column.
318  // This function only works for the standard data types.
319  // Data type promotion will be done if needed.
320  // An exception is thrown if this column is not writable or if
321  // the data cannot be converted.
322  // <group>
323  // Use the same row numbers for both cells.
324  void put (uInt rownr, const TableColumn& that,
325  Bool preserveTileShape=False)
326  { put (rownr, that, rownr, preserveTileShape); }
327  // Use possibly different row numbers for that (i.e. input) and
328  // and this (i.e. output) cell.
329  virtual void put (uInt thisRownr, const TableColumn& that,
330  uInt thatRownr, Bool preserveTileShape=False);
331  // </group>
332 
333  // Copy the values of that column to this column.
334  // The numbers of rows in both columns must be equal.
335  // Data type promotion is possible.
336  // An exception is thrown if the data cannot be converted.
337  // This function is useful to copy one column to another without
338  // knowing their data types.
339  // In fact, this function is an assignment operator with copy semantics.
340  void putColumn (const TableColumn& that);
341 
342  // Put the value of a scalar in the given row.
343  // Data type promotion is possible.
344  // These functions only work for the standard data types.
345  // <group>
346  void putScalar (uInt rownr, const Bool& value)
347  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->putScalar (rownr, value); }
348  void putScalar (uInt rownr, const uChar& value)
349  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->putScalar (rownr, value); }
350  void putScalar (uInt rownr, const Short& value)
351  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->putScalar (rownr, value); }
352  void putScalar (uInt rownr, const uShort& value)
353  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->putScalar (rownr, value); }
354  void putScalar (uInt rownr, const Int& value)
355  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->putScalar (rownr, value); }
356  void putScalar (uInt rownr, const uInt& value)
357  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->putScalar (rownr, value); }
358  void putScalar (uInt rownr, const float& value)
359  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->putScalar (rownr, value); }
360  void putScalar (uInt rownr, const double& value)
361  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->putScalar (rownr, value); }
362  void putScalar (uInt rownr, const Complex& value)
363  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->putScalar (rownr, value); }
364  void putScalar (uInt rownr, const DComplex& value)
365  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->putScalar (rownr, value); }
366  void putScalar (uInt rownr, const String& value)
367  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->putScalar (rownr, value); }
368  void putScalar (uInt rownr, const Char* value)
369  { putScalar (rownr, String(value)); }
370  // </group>
371 
372  // Check if the row number is valid.
373  // It throws an exception if out of range.
374  void checkRowNumber (uInt rownr) const
375  { baseTabPtr_p->checkRowNumber (rownr); }
376 
377  // Set the maximum cache size (in bytes) to be used by a storage manager.
378  void setMaximumCacheSize (uInt nbytes) const
379  { baseColPtr_p->setMaximumCacheSize (nbytes); }
380 
381 protected:
383  BaseColumn* baseColPtr_p; //# pointer to real column object
386  Bool isColWritable_p; //# is the column writable at all?
387 
388 
389  // Get the baseColPtr_p of this TableColumn object.
391  { return baseColPtr_p; }
392 
393  // Get the baseColPtr_p of another TableColumn object.
394  // This is needed for function put, because baseColPtr_p is a
395  // protected member of TableColumn. Another TableColumn has
396  // no access to that.
397  BaseColumn* baseColPtr (const TableColumn& that) const
398  { return that.baseColPtr_p; }
399 
400 private:
401  // Throw the exception that the column is not writable.
402  void throwNotWritable() const;
403 };
404 
405 
406 // Define ROTableColumn for backward compatibility.
408 
409 
410 } //# NAMESPACE CASACORE - END
411 
412 #endif
A Vector of integers, for indexing into Array<T> objects.
Definition: IPosition.h:119
BaseColumn * baseColPtr() const
Get the baseColPtr_p of this TableColumn object.
Definition: TableColumn.h:390
void putScalar(uInt rownr, const double &value)
Definition: TableColumn.h:360
TableColumn ROTableColumn
Define ROTableColumn for backward compatibility.
Definition: TableColumn.h:407
void getScalar(uInt rownr, Bool &value) const
Get the value of a scalar in the given row.
Definition: TableColumn.h:242
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
Definition: aipsxtype.h:38
void checkRowNumber(uInt rownr) const
Check if the row number is valid.
Definition: TableColumn.h:374
int Int
Definition: aipstype.h:50
double asdouble(uInt rownr) const
#define TABLECOLUMNCHECKROW(ROWNR)
Definition: TableColumn.h:51
void attach(const Table &table, const String &columnName)
Attach a column to the object.
Definition: TableColumn.h:153
void getScalarValue(uInt rownr, Complex *value, const String &) const
Definition: TableColumn.h:305
virtual uInt nrow() const =0
Get nr of rows in the column.
void put(uInt rownr, const TableColumn &that, Bool preserveTileShape=False)
Copy the value of a cell of that column to a cell of this column.
Definition: TableColumn.h:324
Bool hasContent(uInt rownr=0) const
Does the column has content in the given row (default is the first row)? It has if it is defined and ...
void getScalarValue(uInt rownr, Int *value, const String &) const
Definition: TableColumn.h:297
void setMaximumCacheSize(uInt nbytes) const
Set the maximum cache size (in bytes) to be used by a storage manager.
Definition: TableColumn.h:378
void getScalar(uInt rownr, Complex &value) const
Definition: TableColumn.h:260
virtual TableRecord & keywordSet()=0
Main interface class to a read/write table.
Definition: Table.h:153
void putScalar(uInt rownr, const DComplex &value)
Definition: TableColumn.h:364
uShort asuShort(uInt rownr) const
void putScalar(uInt rownr, const Complex &value)
Definition: TableColumn.h:362
virtual IPosition tileShape(uInt rownr) const
Get the tile shape of an array in a particular cell.
uInt ndim(uInt rownr) const
Get the #dimensions of an array in a particular cell.
Definition: TableColumn.h:227
void putScalar(uInt rownr, const uShort &value)
Definition: TableColumn.h:352
Envelope class for the description of a table column.
Definition: ColumnDesc.h:131
unsigned char uChar
Definition: aipstype.h:47
void getScalar(uInt rownr, Int &value) const
Definition: TableColumn.h:250
void getScalarValue(uInt rownr, double *value, const String &) const
Definition: TableColumn.h:303
void checkRowNumber(uInt rownr) const
Check if the row number is valid.
Definition: BaseTable.h:482
void putScalar(uInt rownr, const Char *value)
Definition: TableColumn.h:368
const TableRecord & keywordSet() const
Get readonly access to the column keyword set.
Definition: TableColumn.h:182
char Char
Definition: aipstype.h:46
void getScalarValue(uInt rownr, DComplex *value, const String &) const
Definition: TableColumn.h:307
IPosition tileShape(uInt rownr) const
Get the tile shape of an array in a particular cell.
Definition: TableColumn.h:235
TableColumn()
The default constructor creates a null object, i.e.
Bool isDefined(uInt rownr) const
Test if the given cell contains a defined value.
Definition: TableColumn.h:219
void getScalar(uInt rownr, Bool &value) const
Get the value from the row and convert it to the required type.
void getScalarValue(uInt rownr, Short *value, const String &) const
Definition: TableColumn.h:293
BaseColumn * baseColPtr_p
Definition: TableColumn.h:383
void putScalar(uInt rownr, const float &value)
Definition: TableColumn.h:358
void getScalar(uInt rownr, float &value) const
Definition: TableColumn.h:256
virtual IPosition shapeColumn() const
Get the global shape of an array (ie.
uInt asuInt(uInt rownr) const
short Short
Definition: aipstype.h:48
Bool asBool(uInt rownr) const
Get the value from the row and convert it to the required type.
void putScalar(uInt rownr, const Int &value)
Definition: TableColumn.h:354
String asString(uInt rownr) const
virtual uInt ndimColumn() const
Get the global #dimensions of an array (ie.
virtual uInt ndim(uInt rownr) const
Get the #dimensions of an array in a particular cell.
void putScalar(uInt rownr, const String &value)
Definition: TableColumn.h:366
void getScalarValue(uInt rownr, uShort *value, const String &) const
Definition: TableColumn.h:295
Short asShort(uInt rownr) const
Bool canChangeShape() const
Can the shape of an already existing non-FixedShape array be changed? This depends on the storage man...
Definition: TableColumn.h:203
Abstract base class for tables.
Definition: BaseTable.h:103
Int asInt(uInt rownr) const
DComplex asDComplex(uInt rownr) const
IPosition shapeColumn() const
Get the global shape of an array (ie.
Definition: TableColumn.h:215
const ColumnDesc & columnDesc() const
Get const access to the column description.
void putColumn(const TableColumn &that)
Copy the values of that column to this column.
IPosition shape(uInt rownr) const
Get the shape of an array in a particular cell.
Definition: TableColumn.h:231
Table table() const
Get the Table object this column belongs to.
void checkWritable() const
Check if the column is writable and throw an exception if not.
Definition: TableColumn.h:178
void getScalar(uInt rownr, Int64 &value) const
Definition: TableColumn.h:254
void throwNotWritable() const
Throw the exception that the column is not writable.
void putScalar(uInt rownr, const Bool &value)
Put the value of a scalar in the given row.
Definition: TableColumn.h:346
const ColumnCache * colCachePtr_p
Definition: TableColumn.h:384
Virtual column forwarding to another column.
Definition: ForwardCol.h:91
uInt nrow() const
Get the number of rows in the column.
Definition: TableColumn.h:197
void getScalarValue(uInt rownr, float *value, const String &) const
Definition: TableColumn.h:301
virtual void setMaximumCacheSize(uInt nbytes)=0
Set the maximum cache size (in bytes) to be used by a storage manager.
BaseColumn * baseColPtr(const TableColumn &that) const
Get the baseColPtr_p of another TableColumn object.
Definition: TableColumn.h:397
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
virtual Bool isWritable() const =0
Test if this table is writable.
void putScalar(uInt rownr, const uInt &value)
Definition: TableColumn.h:356
BaseTable * baseTabPtr_p
Definition: TableColumn.h:382
A caching object for a table column.
Definition: ColumnCache.h:83
uChar asuChar(uInt rownr) const
Read/write access to a table column.
Definition: TableColumn.h:98
Bool isWritable() const
Test if the column can be written to, thus if the column and the underlying table can be written to...
Definition: TableColumn.h:169
const Bool False
Definition: aipstype.h:44
void putScalar(uInt rownr, const Bool &value)
Put the value into the row and convert it from the given type.
A hierarchical collection of named fields of various types.
Definition: TableRecord.h:182
void getScalar(uInt rownr, String &value) const
Definition: TableColumn.h:264
TableRecord & rwKeywordSet()
Get read/write access to the column keyword set.
void putScalar(uInt rownr, const uChar &value)
Definition: TableColumn.h:348
void getScalarValue(uInt rownr, void *value, const String &dataTypeId) const
Definition: TableColumn.h:311
void getScalar(uInt rownr, DComplex &value) const
Definition: TableColumn.h:262
void getScalarValue(uInt rownr, uChar *value, const String &) const
Definition: TableColumn.h:291
void getScalar(uInt rownr, uInt &value) const
Definition: TableColumn.h:252
Bool isWritableAtAll() const
Test if the column is writable at all (virtual columns might not be).
Definition: TableColumn.h:174
String: the storage and methods of handling collections of characters.
Definition: String.h:223
void attach(const Table &table, uInt columnIndex)
Definition: TableColumn.h:155
void getScalar(uInt rownr, Short &value) const
Definition: TableColumn.h:246
uInt ndimColumn() const
Get the global #dimensions of an array (ie.
Definition: TableColumn.h:209
void getScalar(uInt rownr, uShort &value) const
Definition: TableColumn.h:248
virtual Bool isDefined(uInt rownr) const =0
Test if the given cell contains a defined value.
void getScalarValue(uInt rownr, Bool *value, const String &) const
Get the value of a scalar in the given row.
Definition: TableColumn.h:289
virtual IPosition shape(uInt rownr) const
Get the shape of an array in a particular cell.
void getScalar(uInt rownr, uChar &value) const
Definition: TableColumn.h:244
virtual TableColumn * clone() const
Clone the object.
TableColumn & operator=(const TableColumn &)
Assignment has reference semantics.
void putScalar(uInt rownr, const Short &value)
Definition: TableColumn.h:350
Bool isNull() const
Test if the object is null, i.e.
Definition: TableColumn.h:160
const Bool True
Definition: aipstype.h:43
void getScalarValue(uInt rownr, uInt *value, const String &) const
Definition: TableColumn.h:299
void throwIfNull() const
Throw an exception if the object is null, i.e.
this file contains all the compiler specific defines
Definition: mainpage.dox:28
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
void reference(const TableColumn &)
Change the reference to another column.
unsigned int uInt
Definition: aipstype.h:51
void getScalarValue(uInt rownr, String *value, const String &) const
Definition: TableColumn.h:309
float asfloat(uInt rownr) const
unsigned short uShort
Definition: aipstype.h:49
void getScalar(uInt rownr, double &value) const
Definition: TableColumn.h:258
Complex asComplex(uInt rownr) const
Abstract base class for a table column.
Definition: BaseColumn.h:98