casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StManAipsIO.h
Go to the documentation of this file.
1 //# StManAipsIO.h: Storage manager for tables using AipsIO
2 //# Copyright (C) 1994,1995,1996,1997,1998,1999,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_STMANAIPSIO_H
29 #define TABLES_STMANAIPSIO_H
30 
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
41 
42 namespace casacore { //# NAMESPACE CASACORE - BEGIN
43 
44 //# Forward clarations
45 class AipsIO;
46 class StManAipsIO;
47 class StManArrayFile;
48 
49 
50 // <summary>
51 // AipsIO table column storage manager class
52 // </summary>
53 
54 // <use visibility=local>
55 
56 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
57 // </reviewed>
58 
59 // <prerequisite>
60 //# Classes you should understand before using this one.
61 // <li> StManColumn
62 // </prerequisite>
63 
64 // <etymology>
65 // StManColumnAipsIO handles a column for an AipsIO storage manager.
66 // </etymology>
67 
68 // <synopsis>
69 // StManColumnAipsIO is used by StManAipsIO to handle the access to
70 // the data in a table column.
71 // It is an storage manager based on AipsIO. The entire column is
72 // kept in memory and only written when the storage manager closes.
73 // When the storage manager gets opened, the entire column gets
74 // read back.
75 // It fully supports addition and removal of rows.
76 //
77 // StManColumnAipsIO serves 2 purposes:
78 // <ol>
79 // <li> It handles a column containing scalar values.
80 // <li> It serves as a base class for StManArrayColumnAipsIO and
81 // StManIndArrayColumnAipsIO. These classes handle arrays and
82 // use StManColumnAipsIO to hold a pointer to the array in each row.
83 // </ol>
84 //
85 // StManColumnAipsIO does not hold a column as a consecutive array,
86 // because extending the column (i.e. adding rows) proofed be too
87 // expensive due to the repeated copying involved when creating a table
88 // (this method was used by the old table system).
89 // Instead it has a number of data blocks (extensions) indexed to by a
90 // super block. Accessing a row means finding the appropriate extension
91 // via a binary search. Because there is only 1 extension when a table is
92 // read back, the overhead in finding a row is small.
93 // </synopsis>
94 
95 // <motivation>
96 // StManColumnAipsIO handles the standard data types. The class
97 // is not templated, but a switch statement is used instead.
98 // Templates would cause too many instantiations.
99 // </motivation>
100 
101 // <todo asof="$DATE:$">
102 //# A List of bugs, limitations, extensions or planned refinements.
103 // </todo>
104 
105 
107 {
108 public:
109 
110  // Create a column of the given type.
111  // It will maintain a pointer to its parent storage manager.
112  StManColumnAipsIO (StManAipsIO* stMan, int dataType, Bool byPtr);
113 
114  // Frees up the storage.
115  virtual ~StManColumnAipsIO();
116 
117  // Get a scalar value in the given row.
118  // The buffer pointed to by dataPtr has to have the correct length
119  // (which is guaranteed by the Scalar/ArrayColumn get function).
120  // <group>
121  void getBoolV (uInt rownr, Bool* dataPtr);
122  void getuCharV (uInt rownr, uChar* dataPtr);
123  void getShortV (uInt rownr, Short* dataPtr);
124  void getuShortV (uInt rownr, uShort* dataPtr);
125  void getIntV (uInt rownr, Int* dataPtr);
126  void getuIntV (uInt rownr, uInt* dataPtr);
127  void getInt64V (uInt rownr, Int64* dataPtr);
128  void getfloatV (uInt rownr, float* dataPtr);
129  void getdoubleV (uInt rownr, double* dataPtr);
130  void getComplexV (uInt rownr, Complex* dataPtr);
131  void getDComplexV (uInt rownr, DComplex* dataPtr);
132  void getStringV (uInt rownr, String* dataPtr);
133  // </group>
134 
135  // Put a scalar value into the given row.
136  // The buffer pointed to by dataPtr has to have the correct length
137  // (which is guaranteed by the Scalar/ArrayColumn put function).
138  // <group>
139  void putBoolV (uInt rownr, const Bool* dataPtr);
140  void putuCharV (uInt rownr, const uChar* dataPtr);
141  void putShortV (uInt rownr, const Short* dataPtr);
142  void putuShortV (uInt rownr, const uShort* dataPtr);
143  void putIntV (uInt rownr, const Int* dataPtr);
144  void putuIntV (uInt rownr, const uInt* dataPtr);
145  void putInt64V (uInt rownr, const Int64* dataPtr);
146  void putfloatV (uInt rownr, const float* dataPtr);
147  void putdoubleV (uInt rownr, const double* dataPtr);
148  void putComplexV (uInt rownr, const Complex* dataPtr);
149  void putDComplexV (uInt rownr, const DComplex* dataPtr);
150  void putStringV (uInt rownr, const String* dataPtr);
151  // </group>
152 
153  // Get scalars from the given row on with a maximum of nrmax values.
154  // This can be used to get an entire column of scalars or to get
155  // a part of a column (for a cache for example).
156  // The buffer pointed to by dataPtr has to have the correct length
157  // (which is guaranteed by the ScalarColumn get function).
158  // <group>
159  uInt getBlockBoolV (uInt rownr, uInt nrmax, Bool* dataPtr);
160  uInt getBlockuCharV (uInt rownr, uInt nrmax, uChar* dataPtr);
161  uInt getBlockShortV (uInt rownr, uInt nrmax, Short* dataPtr);
162  uInt getBlockuShortV (uInt rownr, uInt nrmax, uShort* dataPtr);
163  uInt getBlockIntV (uInt rownr, uInt nrmax, Int* dataPtr);
164  uInt getBlockuIntV (uInt rownr, uInt nrmax, uInt* dataPtr);
165  uInt getBlockInt64V (uInt rownr, uInt nrmax, Int64* dataPtr);
166  uInt getBlockfloatV (uInt rownr, uInt nrmax, float* dataPtr);
167  uInt getBlockdoubleV (uInt rownr, uInt nrmax, double* dataPtr);
168  uInt getBlockComplexV (uInt rownr, uInt nrmax, Complex* dataPtr);
169  uInt getBlockDComplexV (uInt rownr, uInt nrmax, DComplex* dataPtr);
170  uInt getBlockStringV (uInt rownr, uInt nrmax, String* dataPtr);
171  // </group>
172 
173  // Put nrmax scalars from the given row on.
174  // This can be used to put an entire column of scalars or to put
175  // a part of a column (for a cache for example).
176  // The buffer pointed to by dataPtr has to have the correct length
177  // (which is guaranteed by the ScalarColumn put function).
178  // <group>
179  void putBlockBoolV (uInt rownr, uInt nrmax, const Bool* dataPtr);
180  void putBlockuCharV (uInt rownr, uInt nrmax, const uChar* dataPtr);
181  void putBlockShortV (uInt rownr, uInt nrmax, const Short* dataPtr);
182  void putBlockuShortV (uInt rownr, uInt nrmax, const uShort* dataPtr);
183  void putBlockIntV (uInt rownr, uInt nrmax, const Int* dataPtr);
184  void putBlockuIntV (uInt rownr, uInt nrmax, const uInt* dataPtr);
185  void putBlockInt64V (uInt rownr, uInt nrmax, const Int64* dataPtr);
186  void putBlockfloatV (uInt rownr, uInt nrmax, const float* dataPtr);
187  void putBlockdoubleV (uInt rownr, uInt nrmax, const double* dataPtr);
188  void putBlockComplexV (uInt rownr, uInt nrmax, const Complex* dataPtr);
189  void putBlockDComplexV (uInt rownr, uInt nrmax, const DComplex* dataPtr);
190  void putBlockStringV (uInt rownr, uInt nrmax, const String* dataPtr);
191  // </group>
192 
193  // Get the scalar values in some cells of the column.
194  // The buffer pointed to by dataPtr has to have the correct length.
195  // (which is guaranteed by the ScalarColumn getColumnCells function).
196  // The default implementation loops through all rows.
197  // <group>
198  virtual void getScalarColumnCellsBoolV (const RefRows& rownrs,
199  Vector<Bool>* dataPtr);
200  virtual void getScalarColumnCellsuCharV (const RefRows& rownrs,
201  Vector<uChar>* dataPtr);
202  virtual void getScalarColumnCellsShortV (const RefRows& rownrs,
203  Vector<Short>* dataPtr);
204  virtual void getScalarColumnCellsuShortV (const RefRows& rownrs,
205  Vector<uShort>* dataPtr);
206  virtual void getScalarColumnCellsIntV (const RefRows& rownrs,
207  Vector<Int>* dataPtr);
208  virtual void getScalarColumnCellsuIntV (const RefRows& rownrs,
209  Vector<uInt>* dataPtr);
210  virtual void getScalarColumnCellsInt64V (const RefRows& rownrs,
211  Vector<Int64>* dataPtr);
212  virtual void getScalarColumnCellsfloatV (const RefRows& rownrs,
213  Vector<float>* dataPtr);
214  virtual void getScalarColumnCellsdoubleV (const RefRows& rownrs,
215  Vector<double>* dataPtr);
216  virtual void getScalarColumnCellsComplexV (const RefRows& rownrs,
217  Vector<Complex>* dataPtr);
218  virtual void getScalarColumnCellsDComplexV (const RefRows& rownrs,
219  Vector<DComplex>* dataPtr);
220  virtual void getScalarColumnCellsStringV (const RefRows& rownrs,
221  Vector<String>* dataPtr);
222  // </group>
223 
224  // Add (newNrrow-oldNrrow) rows to the column.
225  virtual void addRow (uInt newNrrow, uInt oldNrrow);
226 
227  // Resize the data blocks.
228  // This adds an extension when needed.
229  void resize (uInt nrval);
230 
231  // Remove the given row.
232  // If no rows remain in the extension, the extension is also removed.
233  virtual void remove (uInt rownr);
234 
235  // Create the number of rows in a new table.
236  // This is used when a table gets created.
237  virtual void doCreate (uInt nrrow);
238 
239  // Write the column data into AipsIO.
240  // It will successively write all extensions using putData.
241  virtual void putFile (uInt nrval, AipsIO&);
242 
243  // Read the column data from AipsIO.
244  // One extension gets allocated to hold all rows in the column.
245  virtual void getFile (uInt nrval, AipsIO&);
246 
247  // Reopen the storage manager files for read/write.
248  virtual void reopenRW();
249 
250  // Check if the class invariants still hold.
251  virtual Bool ok() const;
252 
253 protected:
254  // The storage manager.
256  // The data type (for caching purposes).
257  int dtype_p;
258  // The data is indirectly accessed via a pointer (for the derived classes).
260  // The number of allocated rows in the column.
262  // The nr of extensions in use.
264  // The assembly of all extensions (actually Block<T*>).
266  // The cumulative nr of rows in all extensions.
268 
269  // Find the extension in which the row number is.
270  // If the flag is true, it also sets the columnCache object.
271  uInt findExt (uInt rownr, Bool setCache);
272 
273  // Get the next extension.
274  // For the first iteration extnr should be zero.
275  // It returns the number of values in it until the maximum is reached.
276  // Zero means no more extensions.
277  uInt nextExt (void*& ext, uInt& extnr, uInt nrmax) const;
278 
279  // Allocate an extension with the data type of the column.
280  void* allocData (uInt nrval, Bool byPtr);
281 
282  // Delete all extensions.
283  // Possible underlying data (as used by StManArrayColumnAipsIO)
284  // will not be deleted and should have been deleted beforehand.
285  void deleteAll();
286 
287  // Delete an extension.
288  void deleteData (void* datap, Bool byPtr);
289 
290  // Remove an entry (i.e. a row) from an extension at the given index.
291  // It will do this by shifting the rest (nrvalAfter elements)
292  // one position to the left.
293  void removeData (void* datap, uInt inx, uInt nrvalAfter);
294 
295  // Put the data (nrval elements) in an extension (starting at datap)
296  // into AipsIO.
297  virtual void putData (void* datap, uInt nrval, AipsIO&);
298 
299  // Get data (nrval elements) into an extension (starting at datap
300  // plus the given index).
301  virtual void getData (void* datap, uInt index, uInt nrval, AipsIO&,
302  uInt version);
303 
304  // Get the pointer for the given row.
305  // This is for the derived classes like StManArrayColumnAipsIO.
306  void* getArrayPtr (uInt rownr);
307 
308  // Put the pointer for the given row.
309  // This is for the derived classes like StManArrayColumnAipsIO.
310  void putArrayPtr (uInt rownr, void* dataPtr);
311 
312 private:
313  // Forbid copy constructor.
315 
316  // Forbid assignment.
318 };
319 
320 
321 
322 
323 // <summary>
324 // AipsIO table storage manager class
325 // </summary>
326 
327 // <use visibility=export>
328 
329 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
330 // </reviewed>
331 
332 // <prerequisite>
333 //# Classes you should understand before using this one.
334 // <li> DataManager
335 // <li> StManColumnAipsIO
336 // </prerequisite>
337 
338 // <etymology>
339 // StManAipsIO is the storage manager using AipsIO.
340 // </etymology>
341 
342 // <synopsis>
343 // StManAipsIO is a table storage manager based on AipsIO.
344 // It holds the data in the columns in memory and writes them to
345 // a file when the table gets closed. Only the data of indirect arrays
346 // are directly read/written from/to a file.
347 // It contains pointers to the underlying StManColumnAipsIO objects,
348 // which do the actual data handling.
349 //
350 // The AipsIO storage manager does fully support addition and removal
351 // of rows and columns.
352 //
353 // All data, except indirect columns, for this storage manager are kept
354 // in one file. The file name is the table name appended with
355 // .N_AipsIO, where N is the (unique) storage manager sequence number.
356 // Each column containing indirect arrays is stored in a separate file
357 // using class StManIndArrayColumnAipsIO. The name of such a file is
358 // the storage manager file name appended with _cM, where M is a unique
359 // column sequence number acquired using function uniqueNr().
360 // </synopsis>
361 
362 // <todo asof="$DATE:$">
363 //# A List of bugs, limitations, extensions or planned refinements.
364 // </todo>
365 
366 
367 class StManAipsIO : public DataManager
368 {
369 public:
370 
371  // Create an AipsIO storage manager.
372  // Its name will be blank.
373  StManAipsIO();
374 
375  // Create an AipsIO storage manager with the given name.
376  // Its name can be used later in e.g. Table::addColumn to
377  // add a column to this storage manager.
378  // <br> Note that the 2nd constructor is needed for table creation
379  // from a record specification.
380  // <group>
381  StManAipsIO (const String& storageManagerName);
382  StManAipsIO (const String& storageManagerName, const Record&);
383  // </group>
384 
385  ~StManAipsIO();
386 
387  // Clone this object.
388  // It does not clone StManAipsIOColumn objects possibly used.
389  DataManager* clone() const;
390 
391  // Get the type name of the data manager (i.e. StManAipsIO).
392  String dataManagerType() const;
393 
394  // Get the name given to this storage manager.
395  String dataManagerName() const;
396 
397  // Get a unique column number for the column
398  // (it is only unique for this storage manager).
399  // This is used by StManIndArrayColumnAipsIO to create a unique file name.
401  { return uniqnr_p++; }
402 
403  // Get the nr of rows in this storage manager.
404  uInt nrow() const
405  { return nrrow_p; }
406 
407  // Set the hasPut_p flag. In this way the StManAipsIOColumn objects
408  // can indicate that data have been put.
409  void setHasPut()
410  { hasPut_p = True; }
411 
412  // Does the storage manager allow to add rows? (yes)
413  Bool canAddRow() const;
414 
415  // Does the storage manager allow to delete rows? (yes)
416  Bool canRemoveRow() const;
417 
418  // Does the storage manager allow to add columns? (yes)
419  Bool canAddColumn() const;
420 
421  // Does the storage manager allow to delete columns? (yes)
422  Bool canRemoveColumn() const;
423 
424  // Make the object from the string.
425  // This function gets registered in the DataManager "constructor" map.
426  static DataManager* makeObject (const String& dataManagerType,
427  const Record& spec);
428 
429  // Open (if needed) the file for indirect arrays with the given mode.
430  // Return a pointer to the object.
432 
433 
434 private:
435  // Forbid copy constructor.
436  StManAipsIO (const StManAipsIO&);
437 
438  // Forbid assignment.
440 
441  // Flush and optionally fsync the data.
442  // It returns a True status if it had to flush (i.e. if data have changed).
443  virtual Bool flush (AipsIO&, Bool fsync);
444 
445  // Let the storage manager create files as needed for a new table.
446  // This allows a column with an indirect array to create its file.
447  virtual void create (uInt nrrow);
448 
449  // Open the storage manager file for an existing table and read in
450  // the data and let the StManColumnAipsIO objects read their data.
451  virtual void open (uInt nrrow, AipsIO&);
452 
453  // Resync the storage manager with the new file contents.
454  // This is done by clearing the cache.
455  virtual void resync (uInt nrrow);
456 
457  // Reopen the storage manager files for read/write.
458  virtual void reopenRW();
459 
460  // The data manager will be deleted (because all its columns are
461  // requested to be deleted).
462  // So clean up the things needed (e.g. delete files).
463  virtual void deleteManager();
464 
465  // Add rows to all columns.
466  void addRow (uInt nrrow);
467 
468  // Delete a row from all columns.
469  void removeRow (uInt rownr);
470 
471  // Create a column in the storage manager on behalf of a table column.
472  // <group>
473  // Create a scalar column.
474  DataManagerColumn* makeScalarColumn (const String& name, int dataType,
475  const String& dataTypeID);
476  // Create a direct array column.
477  DataManagerColumn* makeDirArrColumn (const String& name, int dataType,
478  const String& dataTypeID);
479  // Create an indirect array column.
480  DataManagerColumn* makeIndArrColumn (const String& name, int dataType,
481  const String& dataTypeID);
482  // </group>
483 
484  // Add a column.
486 
487  // Delete a column.
489 
490 
491  // Name given by user to this storage manager.
493  // Unique nr for column in this storage manager.
495  // The number of rows in the columns.
497  // The assembly of all columns.
499  // Has anything been put since the last flush?
501  // The file containing the indirect arrays.
503 };
504 
505 
506 
507 
508 } //# NAMESPACE CASACORE - END
509 
510 #endif
uInt getBlockStringV(uInt rownr, uInt nrmax, String *dataPtr)
uInt getBlockdoubleV(uInt rownr, uInt nrmax, double *dataPtr)
void putuShortV(uInt rownr, const uShort *dataPtr)
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
Definition: aipsxtype.h:38
StManAipsIO & operator=(const StManAipsIO &)
Forbid assignment.
int Int
Definition: aipstype.h:50
String dataManagerType() const
Get the type name of the data manager (i.e.
virtual void putData(void *datap, uInt nrval, AipsIO &)
Put the data (nrval elements) in an extension (starting at datap) into AipsIO.
void putfloatV(uInt rownr, const float *dataPtr)
void putBlockShortV(uInt rownr, uInt nrmax, const Short *dataPtr)
void getuShortV(uInt rownr, uShort *dataPtr)
DataManagerColumn * makeIndArrColumn(const String &name, int dataType, const String &dataTypeID)
Create an indirect array column.
uInt nrext_p
The nr of extensions in use.
Definition: StManAipsIO.h:263
void putBlockdoubleV(uInt rownr, uInt nrmax, const double *dataPtr)
void resize(uInt nrval)
Resize the data blocks.
virtual void putFile(uInt nrval, AipsIO &)
Write the column data into AipsIO.
virtual ~StManColumnAipsIO()
Frees up the storage.
void getShortV(uInt rownr, Short *dataPtr)
void putBlockBoolV(uInt rownr, uInt nrmax, const Bool *dataPtr)
Put nrmax scalars from the given row on.
void putBlockfloatV(uInt rownr, uInt nrmax, const float *dataPtr)
AipsIO is the object persistency mechanism of Casacore.
Definition: AipsIO.h:168
void putShortV(uInt rownr, const Short *dataPtr)
uInt nralloc_p
The number of allocated rows in the column.
Definition: StManAipsIO.h:261
Abstract base class for a column in a data manager.
Definition: DataManager.h:611
virtual void getScalarColumnCellsShortV(const RefRows &rownrs, Vector< Short > *dataPtr)
int dtype_p
The data type (for caching purposes).
Definition: StManAipsIO.h:257
uInt getBlockDComplexV(uInt rownr, uInt nrmax, DComplex *dataPtr)
virtual Bool flush(AipsIO &, Bool fsync)
Flush and optionally fsync the data.
uInt getBlockuCharV(uInt rownr, uInt nrmax, uChar *dataPtr)
void deleteAll()
Delete all extensions.
void putdoubleV(uInt rownr, const double *dataPtr)
void getdoubleV(uInt rownr, double *dataPtr)
virtual void getData(void *datap, uInt index, uInt nrval, AipsIO &, uInt version)
Get data (nrval elements) into an extension (starting at datap plus the given index).
unsigned char uChar
Definition: aipstype.h:47
void putBlockInt64V(uInt rownr, uInt nrmax, const Int64 *dataPtr)
String dataManagerName() const
Get the name given to this storage manager.
void setHasPut()
Set the hasPut_p flag.
Definition: StManAipsIO.h:409
void putBlockIntV(uInt rownr, uInt nrmax, const Int *dataPtr)
uInt getBlockComplexV(uInt rownr, uInt nrmax, Complex *dataPtr)
void putuIntV(uInt rownr, const uInt *dataPtr)
void putBlockuShortV(uInt rownr, uInt nrmax, const uShort *dataPtr)
void putComplexV(uInt rownr, const Complex *dataPtr)
String stmanName_p
Name given by user to this storage manager.
Definition: StManAipsIO.h:492
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
void putBlockuCharV(uInt rownr, uInt nrmax, const uChar *dataPtr)
StManAipsIO * stmanPtr_p
The storage manager.
Definition: StManAipsIO.h:255
Block< void * > data_p
The assembly of all extensions (actually Block&lt;T*&gt;).
Definition: StManAipsIO.h:265
StManAipsIO()
Create an AipsIO storage manager.
uInt getBlockShortV(uInt rownr, uInt nrmax, Short *dataPtr)
virtual void getScalarColumnCellsStringV(const RefRows &rownrs, Vector< String > *dataPtr)
void putDComplexV(uInt rownr, const DComplex *dataPtr)
virtual void getScalarColumnCellsIntV(const RefRows &rownrs, Vector< Int > *dataPtr)
int dataType() const
Return the data type of the column.
Bool canRemoveRow() const
Does the storage manager allow to delete rows? (yes)
short Short
Definition: aipstype.h:48
void getDComplexV(uInt rownr, DComplex *dataPtr)
virtual void getScalarColumnCellsDComplexV(const RefRows &rownrs, Vector< DComplex > *dataPtr)
virtual void getScalarColumnCellsuShortV(const RefRows &rownrs, Vector< uShort > *dataPtr)
Bool canAddColumn() const
Does the storage manager allow to add columns? (yes)
StManArrayFile * iosfile_p
The file containing the indirect arrays.
Definition: StManAipsIO.h:502
AipsIO table column storage manager class.
Definition: StManAipsIO.h:106
Bool canRemoveColumn() const
Does the storage manager allow to delete columns? (yes)
void putIntV(uInt rownr, const Int *dataPtr)
Bool byPtr_p
The data is indirectly accessed via a pointer (for the derived classes).
Definition: StManAipsIO.h:259
virtual void getScalarColumnCellsuCharV(const RefRows &rownrs, Vector< uChar > *dataPtr)
Block< uInt > ncum_p
The cumulative nr of rows in all extensions.
Definition: StManAipsIO.h:267
void * getArrayPtr(uInt rownr)
Get the pointer for the given row.
void getuCharV(uInt rownr, uChar *dataPtr)
StManColumnAipsIO(StManAipsIO *stMan, int dataType, Bool byPtr)
Create a column of the given type.
uInt nrrow_p
The number of rows in the columns.
Definition: StManAipsIO.h:496
void deleteData(void *datap, Bool byPtr)
Delete an extension.
virtual void getScalarColumnCellsuIntV(const RefRows &rownrs, Vector< uInt > *dataPtr)
DataManagerColumn * makeDirArrColumn(const String &name, int dataType, const String &dataTypeID)
Create a direct array column.
void putInt64V(uInt rownr, const Int64 *dataPtr)
virtual void getFile(uInt nrval, AipsIO &)
Read the column data from AipsIO.
Class holding the row numbers in a RefTable.
Definition: RefRows.h:85
void getIntV(uInt rownr, Int *dataPtr)
virtual void getScalarColumnCellsdoubleV(const RefRows &rownrs, Vector< double > *dataPtr)
virtual void reopenRW()
Reopen the storage manager files for read/write.
virtual void create(uInt nrrow)
Let the storage manager create files as needed for a new table.
virtual void deleteManager()
The data manager will be deleted (because all its columns are requested to be deleted).
void putBlockComplexV(uInt rownr, uInt nrmax, const Complex *dataPtr)
void putArrayPtr(uInt rownr, void *dataPtr)
Put the pointer for the given row.
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
virtual void getScalarColumnCellsComplexV(const RefRows &rownrs, Vector< Complex > *dataPtr)
virtual void doCreate(uInt nrrow)
Create the number of rows in a new table.
static DataManager * makeObject(const String &dataManagerType, const Record &spec)
Make the object from the string.
virtual void getScalarColumnCellsfloatV(const RefRows &rownrs, Vector< float > *dataPtr)
uInt getBlockBoolV(uInt rownr, uInt nrmax, Bool *dataPtr)
Get scalars from the given row on with a maximum of nrmax values.
A drop-in replacement for Block&lt;T*&gt;.
Definition: WProjectFT.h:54
void addColumn(DataManagerColumn *)
Add a column.
uInt getBlockfloatV(uInt rownr, uInt nrmax, float *dataPtr)
void getInt64V(uInt rownr, Int64 *dataPtr)
void putBlockStringV(uInt rownr, uInt nrmax, const String *dataPtr)
virtual Bool ok() const
Check if the class invariants still hold.
void putBlockDComplexV(uInt rownr, uInt nrmax, const DComplex *dataPtr)
AipsIO table storage manager class.
Definition: StManAipsIO.h:367
StManArrayFile * openArrayFile(ByteIO::OpenOption opt)
Open (if needed) the file for indirect arrays with the given mode.
OpenOption
Define the possible ByteIO open options.
Definition: ByteIO.h:65
uInt nrow() const
Get the nr of rows in this storage manager.
Definition: StManAipsIO.h:404
uInt uniqueNr()
Get a unique column number for the column (it is only unique for this storage manager).
Definition: StManAipsIO.h:400
void removeRow(uInt rownr)
Delete a row from all columns.
void putBlockuIntV(uInt rownr, uInt nrmax, const uInt *dataPtr)
Abstract base class for a data manager.
Definition: DataManager.h:224
virtual void resync(uInt nrrow)
Resync the storage manager with the new file contents.
StManColumnAipsIO & operator=(const StManColumnAipsIO &)
Forbid assignment.
uInt getBlockuShortV(uInt rownr, uInt nrmax, uShort *dataPtr)
DataManager * clone() const
Clone this object.
uInt getBlockuIntV(uInt rownr, uInt nrmax, uInt *dataPtr)
void removeColumn(DataManagerColumn *)
Delete a column.
void removeData(void *datap, uInt inx, uInt nrvalAfter)
Remove an entry (i.e.
Bool canAddRow() const
Does the storage manager allow to add rows? (yes)
void putBoolV(uInt rownr, const Bool *dataPtr)
Put a scalar value into the given row.
uInt getBlockInt64V(uInt rownr, uInt nrmax, Int64 *dataPtr)
String: the storage and methods of handling collections of characters.
Definition: String.h:223
virtual void reopenRW()
Reopen the storage manager files for read/write.
void putStringV(uInt rownr, const String *dataPtr)
virtual void addRow(uInt newNrrow, uInt oldNrrow)
Add (newNrrow-oldNrrow) rows to the column.
PtrBlock< StManColumnAipsIO * > colSet_p
The assembly of all columns.
Definition: StManAipsIO.h:498
DataManagerColumn * makeScalarColumn(const String &name, int dataType, const String &dataTypeID)
Create a column in the storage manager on behalf of a table column.
virtual void open(uInt nrrow, AipsIO &)
Open the storage manager file for an existing table and read in the data and let the StManColumnAipsI...
uInt uniqnr_p
Unique nr for column in this storage manager.
Definition: StManAipsIO.h:494
Base table column storage manager class.
Definition: StManColumn.h:102
void getStringV(uInt rownr, String *dataPtr)
Bool hasPut_p
Has anything been put since the last flush?
Definition: StManAipsIO.h:500
void * allocData(uInt nrval, Bool byPtr)
Allocate an extension with the data type of the column.
Read/write array in external format for a storage manager.
Definition: StArrayFile.h:129
uInt findExt(uInt rownr, Bool setCache)
Find the extension in which the row number is.
const Bool True
Definition: aipstype.h:43
void addRow(uInt nrrow)
Add rows to all columns.
void getComplexV(uInt rownr, Complex *dataPtr)
uInt nextExt(void *&ext, uInt &extnr, uInt nrmax) const
Get the next extension.
uInt getBlockIntV(uInt rownr, uInt nrmax, Int *dataPtr)
unsigned int uInt
Definition: aipstype.h:51
void getBoolV(uInt rownr, Bool *dataPtr)
Get a scalar value in the given row.
void getfloatV(uInt rownr, float *dataPtr)
virtual void getScalarColumnCellsInt64V(const RefRows &rownrs, Vector< Int64 > *dataPtr)
void getuIntV(uInt rownr, uInt *dataPtr)
unsigned short uShort
Definition: aipstype.h:49
virtual void getScalarColumnCellsBoolV(const RefRows &rownrs, Vector< Bool > *dataPtr)
Get the scalar values in some cells of the column.
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42
void putuCharV(uInt rownr, const uChar *dataPtr)