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, Int64, 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.
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).
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  rownr_t 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 (rownr_t 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 (rownr_t rownr=0) const;
225 
226  // Get the #dimensions of an array in a particular cell.
227  uInt ndim (rownr_t 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 (rownr_t rownr) const
232  { TABLECOLUMNCHECKROW(rownr); return baseColPtr_p->shape (rownr); }
233 
234  // Get the tile shape of an array in a particular cell.
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 (rownr_t rownr, Bool& value) const
243  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr, value); }
244  void getScalar (rownr_t rownr, uChar& value) const
245  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr, value); }
246  void getScalar (rownr_t rownr, Short& value) const
247  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr, value); }
248  void getScalar (rownr_t rownr, uShort& value) const
249  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr, value); }
250  void getScalar (rownr_t rownr, Int& value) const
251  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr, value); }
252  void getScalar (rownr_t rownr, uInt& value) const
253  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr, value); }
254  void getScalar (rownr_t rownr, Int64& value) const
255  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr, value); }
256  void getScalar (rownr_t rownr, float& value) const
257  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr, value); }
258  void getScalar (rownr_t rownr, double& value) const
259  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr, value); }
260  void getScalar (rownr_t rownr, Complex& value) const
261  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr, value); }
262  void getScalar (rownr_t rownr, DComplex& value) const
263  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr, value); }
264  void getScalar (rownr_t 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 (rownr_t rownr) const;
272  uChar asuChar (rownr_t rownr) const;
273  Short asShort (rownr_t rownr) const;
274  uShort asuShort (rownr_t rownr) const;
275  Int asInt (rownr_t rownr) const;
276  uInt asuInt (rownr_t rownr) const;
277  Int64 asInt64 (rownr_t rownr) const;
278  float asfloat (rownr_t rownr) const;
279  double asdouble (rownr_t rownr) const;
280  Complex asComplex (rownr_t rownr) const;
281  DComplex asDComplex (rownr_t rownr) const;
282  String asString (rownr_t rownr) const;
283  // </group>
284 
285  // Get the value of a scalar in the given row.
286  // These functions work for all data types.
287  // Data type promotion is possible for the standard data types.
288  // The functions are primarily meant for ScalarColumn<T>.
289  // <group>
290  void getScalarValue (rownr_t rownr, Bool* value, const String&) const
291  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr,*value); }
292  void getScalarValue (rownr_t rownr, uChar* value, const String&) const
293  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr,*value); }
294  void getScalarValue (rownr_t rownr, Short* value, const String&) const
295  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr,*value); }
296  void getScalarValue (rownr_t rownr, uShort* value, const String&) const
297  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr,*value); }
298  void getScalarValue (rownr_t rownr, Int* value, const String&) const
299  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr,*value); }
300  void getScalarValue (rownr_t rownr, uInt* value, const String&) const
301  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr,*value); }
302  void getScalarValue (rownr_t rownr, Int64* value, const String&) const
303  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr,*value); }
304  void getScalarValue (rownr_t rownr, float* value, const String&) const
305  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr,*value); }
306  void getScalarValue (rownr_t rownr, double* value, const String&) const
307  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr,*value); }
308  void getScalarValue (rownr_t rownr, Complex* value, const String&) const
309  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr,*value); }
310  void getScalarValue (rownr_t rownr, DComplex* value, const String&) const
311  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr,*value); }
312  void getScalarValue (rownr_t rownr, String* value, const String&) const
313  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->getScalar (rownr,*value); }
314  void getScalarValue (rownr_t rownr, void* value,
315  const String& dataTypeId) const
316  { TABLECOLUMNCHECKROW(rownr);
317  baseColPtr_p->getScalar (rownr,value,dataTypeId); }
318  // </group>
319 
320  // Copy the value of a cell of that column to a cell of this column.
321  // This function only works for the standard data types.
322  // Data type promotion will be done if needed.
323  // An exception is thrown if this column is not writable or if
324  // the data cannot be converted.
325  // <group>
326  // Use the same row numbers for both cells.
327  void put (rownr_t rownr, const TableColumn& that,
328  Bool preserveTileShape=False)
329  { put (rownr, that, rownr, preserveTileShape); }
330  // Use possibly different row numbers for that (i.e. input) and
331  // and this (i.e. output) cell.
332  virtual void put (rownr_t thisRownr, const TableColumn& that,
333  rownr_t thatRownr, Bool preserveTileShape=False);
334  // </group>
335 
336  // Copy the values of that column to this column.
337  // The numbers of rows in both columns must be equal.
338  // Data type promotion is possible.
339  // An exception is thrown if the data cannot be converted.
340  // This function is useful to copy one column to another without
341  // knowing their data types.
342  // In fact, this function is an assignment operator with copy semantics.
343  void putColumn (const TableColumn& that);
344 
345  // Put the value of a scalar in the given row.
346  // Data type promotion is possible.
347  // These functions only work for the standard data types.
348  // <group>
349  void putScalar (rownr_t rownr, const Bool& value)
350  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->putScalar (rownr, value); }
351  void putScalar (rownr_t rownr, const uChar& value)
352  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->putScalar (rownr, value); }
353  void putScalar (rownr_t rownr, const Short& value)
354  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->putScalar (rownr, value); }
355  void putScalar (rownr_t rownr, const uShort& value)
356  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->putScalar (rownr, value); }
357  void putScalar (rownr_t rownr, const Int& value)
358  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->putScalar (rownr, value); }
359  void putScalar (rownr_t rownr, const uInt& value)
360  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->putScalar (rownr, value); }
361  void putScalar (rownr_t rownr, const Int64& value)
362  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->putScalar (rownr, value); }
363  void putScalar (rownr_t rownr, const float& value)
364  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->putScalar (rownr, value); }
365  void putScalar (rownr_t rownr, const double& value)
366  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->putScalar (rownr, value); }
367  void putScalar (rownr_t rownr, const Complex& value)
368  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->putScalar (rownr, value); }
369  void putScalar (rownr_t rownr, const DComplex& value)
370  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->putScalar (rownr, value); }
371  void putScalar (rownr_t rownr, const String& value)
372  { TABLECOLUMNCHECKROW(rownr); baseColPtr_p->putScalar (rownr, value); }
373  void putScalar (rownr_t rownr, const Char* value)
374  { putScalar (rownr, String(value)); }
375  // </group>
376 
377  // Check if the row number is valid.
378  // It throws an exception if out of range.
379  void checkRowNumber (rownr_t rownr) const
380  { baseTabPtr_p->checkRowNumber (rownr); }
381 
382  // Set the maximum cache size (in bytes) to be used by a storage manager.
383  void setMaximumCacheSize (uInt nbytes) const
384  { baseColPtr_p->setMaximumCacheSize (nbytes); }
385 
386 protected:
388  BaseColumn* baseColPtr_p; //# pointer to real column object
391  Bool isColWritable_p; //# is the column writable at all?
392 
393 
394  // Get the baseColPtr_p of this TableColumn object.
396  { return baseColPtr_p; }
397 
398  // Get the baseColPtr_p of another TableColumn object.
399  // This is needed for function put, because baseColPtr_p is a
400  // protected member of TableColumn. Another TableColumn has
401  // no access to that.
402  BaseColumn* baseColPtr (const TableColumn& that) const
403  { return that.baseColPtr_p; }
404 
405 private:
406  // Throw the exception that the column is not writable.
407  void throwNotWritable() const;
408 };
409 
410 
411 // Define ROTableColumn for backward compatibility.
413 
414 
415 } //# NAMESPACE CASACORE - END
416 
417 #endif
#define TABLECOLUMNCHECKROW(ROWNR)
Definition: TableColumn.h:51
virtual IPosition tileShape(rownr_t rownr) const
Get the tile shape of an array in a particular cell.
virtual rownr_t nrow() const =0
Get nr of rows in the column.
virtual TableRecord & keywordSet()=0
virtual void setMaximumCacheSize(uInt nbytes)=0
Set the maximum cache size (in bytes) to be used by a storage manager.
void getScalar(rownr_t rownr, Bool &value) const
Get the value from the row and convert it to the required type.
virtual Bool isDefined(rownr_t rownr) const =0
Test if the given cell contains a defined value.
virtual uInt ndim(rownr_t rownr) const
Get the #dimensions of an array in a particular cell.
virtual IPosition shapeColumn() const
Get the global shape of an array (ie.
virtual IPosition shape(rownr_t rownr) const
Get the shape of an array in a particular cell.
virtual uInt ndimColumn() const
Get the global #dimensions of an array (ie.
void putScalar(rownr_t rownr, const Bool &value)
Put the value into the row and convert it from the given type.
virtual Bool isWritable() const =0
Test if this table is writable.
void checkRowNumber(rownr_t rownr) const
Check if the row number is valid.
Definition: BaseTable.h:488
String: the storage and methods of handling collections of characters.
Definition: String.h:225
void getScalar(rownr_t rownr, uShort &value) const
Definition: TableColumn.h:248
void putScalar(rownr_t rownr, const Complex &value)
Definition: TableColumn.h:367
void getScalar(rownr_t rownr, Int &value) const
Definition: TableColumn.h:250
void getScalarValue(rownr_t rownr, void *value, const String &dataTypeId) const
Definition: TableColumn.h:314
void putColumn(const TableColumn &that)
Copy the values of that column to this column.
void putScalar(rownr_t rownr, const Int &value)
Definition: TableColumn.h:357
uShort asuShort(rownr_t rownr) const
void getScalarValue(rownr_t rownr, Int64 *value, const String &) const
Definition: TableColumn.h:302
Int64 asInt64(rownr_t rownr) const
virtual void put(rownr_t thisRownr, const TableColumn &that, rownr_t thatRownr, Bool preserveTileShape=False)
Use possibly different row numbers for that (i.e.
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
void getScalar(rownr_t rownr, uInt &value) const
Definition: TableColumn.h:252
TableColumn(const Table &, uInt columnIndex)
Construct the object for a column in the table using its index.
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
BaseTable * baseTabPtr_p
Definition: TableColumn.h:387
Bool hasContent(rownr_t 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 checkRowNumber(rownr_t rownr) const
Check if the row number is valid.
Definition: TableColumn.h:379
const ColumnCache * colCachePtr_p
Definition: TableColumn.h:389
void attach(const Table &table, const String &columnName)
Attach a column to the object.
Definition: TableColumn.h:153
Complex asComplex(rownr_t rownr) const
void getScalar(rownr_t rownr, DComplex &value) const
Definition: TableColumn.h:262
void putScalar(rownr_t rownr, const Char *value)
Definition: TableColumn.h:373
void setMaximumCacheSize(uInt nbytes) const
Set the maximum cache size (in bytes) to be used by a storage manager.
Definition: TableColumn.h:383
TableColumn()
The default constructor creates a null object, i.e.
void getScalarValue(rownr_t rownr, Bool *value, const String &) const
Get the value of a scalar in the given row.
Definition: TableColumn.h:290
String asString(rownr_t rownr) const
void reference(const TableColumn &)
Change the reference to another column.
Bool isNull() const
Test if the object is null, i.e.
Definition: TableColumn.h:160
void putScalar(rownr_t rownr, const Int64 &value)
Definition: TableColumn.h:361
void putScalar(rownr_t rownr, const Bool &value)
Put the value of a scalar in the given row.
Definition: TableColumn.h:349
BaseColumn * baseColPtr() const
Get the baseColPtr_p of this TableColumn object.
Definition: TableColumn.h:395
void getScalarValue(rownr_t rownr, Short *value, const String &) const
Definition: TableColumn.h:294
void putScalar(rownr_t rownr, const float &value)
Definition: TableColumn.h:363
void putScalar(rownr_t rownr, const uChar &value)
Definition: TableColumn.h:351
uInt ndim(rownr_t rownr) const
Get the #dimensions of an array in a particular cell.
Definition: TableColumn.h:227
Bool isWritableAtAll() const
Test if the column is writable at all (virtual columns might not be).
Definition: TableColumn.h:174
void getScalarValue(rownr_t rownr, uInt *value, const String &) const
Definition: TableColumn.h:300
void getScalar(rownr_t rownr, Bool &value) const
Get the value of a scalar in the given row.
Definition: TableColumn.h:242
Bool isDefined(rownr_t rownr) const
Test if the given cell contains a defined value.
Definition: TableColumn.h:219
IPosition shapeColumn() const
Get the global shape of an array (ie.
Definition: TableColumn.h:215
TableRecord & rwKeywordSet()
Get read/write access to the column keyword set.
void putScalar(rownr_t rownr, const double &value)
Definition: TableColumn.h:365
void getScalar(rownr_t rownr, Int64 &value) const
Definition: TableColumn.h:254
void getScalarValue(rownr_t rownr, DComplex *value, const String &) const
Definition: TableColumn.h:310
const TableRecord & keywordSet() const
Get readonly access to the column keyword set.
Definition: TableColumn.h:182
void getScalar(rownr_t rownr, float &value) const
Definition: TableColumn.h:256
void getScalar(rownr_t rownr, uChar &value) const
Definition: TableColumn.h:244
void attach(const Table &table, uInt columnIndex)
Definition: TableColumn.h:155
BaseColumn * baseColPtr(const TableColumn &that) const
Get the baseColPtr_p of another TableColumn object.
Definition: TableColumn.h:402
double asdouble(rownr_t rownr) const
void putScalar(rownr_t rownr, const DComplex &value)
Definition: TableColumn.h:369
DComplex asDComplex(rownr_t rownr) const
const ColumnDesc & columnDesc() const
Get const access to the column description.
void putScalar(rownr_t rownr, const uInt &value)
Definition: TableColumn.h:359
void checkWritable() const
Check if the column is writable and throw an exception if not.
Definition: TableColumn.h:178
void getScalarValue(rownr_t rownr, Complex *value, const String &) const
Definition: TableColumn.h:308
void getScalarValue(rownr_t rownr, uShort *value, const String &) const
Definition: TableColumn.h:296
IPosition tileShape(rownr_t rownr) const
Get the tile shape of an array in a particular cell.
Definition: TableColumn.h:235
virtual TableColumn * clone() const
Clone the object.
void putScalar(rownr_t rownr, const Short &value)
Definition: TableColumn.h:353
BaseColumn * baseColPtr_p
Definition: TableColumn.h:388
void getScalarValue(rownr_t rownr, double *value, const String &) const
Definition: TableColumn.h:306
float asfloat(rownr_t rownr) const
void getScalar(rownr_t rownr, String &value) const
Definition: TableColumn.h:264
Short asShort(rownr_t rownr) const
void getScalarValue(rownr_t rownr, Int *value, const String &) const
Definition: TableColumn.h:298
TableColumn & operator=(const TableColumn &)
Assignment has reference semantics.
uChar asuChar(rownr_t rownr) const
void getScalar(rownr_t rownr, double &value) const
Definition: TableColumn.h:258
void throwIfNull() const
Throw an exception if the object is null, i.e.
void getScalar(rownr_t rownr, Complex &value) const
Definition: TableColumn.h:260
Table table() const
Get the Table object this column belongs to.
void getScalarValue(rownr_t rownr, uChar *value, const String &) const
Definition: TableColumn.h:292
uInt ndimColumn() const
Get the global #dimensions of an array (ie.
Definition: TableColumn.h:209
void throwNotWritable() const
Throw the exception that the column is not writable.
void getScalar(rownr_t rownr, Short &value) const
Definition: TableColumn.h:246
uInt asuInt(rownr_t rownr) const
TableColumn(const TableColumn &)
Copy constructor (reference semantics).
IPosition shape(rownr_t rownr) const
Get the shape of an array in a particular cell.
Definition: TableColumn.h:231
rownr_t nrow() const
Get the number of rows in the column.
Definition: TableColumn.h:197
Int asInt(rownr_t rownr) const
Bool asBool(rownr_t rownr) const
Get the value from the row and convert it to the required type.
TableColumn(const Table &, const String &columnName)
Construct the object for a column in the table using its name.
void getScalarValue(rownr_t rownr, float *value, const String &) const
Definition: TableColumn.h:304
void getScalarValue(rownr_t rownr, String *value, const String &) const
Definition: TableColumn.h:312
void putScalar(rownr_t rownr, const String &value)
Definition: TableColumn.h:371
void putScalar(rownr_t rownr, const uShort &value)
Definition: TableColumn.h:355
void put(rownr_t 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:327
this file contains all the compiler specific defines
Definition: mainpage.dox:28
unsigned char uChar
Definition: aipstype.h:47
const Bool False
Definition: aipstype.h:44
TableColumn ROTableColumn
Define ROTableColumn for backward compatibility.
Definition: TableColumn.h:412
short Short
Definition: aipstype.h:48
unsigned int uInt
Definition: aipstype.h:51
unsigned short uShort
Definition: aipstype.h:49
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
Definition: aipsxtype.h:38
int Int
Definition: aipstype.h:50
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
const Bool True
Definition: aipstype.h:43
uInt64 rownr_t
Define the type of a row number in a table.
Definition: aipsxtype.h:46
char Char
Definition: aipstype.h:46