casacore
ForwardCol.h
Go to the documentation of this file.
1 //# ForwardCol.h: Virtual Column Engine to forward to other columns
2 //# Copyright (C) 1995,1996,1997,2001
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_FORWARDCOL_H
29 #define TABLES_FORWARDCOL_H
30 
31 //# Includes
32 #include <casacore/casa/aips.h>
33 #include <casacore/tables/DataMan/VirtColEng.h>
34 #include <casacore/tables/DataMan/DataManager.h>
35 #include <casacore/tables/Tables/Table.h>
36 #include <casacore/tables/Tables/TableColumn.h>
37 #include <casacore/casa/Containers/Block.h>
38 #include <casacore/casa/BasicSL/String.h>
39 
40 namespace casacore { //# NAMESPACE CASACORE - BEGIN
41 
42 //# Forward Declarations
43 class ForwardColumnEngine;
44 class BaseColumn;
45 
46 
47 // <summary>
48 // Virtual column forwarding to another column
49 // </summary>
50 
51 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
52 // </reviewed>
53 
54 // <use visibility=local>
55 
56 // <prerequisite>
57 //# Classes you should understand before using this one.
58 // <li> ForwardColumnEngine
59 // <li> DataManagerColumn
60 // </prerequisite>
61 
62 // <synopsis>
63 // ForwardColumn represents a virtual column which forwards the
64 // gets and puts to a column with the same name in another table.
65 // It is, in fact, a reference to the other column.
66 // The name of the other table is stored as a keyword in the
67 // forwarding column. When there is a forwarding chain (i.e.
68 // forwarding to a forwarding column), the name of the last
69 // table in the chain is stored in the keyword. In this way, the
70 // length of the chain is kept to a minimum. Otherwise a very long
71 // chain could occur, which would slow things down.
72 //
73 // Addition and deletion of rows is allowed, but the functions addRow and
74 // removeRow do not do anything at all. They are implemented to override
75 // the default "throw exception" implementation. Because the engine
76 // allows this, it can be used in a table supporting addition and removal
77 // of rows.
78 //
79 // An object of this class is created (and deleted) by
80 // <linkto class="ForwardColumnEngine:description">ForwardColumnEngine</linkto>
81 // which creates a ForwardColumn object for each column being forwarded.
82 // </synopsis>
83 
84 // <motivation>
85 // This class will be used by the calibration software.
86 // Most columns in a measurement table will be forwarded, while
87 // a few (i.e. the data themselves) will be calculated by a dedicated
88 // calibration engine.
89 // </motivation>
90 
92 {
93 public:
94 
95  // Construct it for the given column.
97  const String& columnName,
98  int dataType,
99  const String& dataTypeId,
100  const Table& referencedTable);
101 
102  // Destructor is mandatory.
103  virtual ~ForwardColumn();
104 
105  // Define the special keyword containing the name of the original table.
106  // If the column in the referenced table contains that special keyword,
107  // it is in its turn a forwarding column. In that case the special
108  // keyword value will be copied over to shortcut the forwarding chain.
109  // The suffix is appended to the keyword name when defining it.
110  // This makes this function usable for derived classes.
111  void fillTableName (const Table& thisTable, const Table& referencedTable);
112 
113  // Initialize the object.
114  // This means binding the column to the column with the same name
115  // in the original table.
116  // It checks if the description of both columns is the same.
117  // It also determines if the column is writable.
118  virtual void prepare (const Table& thisTable);
119 
120  // Set the column to writable if its underlying table is writable.
121  void setRW();
122 
123 protected:
124  // Do the preparation of the base class column object.
125  void basePrepare (const Table& thisTable, Bool writable);
126 
128  { return colPtr_p; }
129 
130 private:
131  // Copy constructor is not needed and therefore forbidden
132  // (so make it private).
133  ForwardColumn (const ForwardColumn&);
134 
135  // Assignment is not needed and therefore forbidden (so make it private).
137 
138  // Create a SetupNewTable object with the given name and option
139  // and with the description from the given table.
140  // The SetupNewTable object will use a single ForwardColumn
141  // engine which forwards all columns to the given table.
142  // Later the SetupNewTable::bind functions can be used to bind one
143  // or more columns to another data manager.
144  static SetupNewTable setupNewTable (const Table& table,
145  const String& tableName,
146  Table::TableOption option);
147 
148  // This data manager may be able to handle changing array shapes.
149  Bool canChangeShape() const;
150 
151  // This data manager may be able to do get/putScalarColumn.
152  Bool canAccessScalarColumn (Bool& reask) const;
153 
154  // This data manager may be able to do get/putArrayColumn.
155  Bool canAccessArrayColumn (Bool& reask) const;
156 
157  // This data manager may be able to do get/putSlice.
158  Bool canAccessSlice (Bool& reask) const;
159 
160  // This data manager may be able to do get/putColumnSlice.
161  Bool canAccessColumnSlice (Bool& reask) const;
162 
163  // Get the data type of the column as defined in DataType.h.
164  int dataType() const;
165 
166  // Get the data type id of the column for dataType==TpOther.
167  // This function is required for virtual column engines handling
168  // non-standard data types. It is used to check the data type.
169  String dataTypeId() const;
170 
171  // Test if data can be put into this column.
172  Bool isWritable() const;
173 
174  // Set the shape of an direct array.
175  // This only checks if the shape matches the referenced column.
176  void setShapeColumn (const IPosition& shape);
177 
178  // Set the shape of an (indirect) array in the given row.
179  void setShape (uInt rownr, const IPosition& shape);
180 
181  // Is the value shape defined in the given row?
182  Bool isShapeDefined (uInt rownr);
183 
184  // Get the dimensionality of the item in the given row.
185  uInt ndim (uInt rownr);
186 
187  // Get the shape of the item in the given row.
188  IPosition shape (uInt rownr);
189 
190  // Get the scalar value with a standard data type in the given row.
191  // <group>
192  void getBoolV (uInt rownr, Bool* dataPtr);
193  void getuCharV (uInt rownr, uChar* dataPtr);
194  void getShortV (uInt rownr, Short* dataPtr);
195  void getuShortV (uInt rownr, uShort* dataPtr);
196  void getIntV (uInt rownr, Int* dataPtr);
197  void getuIntV (uInt rownr, uInt* dataPtr);
198  void getfloatV (uInt rownr, float* dataPtr);
199  void getdoubleV (uInt rownr, double* dataPtr);
200  void getComplexV (uInt rownr, Complex* dataPtr);
201  void getDComplexV (uInt rownr, DComplex* dataPtr);
202  void getStringV (uInt rownr, String* dataPtr);
203  // </group>
204 
205  // Get the scalar value with a non-standard data type in the given row.
206  void getOtherV (uInt rownr, void* dataPtr);
207 
208  // Put the scalar value with a standard data type into the given row.
209  // <group>
210  void putBoolV (uInt rownr, const Bool* dataPtr);
211  void putuCharV (uInt rownr, const uChar* dataPtr);
212  void putShortV (uInt rownr, const Short* dataPtr);
213  void putuShortV (uInt rownr, const uShort* dataPtr);
214  void putIntV (uInt rownr, const Int* dataPtr);
215  void putuIntV (uInt rownr, const uInt* dataPtr);
216  void putfloatV (uInt rownr, const float* dataPtr);
217  void putdoubleV (uInt rownr, const double* dataPtr);
218  void putComplexV (uInt rownr, const Complex* dataPtr);
219  void putDComplexV (uInt rownr, const DComplex* dataPtr);
220  void putStringV (uInt rownr, const String* dataPtr);
221  // </group>
222 
223  // Put the scalar value with a non-standard data type into the given row.
224  void putOtherV (uInt rownr, const void* dataPtr);
225 
226  // Get all scalar values in the column.
227  // The argument dataPtr is in fact a Vector<T>*, but a void*
228  // is needed to be generic.
229  // The vector pointed to by dataPtr has to have the correct length
230  // (which is guaranteed by the ScalarColumn getColumn function).
231  void getScalarColumnV (void* dataPtr);
232 
233  // Put all scalar values in the column.
234  // The argument dataPtr is in fact a const Vector<T>*, but a const void*
235  // is needed to be generic.
236  // The vector pointed to by dataPtr has to have the correct length
237  // (which is guaranteed by the ScalarColumn putColumn function).
238  void putScalarColumnV (const void* dataPtr);
239 
240  // Get some scalar values in the column.
241  // The argument dataPtr is in fact a Vector<T>*, but a void*
242  // is needed to be generic.
243  // The vector pointed to by dataPtr has to have the correct length
244  // (which is guaranteed by the ScalarColumn getColumn function).
245  virtual void getScalarColumnCellsV (const RefRows& rownrs,
246  void* dataPtr);
247 
248  // Put some scalar values in the column.
249  // The argument dataPtr is in fact a const Vector<T>*, but a const void*
250  // is needed to be generic.
251  // The vector pointed to by dataPtr has to have the correct length
252  // (which is guaranteed by the ScalarColumn getColumn function).
253  virtual void putScalarColumnCellsV (const RefRows& rownrs,
254  const void* dataPtr);
255 
256  // Get the array value in the given row.
257  // The argument dataPtr is in fact a Array<T>*, but a void*
258  // is needed to be generic.
259  // The array pointed to by dataPtr has to have the correct shape
260  // (which is guaranteed by the ArrayColumn get function).
261  void getArrayV (uInt rownr, void* dataPtr);
262 
263  // Put the array value into the given row.
264  // The argument dataPtr is in fact a const Array<T>*, but a const void*
265  // is needed to be generic.
266  // The array pointed to by dataPtr has to have the correct shape
267  // (which is guaranteed by the ArrayColumn put function).
268  void putArrayV (uInt rownr, const void* dataPtr);
269 
270  // Get a section of the array in the given row.
271  // The argument dataPtr is in fact a Array<T>*, but a void*
272  // is needed to be generic.
273  // The array pointed to by dataPtr has to have the correct shape
274  // (which is guaranteed by the ArrayColumn getSlice function).
275  void getSliceV (uInt rownr, const Slicer& slicer, void* dataPtr);
276 
277  // Put into a section of the array in the given row.
278  // The argument dataPtr is in fact a const Array<T>*, but a const void*
279  // is needed to be generic.
280  // The array pointed to by dataPtr has to have the correct shape
281  // (which is guaranteed by the ArrayColumn putSlice function).
282  void putSliceV (uInt rownr, const Slicer& slicer, const void* dataPtr);
283 
284  // Get all scalar values in the column.
285  // The argument dataPtr is in fact a Vector<T>*, but a void*
286  // is needed to be generic.
287  // The vector pointed to by dataPtr has to have the correct length
288  // (which is guaranteed by the ScalarColumn getColumn function).
289  void getArrayColumnV (void* dataPtr);
290 
291  // Put all scalar values in the column.
292  // The argument dataPtr is in fact a const Vector<T>*, but a const void*
293  // is needed to be generic.
294  // The vector pointed to by dataPtr has to have the correct length
295  // (which is guaranteed by the ScalarColumn putColumn function).
296  void putArrayColumnV (const void* dataPtr);
297 
298  // Get some array values in the column.
299  // The argument dataPtr is in fact an Array<T>*, but a void*
300  // is needed to be generic.
301  // The vector pointed to by dataPtr has to have the correct length
302  // (which is guaranteed by the ArrayColumn getColumn function).
303  virtual void getArrayColumnCellsV (const RefRows& rownrs,
304  void* dataPtr);
305 
306  // Put some array values in the column.
307  // The argument dataPtr is in fact an const Array<T>*, but a const void*
308  // is needed to be generic.
309  // The vector pointed to by dataPtr has to have the correct length
310  // (which is guaranteed by the ArrayColumn getColumn function).
311  virtual void putArrayColumnCellsV (const RefRows& rownrs,
312  const void* dataPtr);
313 
314  // Get a section of all arrays in the column.
315  // The argument dataPtr is in fact a Array<T>*, but a void*
316  // is needed to be generic.
317  // The array pointed to by dataPtr has to have the correct shape
318  // (which is guaranteed by the ArrayColumn getColumn function).
319  void getColumnSliceV (const Slicer& slicer, void* dataPtr);
320 
321  // Put a section into all arrays in the column.
322  // The argument dataPtr is in fact a const Array<T>*, but a const void*
323  // is needed to be generic.
324  // The array pointed to by dataPtr has to have the correct shape
325  // (which is guaranteed by the ArrayColumn putColumn function).
326  void putColumnSliceV (const Slicer& slicer, const void* dataPtr);
327 
328  // Get a section of some arrays in the column.
329  // The argument dataPtr is in fact an Array<T>*, but a void*
330  // is needed to be generic.
331  // The array pointed to by dataPtr has to have the correct shape
332  // (which is guaranteed by the ArrayColumn getColumn function).
333  virtual void getColumnSliceCellsV (const RefRows& rownrs,
334  const Slicer& slicer, void* dataPtr);
335 
336  // Put into a section of some arrays in the column.
337  // The argument dataPtr is in fact a const Array<T>*, but a const void*
338  // is needed to be generic.
339  // The array pointed to by dataPtr has to have the correct shape
340  // (which is guaranteed by the ArrayColumn putColumn function).
341  virtual void putColumnSliceCellsV (const RefRows& rownrs,
342  const Slicer& slicer,
343  const void* dataPtr);
344 
345 
346  //# Now define the data members.
347  ForwardColumnEngine* enginePtr_p; //# pointer to parent engine
348  String colName_p; //# The name of the column
349  int dataType_p; //# data type of the column
350  String dataTypeId_p; //# data type Id of the column
351  TableColumn refCol_p; //# Column in referenced table
352  //# This is only filled in when
353  //# a new table is created.
354  Bool writable_p; //# True = column is writable
355  Table origTable_p; //# The original table for this column
356  BaseColumn* colPtr_p; //# pointer to column in original table
357 };
358 
359 
360 
361 
362 // <summary>
363 // Virtual column engine forwarding to other columns
364 // </summary>
365 
366 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
367 // </reviewed>
368 
369 // <use visibility=export>
370 
371 // <prerequisite>
372 //# Classes you should understand before using this one.
373 // <li> VirtualColumnEngine
374 // </prerequisite>
375 
376 // <synopsis>
377 // ForwardColumnEngine is a data manager which forwards
378 // the gets and puts of columns to columns with the same names in
379 // another table.
380 // It is, in fact, a reference to the other table columns.
381 // The engine consists of a set of
382 // <linkto class="ForwardColumn:description">ForwardColumn</linkto>
383 // objects, which handle the actual gets and puts.
384 // </synopsis>
385 
386 // <motivation>
387 // This class will be used by the calibration software.
388 // Most columns in a measurement table will be forwarded
389 // (thus bound to a ForwardColumnEngine object), while
390 // a few (i.e. the data themselves) will be calculated by a dedicated
391 // calibration engine.
392 // </motivation>
393 
394 // <example>
395 // <srcblock>
396 // // The original table.
397 // Table tab("someTable");
398 // // Create another table with the same description.
399 // SetupNewTable newtab("tForwardCol1.data", tab.tableDesc(), Table::New);
400 // // Create an engine which forwards to the original table.
401 // // Bind all columns in the new table to the forwarding engine.
402 // ForwardColumnEngine fce(tab);
403 // newtab.bindAll (fce);
404 // // Create the new table.
405 // // Every get and put on this table is forwarded to the original table.
406 // // NB. Puts cannot be done here, because the original table was
407 // // opened as readonly.
408 // // Of course, some columns could have been bound to another
409 // // data manager (storage manager, calibration engine, ...).
410 // Table forwTab(newtab);
411 // </srcblock>
412 // </example>
413 
415 {
416 public:
417 
418  // The default constructor is required for reconstruction of the
419  // engine when a table is read back.
420  ForwardColumnEngine (const String& dataManagerName, const Record& spec);
421 
422  // Create the engine.
423  // The columns using this engine will reference the given table.
424  // The data manager gets the given name.
425  ForwardColumnEngine (const Table& referencedTable,
426  const String& dataManagerName);
427 
428  // Create the engine.
429  // The columns using this engine will reference the given table.
430  // The data manager has no name.
431  ForwardColumnEngine (const Table& referencedTable);
432 
433  // Destructor is mandatory.
435 
436  // Clone the engine object.
437  DataManager* clone() const;
438 
439  // Return the name of the data manager. This is the name of this
440  // instantiation of the data manager, thus not its type name.
441  String dataManagerName() const;
442 
443  // Return the type of the engine (i.e. its class name ForwardColumnEngine).
444  String dataManagerType() const;
445 
446  // Record a record containing data manager specifications.
447  virtual Record dataManagerSpec() const;
448 
449  // Get the suffix to be used for names.
450  const String& suffix() const;
451 
452  // Return the name of the class.
453  static String className();
454 
455  // Register the class name and the static makeObject "constructor".
456  // This will make the engine known to the table system.
457  static void registerClass();
458 
459 protected:
460  // Set the suffix.
461  void setSuffix (const String& suffix);
462 
463  // Add a ForwardColumn object to the block.
464  void addForwardColumn (ForwardColumn* colp);
465 
466  // Get access to the refTable_p data member.
467  const Table& refTable() const
468  { return refTable_p; }
469 
470  // Do the creation (i.e. initialization) of the engine.
471  void baseCreate();
472 
473  // Do the preparation of the engine by preparing all columns.
474  void basePrepare();
475 
476 private:
477  // The copy constructor is forbidden (so it is private).
479 
480  // Assignment is forbidden (so it is private).
482 
483  // This data manager allows to add rows.
484  Bool canAddRow() const;
485 
486  // This data manager allows to delete rows.
487  Bool canRemoveRow() const;
488 
489  // Add rows to all columns.
490  // This is not doing anything (but needed to override the default).
491  void addRow (uInt nrrow);
492 
493  // Delete a row from all columns.
494  // This is not doing anything (but needed to override the default).
495  void removeRow (uInt rownr);
496 
497  // This data manager allows to add columns.
498  Bool canAddColumn() const;
499 
500  // This data manager allows to delete columns.
501  Bool canRemoveColumn() const;
502 
503  // Add a column.
504  void addColumn (DataManagerColumn*);
505 
506  // Delete a column.
507  void removeColumn (DataManagerColumn*);
508 
509  // Create the column object for the scalar column in this engine.
510  DataManagerColumn* makeScalarColumn (const String& columnName,
511  int dataType,
512  const String& dataTypeId);
513 
514  // Create the column object for the indirect array column in this engine.
515  DataManagerColumn* makeIndArrColumn (const String& columnName,
516  int dataType,
517  const String& dataTypeId);
518 
519  // Initialize the object for a new table.
520  // It defines the column keywords containing the name of the
521  // original table, which can be the parent of the referenced table.
522  void create (uInt initialNrrow);
523 
524  // Initialize the engine.
525  // It gets the name of the original table(s) from the column keywords,
526  // opens those tables and attaches the ForwardColumn objects to the
527  // columns in those tables.
528  void prepare();
529 
530  // Reopen the engine for read/write access.
531  // It makes all its columns writable if their underlying table is writable.
532  void reopenRW();
533 
534 
535  // Define the various engine column objects.
537  // The referenced table.
538  // For newly created tables this is filled in by the constructor.
539  // For existing tables this is filled in by the first ForwardColumn
540  // object being constructed.
542  // The name of the data manager.
544  // The suffix to be used in names.
546 
547 
548 public:
549  // Set RefTable_p if not set yet.
550  // This is done by ForwardColumn to cover the case for existing
551  // tables where the default constructor of ForwardColumnEngine
552  // is used and refTable_p is not filled in.
553  void setRefTable (const Table& refTable);
554 
555  // Define the "constructor" to construct this engine when a
556  // table is read back.
557  // This "constructor" has to be registered by the user of the engine.
558  // If the engine is commonly used, its registration can be added
559  // into the registerAllCtor function in DataManReg.cc.
560  // This function gets automatically invoked by the table system.
561  static DataManager* makeObject (const String& dataManagerType,
562  const Record& spec);
563 };
564 
565 
566 
567 inline const String& ForwardColumnEngine::suffix() const
568  { return suffix_p; }
569 
570 inline void ForwardColumnEngine::setSuffix (const String& suffix)
571  { suffix_p = suffix; }
572 
573 
574 
575 } //# NAMESPACE CASACORE - END
576 
577 #endif
A Vector of integers, for indexing into Array<T> objects.
Definition: IPosition.h:119
void putStringV(uInt rownr, const String *dataPtr)
Abstract base class for virtual column handling.
Definition: VirtColEng.h:111
void putColumnSliceV(const Slicer &slicer, const void *dataPtr)
Put a section into all arrays in the column.
int Int
Definition: aipstype.h:50
void getStringV(uInt rownr, String *dataPtr)
BaseColumn * colPtr_p
Definition: ForwardCol.h:356
Create a new table - define shapes, data managers, etc.
Definition: SetupNewTab.h:346
void putuShortV(uInt rownr, const uShort *dataPtr)
virtual void getScalarColumnCellsV(const RefRows &rownrs, void *dataPtr)
Get some scalar values in the column.
void getComplexV(uInt rownr, Complex *dataPtr)
virtual void getColumnSliceCellsV(const RefRows &rownrs, const Slicer &slicer, void *dataPtr)
Get a section of some arrays in the column.
Main interface class to a read/write table.
Definition: Table.h:153
void putBoolV(uInt rownr, const Bool *dataPtr)
Put the scalar value with a standard data type into the given row.
void putShortV(uInt rownr, const Short *dataPtr)
Abstract base class for a column in a data manager.
Definition: DataManager.h:609
static SetupNewTable setupNewTable(const Table &table, const String &tableName, Table::TableOption option)
Create a SetupNewTable object with the given name and option and with the description from the given ...
Bool canChangeShape() const
This data manager may be able to handle changing array shapes.
unsigned char uChar
Definition: aipstype.h:47
virtual void putColumnSliceCellsV(const RefRows &rownrs, const Slicer &slicer, const void *dataPtr)
Put into a section of some arrays in the column.
Bool canAccessSlice(Bool &reask) const
This data manager may be able to do get/putSlice.
const String & columnName() const
Get rhe column name.
Definition: DataManager.h:997
void getDComplexV(uInt rownr, DComplex *dataPtr)
void getuShortV(uInt rownr, uShort *dataPtr)
virtual void putScalarColumnCellsV(const RefRows &rownrs, const void *dataPtr)
Put some scalar values in the column.
void getScalarColumnV(void *dataPtr)
Get all scalar values in the column.
int dataType() const
Get the data type of the column as defined in DataType.h.
void getfloatV(uInt rownr, float *dataPtr)
virtual void prepare(const Table &thisTable)
Initialize the object.
Virtual column engine forwarding to other columns.
Definition: ForwardCol.h:414
void putIntV(uInt rownr, const Int *dataPtr)
void getuCharV(uInt rownr, uChar *dataPtr)
short Short
Definition: aipstype.h:48
String dataManName_p
The name of the data manager.
Definition: ForwardCol.h:543
String suffix_p
The suffix to be used in names.
Definition: ForwardCol.h:545
Table refTable_p
The referenced table.
Definition: ForwardCol.h:541
void putArrayColumnV(const void *dataPtr)
Put all scalar values in the column.
ForwardColumn & operator=(const ForwardColumn &)
Assignment is not needed and therefore forbidden (so make it private).
void putArrayV(uInt rownr, const void *dataPtr)
Put the array value into the given row.
uInt ndim(uInt rownr)
Get the dimensionality of the item in the given row.
Bool canAccessColumnSlice(Bool &reask) const
This data manager may be able to do get/putColumnSlice.
ForwardColumn(ForwardColumnEngine *enginePtr, const String &columnName, int dataType, const String &dataTypeId, const Table &referencedTable)
Construct it for the given column.
void setRW()
Set the column to writable if its underlying table is writable.
void getSliceV(uInt rownr, const Slicer &slicer, void *dataPtr)
Get a section of the array in the given row.
void setShapeColumn(const IPosition &shape)
Set the shape of an direct array.
Class holding the row numbers in a RefTable.
Definition: RefRows.h:85
Virtual column forwarding to another column.
Definition: ForwardCol.h:91
virtual void putArrayColumnCellsV(const RefRows &rownrs, const void *dataPtr)
Put some array values in the column.
Bool canAccessScalarColumn(Bool &reask) const
This data manager may be able to do get/putScalarColumn.
Bool canAccessArrayColumn(Bool &reask) const
This data manager may be able to do get/putArrayColumn.
virtual ~ForwardColumn()
Destructor is mandatory.
A hierarchical collection of named fields of various types.
Definition: Record.h:180
void getOtherV(uInt rownr, void *dataPtr)
Get the scalar value with a non-standard data type in the given row.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
String dataTypeId() const
Get the data type id of the column for dataType==TpOther.
void getArrayColumnV(void *dataPtr)
Get all scalar values in the column.
void setShape(uInt rownr, const IPosition &shape)
Set the shape of an (indirect) array in the given row.
void putfloatV(uInt rownr, const float *dataPtr)
void getBoolV(uInt rownr, Bool *dataPtr)
Get the scalar value with a standard data type in the given row.
const Table & refTable() const
Get access to the refTable_p data member.
Definition: ForwardCol.h:467
Read/write access to a table column.
Definition: TableColumn.h:98
void getShortV(uInt rownr, Short *dataPtr)
A drop-in replacement for Block<T*>.
Definition: Block.h:814
Bool isWritable() const
Test if data can be put into this column.
BaseColumn * colPtr() const
Definition: ForwardCol.h:127
void fillTableName(const Table &thisTable, const Table &referencedTable)
Define the special keyword containing the name of the original table.
Specify which elements to extract from an n-dimensional array.
Definition: Slicer.h:289
void putOtherV(uInt rownr, const void *dataPtr)
Put the scalar value with a non-standard data type into the given row.
const String & suffix() const
Get the suffix to be used for names.
Definition: ForwardCol.h:567
void putDComplexV(uInt rownr, const DComplex *dataPtr)
void putSliceV(uInt rownr, const Slicer &slicer, const void *dataPtr)
Put into a section of the array in the given row.
void putScalarColumnV(const void *dataPtr)
Put all scalar values in the column.
Abstract base class for a data manager.
Definition: DataManager.h:222
void basePrepare(const Table &thisTable, Bool writable)
Do the preparation of the base class column object.
void setSuffix(const String &suffix)
Set the suffix.
Definition: ForwardCol.h:570
void getColumnSliceV(const Slicer &slicer, void *dataPtr)
Get a section of all arrays in the column.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
void getArrayV(uInt rownr, void *dataPtr)
Get the array value in the given row.
void putComplexV(uInt rownr, const Complex *dataPtr)
virtual void getArrayColumnCellsV(const RefRows &rownrs, void *dataPtr)
Get some array values in the column.
void getIntV(uInt rownr, Int *dataPtr)
void putdoubleV(uInt rownr, const double *dataPtr)
ForwardColumnEngine * enginePtr_p
Definition: ForwardCol.h:347
void putuCharV(uInt rownr, const uChar *dataPtr)
Bool isShapeDefined(uInt rownr)
Is the value shape defined in the given row?
IPosition shape(uInt rownr)
Get the shape of the item in the given row.
void getuIntV(uInt rownr, uInt *dataPtr)
PtrBlock< ForwardColumn * > refColumns_p
Define the various engine column objects.
Definition: ForwardCol.h:536
void getdoubleV(uInt rownr, double *dataPtr)
this file contains all the compiler specific defines
Definition: mainpage.dox:28
void putuIntV(uInt rownr, const uInt *dataPtr)
unsigned int uInt
Definition: aipstype.h:51
TableOption
Define the possible options how a table can be opened.
Definition: Table.h:168
unsigned short uShort
Definition: aipstype.h:49
Abstract base class for a table column.
Definition: BaseColumn.h:98