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).
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.
150 
151  // Get the data type of the column as defined in DataType.h.
152  int dataType() const;
153 
154  // Get the data type id of the column for dataType==TpOther.
155  // This function is required for virtual column engines handling
156  // non-standard data types. It is used to check the data type.
158 
159  // Test if data can be put into this column.
160  Bool isWritable() const;
161 
162  // Set the shape of an direct array.
163  // This only checks if the shape matches the referenced column.
165 
166  // Set the shape of an (indirect) array in the given row.
167  void setShape (rownr_t rownr, const IPosition& shape);
168 
169  // Is the value shape defined in the given row?
171 
172  // Get the dimensionality of the item in the given row.
173  uInt ndim (rownr_t rownr);
174 
175  // Get the shape of the item in the given row.
177 
178  // Get the scalar value with a standard data type in the given row.
179  // <group>
180  virtual void getBool (rownr_t rownr, Bool* dataPtr);
181  virtual void getuChar (rownr_t rownr, uChar* dataPtr);
182  virtual void getShort (rownr_t rownr, Short* dataPtr);
183  virtual void getuShort (rownr_t rownr, uShort* dataPtr);
184  virtual void getInt (rownr_t rownr, Int* dataPtr);
185  virtual void getuInt (rownr_t rownr, uInt* dataPtr);
186  virtual void getInt64 (rownr_t rownr, Int64* dataPtr);
187  virtual void getfloat (rownr_t rownr, float* dataPtr);
188  virtual void getdouble (rownr_t rownr, double* dataPtr);
189  virtual void getComplex (rownr_t rownr, Complex* dataPtr);
190  virtual void getDComplex (rownr_t rownr, DComplex* dataPtr);
191  virtual void getString (rownr_t rownr, String* dataPtr);
192  // </group>
193 
194  // Get the scalar value with a non-standard data type in the given row.
195  virtual void getOther (rownr_t rownr, void* dataPtr);
196 
197  // Put the scalar value with a standard data type into the given row.
198  // <group>
199  virtual void putBool (rownr_t rownr, const Bool* dataPtr);
200  virtual void putuChar (rownr_t rownr, const uChar* dataPtr);
201  virtual void putShort (rownr_t rownr, const Short* dataPtr);
202  virtual void putuShort (rownr_t rownr, const uShort* dataPtr);
203  virtual void putInt (rownr_t rownr, const Int* dataPtr);
204  virtual void putuInt (rownr_t rownr, const uInt* dataPtr);
205  virtual void putInt64 (rownr_t rownr, const Int64* dataPtr);
206  virtual void putfloat (rownr_t rownr, const float* dataPtr);
207  virtual void putdouble (rownr_t rownr, const double* dataPtr);
208  virtual void putComplex (rownr_t rownr, const Complex* dataPtr);
209  virtual void putDComplex (rownr_t rownr, const DComplex* dataPtr);
210  virtual void putString (rownr_t rownr, const String* dataPtr);
211  // </group>
212 
213  // Put the scalar value with a non-standard data type into the given row.
214  virtual void putOther (rownr_t rownr, const void* dataPtr);
215 
216  // Get all scalar values in the column.
217  // The argument dataPtr is in fact a Vector<T>&, but a ArrayBase&
218  // is needed to be generic.
219  // The vector pointed to by dataPtr has to have the correct length
220  // (which is guaranteed by the ScalarColumn getColumn function).
221  void getScalarColumnV (ArrayBase& dataPtr);
222 
223  // Put all scalar values in the column.
224  // The argument dataPtr is in fact a const Vector<T>&, but a const ArrayBase&
225  // is needed to be generic.
226  // The vector pointed to by dataPtr has to have the correct length
227  // (which is guaranteed by the ScalarColumn putColumn function).
228  void putScalarColumnV (const ArrayBase& dataPtr);
229 
230  // Get some scalar values in the column.
231  // The argument dataPtr is in fact a Vector<T>&, but a ArrayBase&
232  // is needed to be generic.
233  // The vector pointed to by dataPtr has to have the correct length
234  // (which is guaranteed by the ScalarColumn getColumn function).
235  virtual void getScalarColumnCellsV (const RefRows& rownrs,
236  ArrayBase& dataPtr);
237 
238  // Put some scalar values in the column.
239  // The argument dataPtr is in fact a const Vector<T>&, but a const ArrayBase&
240  // is needed to be generic.
241  // The vector pointed to by dataPtr has to have the correct length
242  // (which is guaranteed by the ScalarColumn getColumn function).
243  virtual void putScalarColumnCellsV (const RefRows& rownrs,
244  const ArrayBase& dataPtr);
245 
246  // Get the array value in the given row.
247  // The argument dataPtr is in fact a Array<T>&, but a ArrayBase&
248  // is needed to be generic.
249  // The array pointed to by dataPtr has to have the correct shape
250  // (which is guaranteed by the ArrayColumn get function).
251  void getArrayV (rownr_t rownr, ArrayBase& dataPtr);
252 
253  // Put the array value into the given row.
254  // The argument dataPtr is in fact a const Array<T>&, but a const ArrayBase&
255  // is needed to be generic.
256  // The array pointed to by dataPtr has to have the correct shape
257  // (which is guaranteed by the ArrayColumn put function).
258  void putArrayV (rownr_t rownr, const ArrayBase& dataPtr);
259 
260  // Get a section of the array in the given row.
261  // The argument dataPtr is in fact a Array<T>&, but a ArrayBase&
262  // is needed to be generic.
263  // The array pointed to by dataPtr has to have the correct shape
264  // (which is guaranteed by the ArrayColumn getSlice function).
265  void getSliceV (rownr_t rownr, const Slicer& slicer, ArrayBase& dataPtr);
266 
267  // Put into a section of the array in the given row.
268  // The argument dataPtr is in fact a const Array<T>&, but a const ArrayBase&
269  // is needed to be generic.
270  // The array pointed to by dataPtr has to have the correct shape
271  // (which is guaranteed by the ArrayColumn putSlice function).
272  void putSliceV (rownr_t rownr, const Slicer& slicer, const ArrayBase& dataPtr);
273 
274  // Get all scalar values in the column.
275  // The argument dataPtr is in fact a Vector<T>&, but a ArrayBase&
276  // is needed to be generic.
277  // The vector pointed to by dataPtr has to have the correct length
278  // (which is guaranteed by the ScalarColumn getColumn function).
279  void getArrayColumnV (ArrayBase& dataPtr);
280 
281  // Put all scalar values in the column.
282  // The argument dataPtr is in fact a const Vector<T>&, but a const ArrayBase&
283  // is needed to be generic.
284  // The vector pointed to by dataPtr has to have the correct length
285  // (which is guaranteed by the ScalarColumn putColumn function).
286  void putArrayColumnV (const ArrayBase& dataPtr);
287 
288  // Get some array values in the column.
289  // The argument dataPtr is in fact an Array<T>&, but a ArrayBase&
290  // is needed to be generic.
291  // The vector pointed to by dataPtr has to have the correct length
292  // (which is guaranteed by the ArrayColumn getColumn function).
293  virtual void getArrayColumnCellsV (const RefRows& rownrs,
294  ArrayBase& dataPtr);
295 
296  // Put some array values in the column.
297  // The argument dataPtr is in fact an const Array<T>&, but a const ArrayBase&
298  // is needed to be generic.
299  // The vector pointed to by dataPtr has to have the correct length
300  // (which is guaranteed by the ArrayColumn getColumn function).
301  virtual void putArrayColumnCellsV (const RefRows& rownrs,
302  const ArrayBase& dataPtr);
303 
304  // Get a section of all arrays in the column.
305  // The argument dataPtr is in fact a Array<T>&, but a ArrayBase&
306  // is needed to be generic.
307  // The array pointed to by dataPtr has to have the correct shape
308  // (which is guaranteed by the ArrayColumn getColumn function).
309  void getColumnSliceV (const Slicer& slicer, ArrayBase& dataPtr);
310 
311  // Put a section into all arrays in the column.
312  // The argument dataPtr is in fact a const Array<T>&, but a const ArrayBase&
313  // is needed to be generic.
314  // The array pointed to by dataPtr has to have the correct shape
315  // (which is guaranteed by the ArrayColumn putColumn function).
316  void putColumnSliceV (const Slicer& slicer, const ArrayBase& dataPtr);
317 
318  // Get a section of some arrays in the column.
319  // The argument dataPtr is in fact an Array<T>&, but a ArrayBase&
320  // is needed to be generic.
321  // The array pointed to by dataPtr has to have the correct shape
322  // (which is guaranteed by the ArrayColumn getColumn function).
323  virtual void getColumnSliceCellsV (const RefRows& rownrs,
324  const Slicer& slicer, ArrayBase& dataPtr);
325 
326  // Put into a section of some arrays in the column.
327  // The argument dataPtr is in fact a const Array<T>&, but a const ArrayBase&
328  // is needed to be generic.
329  // The array pointed to by dataPtr has to have the correct shape
330  // (which is guaranteed by the ArrayColumn putColumn function).
331  virtual void putColumnSliceCellsV (const RefRows& rownrs,
332  const Slicer& slicer,
333  const ArrayBase& dataPtr);
334 
335 
336  //# Now define the data members.
337  ForwardColumnEngine* enginePtr_p; //# pointer to parent engine
338  String colName_p; //# The name of the column
339  int dataType_p; //# data type of the column
340  String dataTypeId_p; //# data type Id of the column
341  TableColumn refCol_p; //# Column in referenced table
342  //# This is only filled in when
343  //# a new table is created.
344  Bool writable_p; //# True = column is writable
345  Table origTable_p; //# The original table for this column
346  BaseColumn* colPtr_p; //# pointer to column in original table
347 };
348 
349 
350 
351 
352 // <summary>
353 // Virtual column engine forwarding to other columns
354 // </summary>
355 
356 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
357 // </reviewed>
358 
359 // <use visibility=export>
360 
361 // <prerequisite>
362 //# Classes you should understand before using this one.
363 // <li> VirtualColumnEngine
364 // </prerequisite>
365 
366 // <synopsis>
367 // ForwardColumnEngine is a data manager which forwards
368 // the gets and puts of columns to columns with the same names in
369 // another table.
370 // It is, in fact, a reference to the other table columns.
371 // The engine consists of a set of
372 // <linkto class="ForwardColumn:description">ForwardColumn</linkto>
373 // objects, which handle the actual gets and puts.
374 // </synopsis>
375 
376 // <motivation>
377 // This class will be used by the calibration software.
378 // Most columns in a measurement table will be forwarded
379 // (thus bound to a ForwardColumnEngine object), while
380 // a few (i.e. the data themselves) will be calculated by a dedicated
381 // calibration engine.
382 // </motivation>
383 
384 // <example>
385 // <srcblock>
386 // // The original table.
387 // Table tab("someTable");
388 // // Create another table with the same description.
389 // SetupNewTable newtab("tForwardCol1.data", tab.tableDesc(), Table::New);
390 // // Create an engine which forwards to the original table.
391 // // Bind all columns in the new table to the forwarding engine.
392 // ForwardColumnEngine fce(tab);
393 // newtab.bindAll (fce);
394 // // Create the new table.
395 // // Every get and put on this table is forwarded to the original table.
396 // // NB. Puts cannot be done here, because the original table was
397 // // opened as readonly.
398 // // Of course, some columns could have been bound to another
399 // // data manager (storage manager, calibration engine, ...).
400 // Table forwTab(newtab);
401 // </srcblock>
402 // </example>
403 
405 {
406 public:
407 
408  // The default constructor is required for reconstruction of the
409  // engine when a table is read back.
411 
412  // Create the engine.
413  // The columns using this engine will reference the given table.
414  // The data manager gets the given name.
415  ForwardColumnEngine (const Table& referencedTable,
416  const String& dataManagerName);
417 
418  // Create the engine.
419  // The columns using this engine will reference the given table.
420  // The data manager has no name.
421  ForwardColumnEngine (const Table& referencedTable);
422 
423  // Destructor is mandatory.
425 
426  // Clone the engine object.
427  DataManager* clone() const;
428 
429  // Return the name of the data manager. This is the name of this
430  // instantiation of the data manager, thus not its type name.
432 
433  // Return the type of the engine (i.e. its class name ForwardColumnEngine).
435 
436  // Record a record containing data manager specifications.
437  virtual Record dataManagerSpec() const;
438 
439  // Get the suffix to be used for names.
440  const String& suffix() const;
441 
442  // Return the name of the class.
443  static String className();
444 
445  // Register the class name and the static makeObject "constructor".
446  // This will make the engine known to the table system.
447  static void registerClass();
448 
449 protected:
450  // Set the suffix.
451  void setSuffix (const String& suffix);
452 
453  // Add a ForwardColumn object to the block.
455 
456  // Get access to the refTable_p data member.
457  const Table& refTable() const
458  { return refTable_p; }
459 
460  // Do the creation (i.e. initialization) of the engine.
461  void baseCreate();
462 
463  // Do the preparation of the engine by preparing all columns.
464  void basePrepare();
465 
466 private:
467  // The copy constructor is forbidden (so it is private).
469 
470  // Assignment is forbidden (so it is private).
472 
473  // This data manager allows to add rows.
474  Bool canAddRow() const;
475 
476  // This data manager allows to delete rows.
478 
479  // Add rows to all columns.
480  // This is not doing anything (but needed to override the default).
481  void addRow64 (rownr_t nrrow);
482 
483  // Delete a row from all columns.
484  // This is not doing anything (but needed to override the default).
485  void removeRow64 (rownr_t rownr);
486 
487  // This data manager allows to add columns.
489 
490  // This data manager allows to delete columns.
492 
493  // Add a column.
495 
496  // Delete a column.
498 
499  // Create the column object for the scalar column in this engine.
501  int dataType,
502  const String& dataTypeId);
503 
504  // Create the column object for the indirect array column in this engine.
506  int dataType,
507  const String& dataTypeId);
508 
509  // Initialize the object for a new table.
510  // It defines the column keywords containing the name of the
511  // original table, which can be the parent of the referenced table.
512  void create64 (rownr_t initialNrrow);
513 
514  // Initialize the engine.
515  // It gets the name of the original table(s) from the column keywords,
516  // opens those tables and attaches the ForwardColumn objects to the
517  // columns in those tables.
518  void prepare();
519 
520  // Reopen the engine for read/write access.
521  // It makes all its columns writable if their underlying table is writable.
522  void reopenRW();
523 
524 
525  // Define the various engine column objects.
527  // The referenced table.
528  // For newly created tables this is filled in by the constructor.
529  // For existing tables this is filled in by the first ForwardColumn
530  // object being constructed.
532  // The name of the data manager.
534  // The suffix to be used in names.
536 
537 
538 public:
539  // Set RefTable_p if not set yet.
540  // This is done by ForwardColumn to cover the case for existing
541  // tables where the default constructor of ForwardColumnEngine
542  // is used and refTable_p is not filled in.
543  void setRefTable (const Table& refTable);
544 
545  // Define the "constructor" to construct this engine when a
546  // table is read back.
547  // This "constructor" has to be registered by the user of the engine.
548  // If the engine is commonly used, its registration can be added
549  // into the registerAllCtor function in DataManReg.cc.
550  // This function gets automatically invoked by the table system.
552  const Record& spec);
553 };
554 
555 
556 
557 inline const String& ForwardColumnEngine::suffix() const
558  { return suffix_p; }
559 
560 inline void ForwardColumnEngine::setSuffix (const String& suffix)
561  { suffix_p = suffix; }
562 
563 
564 
565 } //# NAMESPACE CASACORE - END
566 
567 #endif
Non-templated base class for templated Array class.
Definition: ArrayBase.h:73
const String & columnName() const
Get rhe column name.
Abstract base class for a data manager.
Definition: DataManager.h:221
Virtual column engine forwarding to other columns.
Definition: ForwardCol.h:405
Bool canAddColumn() const
This data manager allows to add columns.
String dataManagerType() const
Return the type of the engine (i.e.
PtrBlock< ForwardColumn * > refColumns_p
Define the various engine column objects.
Definition: ForwardCol.h:526
void baseCreate()
Do the creation (i.e.
Bool canRemoveColumn() const
This data manager allows to delete columns.
DataManagerColumn * makeScalarColumn(const String &columnName, int dataType, const String &dataTypeId)
Create the column object for the scalar column in this engine.
void setSuffix(const String &suffix)
Set the suffix.
Definition: ForwardCol.h:560
String dataManagerName() const
Return the name of the data manager.
const String & suffix() const
Get the suffix to be used for names.
Definition: ForwardCol.h:557
void removeColumn(DataManagerColumn *)
Delete a column.
ForwardColumnEngine(const ForwardColumnEngine &)
The copy constructor is forbidden (so it is private).
DataManager * clone() const
Clone the engine object.
void addColumn(DataManagerColumn *)
Add a column.
const Table & refTable() const
Get access to the refTable_p data member.
Definition: ForwardCol.h:457
static DataManager * makeObject(const String &dataManagerType, const Record &spec)
Define the "constructor" to construct this engine when a table is read back.
void addRow64(rownr_t nrrow)
Add rows to all columns.
void reopenRW()
Reopen the engine for read/write access.
virtual Record dataManagerSpec() const
Record a record containing data manager specifications.
Table refTable_p
The referenced table.
Definition: ForwardCol.h:531
void create64(rownr_t initialNrrow)
Initialize the object for a new table.
void addForwardColumn(ForwardColumn *colp)
Add a ForwardColumn object to the block.
Bool canAddRow() const
This data manager allows to add rows.
DataManagerColumn * makeIndArrColumn(const String &columnName, int dataType, const String &dataTypeId)
Create the column object for the indirect array column in this engine.
void basePrepare()
Do the preparation of the engine by preparing all columns.
String suffix_p
The suffix to be used in names.
Definition: ForwardCol.h:535
ForwardColumnEngine(const Table &referencedTable, const String &dataManagerName)
Create the engine.
ForwardColumnEngine & operator=(const ForwardColumnEngine &)
Assignment is forbidden (so it is private).
static void registerClass()
Register the class name and the static makeObject "constructor".
static String className()
Return the name of the class.
String dataManName_p
The name of the data manager.
Definition: ForwardCol.h:533
void removeRow64(rownr_t rownr)
Delete a row from all columns.
void setRefTable(const Table &refTable)
Set RefTable_p if not set yet.
void prepare()
Initialize the engine.
ForwardColumnEngine(const Table &referencedTable)
Create the engine.
~ForwardColumnEngine()
Destructor is mandatory.
Bool canRemoveRow() const
This data manager allows to delete rows.
ForwardColumnEngine(const String &dataManagerName, const Record &spec)
The default constructor is required for reconstruction of the engine when a table is read back.
virtual void getScalarColumnCellsV(const RefRows &rownrs, ArrayBase &dataPtr)
Get some scalar values in the column.
void setRW()
Set the column to writable if its underlying table is writable.
virtual void putString(rownr_t rownr, const String *dataPtr)
void setShape(rownr_t rownr, const IPosition &shape)
Set the shape of an (indirect) array in the given row.
virtual void getString(rownr_t rownr, String *dataPtr)
virtual void putfloat(rownr_t rownr, const float *dataPtr)
virtual void putdouble(rownr_t rownr, const double *dataPtr)
void putArrayColumnV(const ArrayBase &dataPtr)
Put all scalar values in the column.
void getScalarColumnV(ArrayBase &dataPtr)
Get all scalar values in the column.
virtual void putArrayColumnCellsV(const RefRows &rownrs, const ArrayBase &dataPtr)
Put some array values in the column.
Bool isWritable() const
Test if data can be put into this column.
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 ...
virtual void getDComplex(rownr_t rownr, DComplex *dataPtr)
void getColumnSliceV(const Slicer &slicer, ArrayBase &dataPtr)
Get a section of all arrays in the column.
void getArrayColumnV(ArrayBase &dataPtr)
Get all scalar values in the column.
uInt ndim(rownr_t rownr)
Get the dimensionality of the item in the given row.
virtual void putOther(rownr_t rownr, const void *dataPtr)
Put the scalar value with a non-standard data type into the given row.
virtual void getBool(rownr_t rownr, Bool *dataPtr)
Get the scalar value with a standard data type in the given row.
virtual void getShort(rownr_t rownr, Short *dataPtr)
virtual void getColumnSliceCellsV(const RefRows &rownrs, const Slicer &slicer, ArrayBase &dataPtr)
Get a section of some arrays in the column.
virtual void getuChar(rownr_t rownr, uChar *dataPtr)
virtual void putInt(rownr_t rownr, const Int *dataPtr)
virtual void putuShort(rownr_t rownr, const uShort *dataPtr)
virtual void putScalarColumnCellsV(const RefRows &rownrs, const ArrayBase &dataPtr)
Put some scalar values in the column.
virtual void putuInt(rownr_t rownr, const uInt *dataPtr)
virtual void getInt64(rownr_t rownr, Int64 *dataPtr)
virtual void getuShort(rownr_t rownr, uShort *dataPtr)
ForwardColumn(const ForwardColumn &)
Copy constructor is not needed and therefore forbidden (so make it private).
virtual void putColumnSliceCellsV(const RefRows &rownrs, const Slicer &slicer, const ArrayBase &dataPtr)
Put into a section of some arrays in the column.
int dataType() const
Get the data type of the column as defined in DataType.h.
void getArrayV(rownr_t rownr, ArrayBase &dataPtr)
Get the array value in the given row.
virtual void getOther(rownr_t rownr, void *dataPtr)
Get the scalar value with a non-standard data type in the given row.
virtual void getComplex(rownr_t rownr, Complex *dataPtr)
virtual void getInt(rownr_t rownr, Int *dataPtr)
String dataTypeId() const
Get the data type id of the column for dataType==TpOther.
Bool isShapeDefined(rownr_t rownr)
Is the value shape defined in the given row?
void fillTableName(const Table &thisTable, const Table &referencedTable)
Define the special keyword containing the name of the original table.
void getSliceV(rownr_t rownr, const Slicer &slicer, ArrayBase &dataPtr)
Get a section of the array in the given row.
Bool canChangeShape() const
This data manager may be able to handle changing array shapes.
virtual void getArrayColumnCellsV(const RefRows &rownrs, ArrayBase &dataPtr)
Get some array values in the column.
virtual void putInt64(rownr_t rownr, const Int64 *dataPtr)
ForwardColumn(ForwardColumnEngine *enginePtr, const String &columnName, int dataType, const String &dataTypeId, const Table &referencedTable)
Construct it for the given column.
virtual void putBool(rownr_t rownr, const Bool *dataPtr)
Put the scalar value with a standard data type into the given row.
virtual ~ForwardColumn()
Destructor is mandatory.
void putColumnSliceV(const Slicer &slicer, const ArrayBase &dataPtr)
Put a section into all arrays in the column.
virtual void getdouble(rownr_t rownr, double *dataPtr)
virtual void putDComplex(rownr_t rownr, const DComplex *dataPtr)
IPosition shape(rownr_t rownr)
Get the shape of the item in the given row.
void basePrepare(const Table &thisTable, Bool writable)
Do the preparation of the base class column object.
void putArrayV(rownr_t rownr, const ArrayBase &dataPtr)
Put the array value into the given row.
virtual void putShort(rownr_t rownr, const Short *dataPtr)
BaseColumn * colPtr_p
Definition: ForwardCol.h:346
ForwardColumn & operator=(const ForwardColumn &)
Assignment is not needed and therefore forbidden (so make it private).
virtual void putuChar(rownr_t rownr, const uChar *dataPtr)
void putScalarColumnV(const ArrayBase &dataPtr)
Put all scalar values in the column.
BaseColumn * colPtr() const
Definition: ForwardCol.h:127
ForwardColumnEngine * enginePtr_p
Definition: ForwardCol.h:337
void putSliceV(rownr_t rownr, const Slicer &slicer, const ArrayBase &dataPtr)
Put into a section of the array in the given row.
void setShapeColumn(const IPosition &shape)
Set the shape of an direct array.
virtual void prepare(const Table &thisTable)
Initialize the object.
virtual void getfloat(rownr_t rownr, float *dataPtr)
virtual void putComplex(rownr_t rownr, const Complex *dataPtr)
virtual void getuInt(rownr_t rownr, uInt *dataPtr)
A drop-in replacement for Block<T*>.
Definition: Block.h:814
Create a new table - define shapes, data managers, etc.
Definition: SetupNewTab.h:341
String: the storage and methods of handling collections of characters.
Definition: String.h:225
TableOption
Define the possible options how a table can be opened.
Definition: Table.h:172
this file contains all the compiler specific defines
Definition: mainpage.dox:28
unsigned char uChar
Definition: aipstype.h:47
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
uInt64 rownr_t
Define the type of a row number in a table.
Definition: aipsxtype.h:46