casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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>
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 getInt64V (uInt rownr, Int64* dataPtr);
199  void getfloatV (uInt rownr, float* dataPtr);
200  void getdoubleV (uInt rownr, double* dataPtr);
201  void getComplexV (uInt rownr, Complex* dataPtr);
202  void getDComplexV (uInt rownr, DComplex* dataPtr);
203  void getStringV (uInt rownr, String* dataPtr);
204  // </group>
205 
206  // Get the scalar value with a non-standard data type in the given row.
207  void getOtherV (uInt rownr, void* dataPtr);
208 
209  // Put the scalar value with a standard data type into the given row.
210  // <group>
211  void putBoolV (uInt rownr, const Bool* dataPtr);
212  void putuCharV (uInt rownr, const uChar* dataPtr);
213  void putShortV (uInt rownr, const Short* dataPtr);
214  void putuShortV (uInt rownr, const uShort* dataPtr);
215  void putIntV (uInt rownr, const Int* dataPtr);
216  void putuIntV (uInt rownr, const uInt* dataPtr);
217  void putInt64V (uInt rownr, const Int64* dataPtr);
218  void putfloatV (uInt rownr, const float* dataPtr);
219  void putdoubleV (uInt rownr, const double* dataPtr);
220  void putComplexV (uInt rownr, const Complex* dataPtr);
221  void putDComplexV (uInt rownr, const DComplex* dataPtr);
222  void putStringV (uInt rownr, const String* dataPtr);
223  // </group>
224 
225  // Put the scalar value with a non-standard data type into the given row.
226  void putOtherV (uInt rownr, const void* dataPtr);
227 
228  // Get all scalar values in the column.
229  // The argument dataPtr is in fact a Vector<T>*, but a void*
230  // is needed to be generic.
231  // The vector pointed to by dataPtr has to have the correct length
232  // (which is guaranteed by the ScalarColumn getColumn function).
233  void getScalarColumnV (void* dataPtr);
234 
235  // Put all scalar values in the column.
236  // The argument dataPtr is in fact a const Vector<T>*, but a const void*
237  // is needed to be generic.
238  // The vector pointed to by dataPtr has to have the correct length
239  // (which is guaranteed by the ScalarColumn putColumn function).
240  void putScalarColumnV (const void* dataPtr);
241 
242  // Get some scalar values in the column.
243  // The argument dataPtr is in fact a Vector<T>*, but a void*
244  // is needed to be generic.
245  // The vector pointed to by dataPtr has to have the correct length
246  // (which is guaranteed by the ScalarColumn getColumn function).
247  virtual void getScalarColumnCellsV (const RefRows& rownrs,
248  void* dataPtr);
249 
250  // Put some scalar values in the column.
251  // The argument dataPtr is in fact a const Vector<T>*, but a const void*
252  // is needed to be generic.
253  // The vector pointed to by dataPtr has to have the correct length
254  // (which is guaranteed by the ScalarColumn getColumn function).
255  virtual void putScalarColumnCellsV (const RefRows& rownrs,
256  const void* dataPtr);
257 
258  // Get the array value in the given row.
259  // The argument dataPtr is in fact a Array<T>*, but a void*
260  // is needed to be generic.
261  // The array pointed to by dataPtr has to have the correct shape
262  // (which is guaranteed by the ArrayColumn get function).
263  void getArrayV (uInt rownr, void* dataPtr);
264 
265  // Put the array value into the given row.
266  // The argument dataPtr is in fact a const Array<T>*, but a const void*
267  // is needed to be generic.
268  // The array pointed to by dataPtr has to have the correct shape
269  // (which is guaranteed by the ArrayColumn put function).
270  void putArrayV (uInt rownr, const void* dataPtr);
271 
272  // Get a section of the array in the given row.
273  // The argument dataPtr is in fact a Array<T>*, but a void*
274  // is needed to be generic.
275  // The array pointed to by dataPtr has to have the correct shape
276  // (which is guaranteed by the ArrayColumn getSlice function).
277  void getSliceV (uInt rownr, const Slicer& slicer, void* dataPtr);
278 
279  // Put into a section of the array in the given row.
280  // The argument dataPtr is in fact a const Array<T>*, but a const void*
281  // is needed to be generic.
282  // The array pointed to by dataPtr has to have the correct shape
283  // (which is guaranteed by the ArrayColumn putSlice function).
284  void putSliceV (uInt rownr, const Slicer& slicer, const void* dataPtr);
285 
286  // Get all scalar values in the column.
287  // The argument dataPtr is in fact a Vector<T>*, but a void*
288  // is needed to be generic.
289  // The vector pointed to by dataPtr has to have the correct length
290  // (which is guaranteed by the ScalarColumn getColumn function).
291  void getArrayColumnV (void* dataPtr);
292 
293  // Put all scalar values in the column.
294  // The argument dataPtr is in fact a const Vector<T>*, but a const void*
295  // is needed to be generic.
296  // The vector pointed to by dataPtr has to have the correct length
297  // (which is guaranteed by the ScalarColumn putColumn function).
298  void putArrayColumnV (const void* dataPtr);
299 
300  // Get some array values in the column.
301  // The argument dataPtr is in fact an Array<T>*, but a void*
302  // is needed to be generic.
303  // The vector pointed to by dataPtr has to have the correct length
304  // (which is guaranteed by the ArrayColumn getColumn function).
305  virtual void getArrayColumnCellsV (const RefRows& rownrs,
306  void* dataPtr);
307 
308  // Put some array values in the column.
309  // The argument dataPtr is in fact an const Array<T>*, but a const void*
310  // is needed to be generic.
311  // The vector pointed to by dataPtr has to have the correct length
312  // (which is guaranteed by the ArrayColumn getColumn function).
313  virtual void putArrayColumnCellsV (const RefRows& rownrs,
314  const void* dataPtr);
315 
316  // Get a section of all arrays in the column.
317  // The argument dataPtr is in fact a Array<T>*, but a void*
318  // is needed to be generic.
319  // The array pointed to by dataPtr has to have the correct shape
320  // (which is guaranteed by the ArrayColumn getColumn function).
321  void getColumnSliceV (const Slicer& slicer, void* dataPtr);
322 
323  // Put a section into all arrays in the column.
324  // The argument dataPtr is in fact a const Array<T>*, but a const void*
325  // is needed to be generic.
326  // The array pointed to by dataPtr has to have the correct shape
327  // (which is guaranteed by the ArrayColumn putColumn function).
328  void putColumnSliceV (const Slicer& slicer, const void* dataPtr);
329 
330  // Get a section of some arrays in the column.
331  // The argument dataPtr is in fact an Array<T>*, but a void*
332  // is needed to be generic.
333  // The array pointed to by dataPtr has to have the correct shape
334  // (which is guaranteed by the ArrayColumn getColumn function).
335  virtual void getColumnSliceCellsV (const RefRows& rownrs,
336  const Slicer& slicer, void* dataPtr);
337 
338  // Put into a section of some arrays in the column.
339  // The argument dataPtr is in fact a const Array<T>*, but a const void*
340  // is needed to be generic.
341  // The array pointed to by dataPtr has to have the correct shape
342  // (which is guaranteed by the ArrayColumn putColumn function).
343  virtual void putColumnSliceCellsV (const RefRows& rownrs,
344  const Slicer& slicer,
345  const void* dataPtr);
346 
347 
348  //# Now define the data members.
349  ForwardColumnEngine* enginePtr_p; //# pointer to parent engine
350  String colName_p; //# The name of the column
351  int dataType_p; //# data type of the column
352  String dataTypeId_p; //# data type Id of the column
353  TableColumn refCol_p; //# Column in referenced table
354  //# This is only filled in when
355  //# a new table is created.
356  Bool writable_p; //# True = column is writable
357  Table origTable_p; //# The original table for this column
358  BaseColumn* colPtr_p; //# pointer to column in original table
359 };
360 
361 
362 
363 
364 // <summary>
365 // Virtual column engine forwarding to other columns
366 // </summary>
367 
368 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
369 // </reviewed>
370 
371 // <use visibility=export>
372 
373 // <prerequisite>
374 //# Classes you should understand before using this one.
375 // <li> VirtualColumnEngine
376 // </prerequisite>
377 
378 // <synopsis>
379 // ForwardColumnEngine is a data manager which forwards
380 // the gets and puts of columns to columns with the same names in
381 // another table.
382 // It is, in fact, a reference to the other table columns.
383 // The engine consists of a set of
384 // <linkto class="ForwardColumn:description">ForwardColumn</linkto>
385 // objects, which handle the actual gets and puts.
386 // </synopsis>
387 
388 // <motivation>
389 // This class will be used by the calibration software.
390 // Most columns in a measurement table will be forwarded
391 // (thus bound to a ForwardColumnEngine object), while
392 // a few (i.e. the data themselves) will be calculated by a dedicated
393 // calibration engine.
394 // </motivation>
395 
396 // <example>
397 // <srcblock>
398 // // The original table.
399 // Table tab("someTable");
400 // // Create another table with the same description.
401 // SetupNewTable newtab("tForwardCol1.data", tab.tableDesc(), Table::New);
402 // // Create an engine which forwards to the original table.
403 // // Bind all columns in the new table to the forwarding engine.
404 // ForwardColumnEngine fce(tab);
405 // newtab.bindAll (fce);
406 // // Create the new table.
407 // // Every get and put on this table is forwarded to the original table.
408 // // NB. Puts cannot be done here, because the original table was
409 // // opened as readonly.
410 // // Of course, some columns could have been bound to another
411 // // data manager (storage manager, calibration engine, ...).
412 // Table forwTab(newtab);
413 // </srcblock>
414 // </example>
415 
417 {
418 public:
419 
420  // The default constructor is required for reconstruction of the
421  // engine when a table is read back.
422  ForwardColumnEngine (const String& dataManagerName, const Record& spec);
423 
424  // Create the engine.
425  // The columns using this engine will reference the given table.
426  // The data manager gets the given name.
427  ForwardColumnEngine (const Table& referencedTable,
428  const String& dataManagerName);
429 
430  // Create the engine.
431  // The columns using this engine will reference the given table.
432  // The data manager has no name.
433  ForwardColumnEngine (const Table& referencedTable);
434 
435  // Destructor is mandatory.
437 
438  // Clone the engine object.
439  DataManager* clone() const;
440 
441  // Return the name of the data manager. This is the name of this
442  // instantiation of the data manager, thus not its type name.
443  String dataManagerName() const;
444 
445  // Return the type of the engine (i.e. its class name ForwardColumnEngine).
446  String dataManagerType() const;
447 
448  // Record a record containing data manager specifications.
449  virtual Record dataManagerSpec() const;
450 
451  // Get the suffix to be used for names.
452  const String& suffix() const;
453 
454  // Return the name of the class.
455  static String className();
456 
457  // Register the class name and the static makeObject "constructor".
458  // This will make the engine known to the table system.
459  static void registerClass();
460 
461 protected:
462  // Set the suffix.
463  void setSuffix (const String& suffix);
464 
465  // Add a ForwardColumn object to the block.
466  void addForwardColumn (ForwardColumn* colp);
467 
468  // Get access to the refTable_p data member.
469  const Table& refTable() const
470  { return refTable_p; }
471 
472  // Do the creation (i.e. initialization) of the engine.
473  void baseCreate();
474 
475  // Do the preparation of the engine by preparing all columns.
476  void basePrepare();
477 
478 private:
479  // The copy constructor is forbidden (so it is private).
481 
482  // Assignment is forbidden (so it is private).
484 
485  // This data manager allows to add rows.
486  Bool canAddRow() const;
487 
488  // This data manager allows to delete rows.
489  Bool canRemoveRow() const;
490 
491  // Add rows to all columns.
492  // This is not doing anything (but needed to override the default).
493  void addRow (uInt nrrow);
494 
495  // Delete a row from all columns.
496  // This is not doing anything (but needed to override the default).
497  void removeRow (uInt rownr);
498 
499  // This data manager allows to add columns.
500  Bool canAddColumn() const;
501 
502  // This data manager allows to delete columns.
503  Bool canRemoveColumn() const;
504 
505  // Add a column.
507 
508  // Delete a column.
510 
511  // Create the column object for the scalar column in this engine.
512  DataManagerColumn* makeScalarColumn (const String& columnName,
513  int dataType,
514  const String& dataTypeId);
515 
516  // Create the column object for the indirect array column in this engine.
517  DataManagerColumn* makeIndArrColumn (const String& columnName,
518  int dataType,
519  const String& dataTypeId);
520 
521  // Initialize the object for a new table.
522  // It defines the column keywords containing the name of the
523  // original table, which can be the parent of the referenced table.
524  void create (uInt initialNrrow);
525 
526  // Initialize the engine.
527  // It gets the name of the original table(s) from the column keywords,
528  // opens those tables and attaches the ForwardColumn objects to the
529  // columns in those tables.
530  void prepare();
531 
532  // Reopen the engine for read/write access.
533  // It makes all its columns writable if their underlying table is writable.
534  void reopenRW();
535 
536 
537  // Define the various engine column objects.
539  // The referenced table.
540  // For newly created tables this is filled in by the constructor.
541  // For existing tables this is filled in by the first ForwardColumn
542  // object being constructed.
544  // The name of the data manager.
546  // The suffix to be used in names.
548 
549 
550 public:
551  // Set RefTable_p if not set yet.
552  // This is done by ForwardColumn to cover the case for existing
553  // tables where the default constructor of ForwardColumnEngine
554  // is used and refTable_p is not filled in.
555  void setRefTable (const Table& refTable);
556 
557  // Define the "constructor" to construct this engine when a
558  // table is read back.
559  // This "constructor" has to be registered by the user of the engine.
560  // If the engine is commonly used, its registration can be added
561  // into the registerAllCtor function in DataManReg.cc.
562  // This function gets automatically invoked by the table system.
563  static DataManager* makeObject (const String& dataManagerType,
564  const Record& spec);
565 };
566 
567 
568 
569 inline const String& ForwardColumnEngine::suffix() const
570  { return suffix_p; }
571 
572 inline void ForwardColumnEngine::setSuffix (const String& suffix)
573  { suffix_p = suffix; }
574 
575 
576 
577 } //# NAMESPACE CASACORE - END
578 
579 #endif
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
void putStringV(uInt rownr, const String *dataPtr)
Abstract base class for virtual column handling.
Definition: VirtColEng.h:111
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
Definition: aipsxtype.h:38
void putColumnSliceV(const Slicer &slicer, const void *dataPtr)
Put a section into all arrays in the column.
Bool canRemoveRow() const
This data manager allows to delete rows.
int Int
Definition: aipstype.h:50
void getStringV(uInt rownr, String *dataPtr)
BaseColumn * colPtr_p
Definition: ForwardCol.h:358
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.
ForwardColumnEngine(const String &dataManagerName, const Record &spec)
The default constructor is required for reconstruction of the engine when a table is read back...
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
const String & columnName() const
Get rhe column name.
Definition: DataManager.h:1003
DataManager * clone() const
Clone the engine object.
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:611
void removeRow(uInt rownr)
Delete a row from all columns.
void basePrepare()
Do the preparation of the engine by preparing all columns.
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 ...
void removeColumn(DataManagerColumn *)
Delete a column.
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.
void getDComplexV(uInt rownr, DComplex *dataPtr)
void getuShortV(uInt rownr, uShort *dataPtr)
void putInt64V(uInt rownr, const Int64 *dataPtr)
static void registerClass()
Register the class name and the static makeObject &quot;constructor&quot;.
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.
String dataTypeId() const
Get the data type id of the column for dataType==TpOther.
void prepare()
Initialize the engine.
void getfloatV(uInt rownr, float *dataPtr)
Bool canAccessArrayColumn(Bool &reask) const
This data manager may be able to do get/putArrayColumn.
virtual void prepare(const Table &thisTable)
Initialize the object.
Virtual column engine forwarding to other columns.
Definition: ForwardCol.h:416
void baseCreate()
Do the creation (i.e.
~ForwardColumnEngine()
Destructor is mandatory.
DataManagerColumn * makeScalarColumn(const String &columnName, int dataType, const String &dataTypeId)
Create the column object for the scalar column in this engine.
void putIntV(uInt rownr, const Int *dataPtr)
void getuCharV(uInt rownr, uChar *dataPtr)
short Short
Definition: aipstype.h:48
Bool canAccessScalarColumn(Bool &reask) const
This data manager may be able to do get/putScalarColumn.
String dataManName_p
The name of the data manager.
Definition: ForwardCol.h:545
Bool canAccessColumnSlice(Bool &reask) const
This data manager may be able to do get/putColumnSlice.
void addForwardColumn(ForwardColumn *colp)
Add a ForwardColumn object to the block.
String suffix_p
The suffix to be used in names.
Definition: ForwardCol.h:547
Bool isWritable() const
Test if data can be put into this column.
Table refTable_p
The referenced table.
Definition: ForwardCol.h:543
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.
void setRefTable(const Table &refTable)
Set RefTable_p if not set yet.
uInt ndim(uInt rownr)
Get the dimensionality of the item in the given row.
void addRow(uInt nrrow)
Add rows to all columns.
Bool canAddColumn() const
This data manager allows to add columns.
ForwardColumn(ForwardColumnEngine *enginePtr, const String &columnName, int dataType, const String &dataTypeId, const Table &referencedTable)
Construct it for the given column.
virtual Record dataManagerSpec() const
Record a record containing data manager specifications.
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.
void reopenRW()
Reopen the engine for read/write access.
virtual ~ForwardColumn()
Destructor is mandatory.
BaseColumn * colPtr() const
Definition: ForwardCol.h:127
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
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 create(uInt initialNrrow)
Initialize the object for a new table.
void getBoolV(uInt rownr, Bool *dataPtr)
Get the scalar value with a standard data type in the given row.
String dataManagerType() const
Return the type of the engine (i.e.
Read/write access to a table column.
Definition: TableColumn.h:98
const String & suffix() const
Get the suffix to be used for names.
Definition: ForwardCol.h:569
void getShortV(uInt rownr, Short *dataPtr)
A drop-in replacement for Block&lt;T*&gt;.
Definition: WProjectFT.h:54
void addColumn(DataManagerColumn *)
Add a column.
void getInt64V(uInt rownr, Int64 *dataPtr)
void fillTableName(const Table &thisTable, const Table &referencedTable)
Define the special keyword containing the name of the original table.
const Table & refTable() const
Get access to the refTable_p data member.
Definition: ForwardCol.h:469
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.
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:224
static String className()
Return the name of the class.
Bool canAddRow() const
This data manager allows to add rows.
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:572
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
Bool canRemoveColumn() const
This data manager allows to delete columns.
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.
DataManagerColumn * makeIndArrColumn(const String &columnName, int dataType, const String &dataTypeId)
Create the column object for the indirect array column in this engine.
void getIntV(uInt rownr, Int *dataPtr)
void putdoubleV(uInt rownr, const double *dataPtr)
Bool canAccessSlice(Bool &reask) const
This data manager may be able to do get/putSlice.
ForwardColumnEngine * enginePtr_p
Definition: ForwardCol.h:349
void putuCharV(uInt rownr, const uChar *dataPtr)
String dataManagerName() const
Return the name of the data manager.
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.
static DataManager * makeObject(const String &dataManagerType, const Record &spec)
Define the &quot;constructor&quot; to construct this engine when a table is read back.
ForwardColumnEngine & operator=(const ForwardColumnEngine &)
Assignment is forbidden (so it is private).
void getuIntV(uInt rownr, uInt *dataPtr)
PtrBlock< ForwardColumn * > refColumns_p
Define the various engine column objects.
Definition: ForwardCol.h:538
void getdoubleV(uInt rownr, double *dataPtr)
int dataType() const
Get the data type of the column as defined in DataType.h.
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
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42