casacore
DataManager.h
Go to the documentation of this file.
1 //# DataManager.h: Abstract base classes for a data manager
2 //# Copyright (C) 1994,1995,1996,1997,1998,1999,2001,2002,2016
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_DATAMANAGER_H
29 #define TABLES_DATAMANAGER_H
30 
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
34 #include <casacore/tables/Tables/ColumnCache.h>
35 #include <casacore/tables/DataMan/TSMOption.h>
36 #include <casacore/casa/BasicSL/String.h>
37 #include <casacore/casa/BasicSL/Complex.h>
38 #include <casacore/casa/Containers/SimOrdMap.h>
39 #include <casacore/casa/IO/ByteIO.h>
40 #include <casacore/casa/OS/Mutex.h>
41 #include<iosfwd>
42 
43 namespace casacore { //# NAMESPACE CASACORE - BEGIN
44 
45 //# Forward Declarations
46 class DataManager;
47 class DataManagerColumn;
48 class SetupNewTable;
49 class Table;
50 class MultiFileBase;
51 class Record;
52 class IPosition;
53 class Slicer;
54 class RefRows;
55 template<class T> class Array;
56 class AipsIO;
57 
58 
59 // <summary>
60 // Define the type of the static construction function.
61 // </summary>
62 
63 // <use visibility=local>
64 
65 // <reviewed reviewer="Gareth Hunt" date="94Nov17" tests="">
66 // </reviewed>
67 
68 // <synopsis>
69 // Class names of data managers and pointers to their associated constructor
70 // function are registered in a static map to be able to create the correct
71 // data manager object from a string giving the type name of the data manager.
72 // DataManagerCtor is the type of the constructor functions.
73 // </synopsis>
74 // <group name=DataManagerCtor>
75 typedef DataManager* (*DataManagerCtor) (const String& dataManagerType,
76  const Record& spec);
77 // </group>
78 
79 
80 // <summary>
81 // Abstract base class for a data manager
82 // </summary>
83 
84 // <use visibility=local>
85 
86 // <reviewed reviewer="Gareth Hunt" date="94Nov17" tests="">
87 // </reviewed>
88 
89 // <prerequisite>
90 //# Classes you should understand before using this one.
91 // </prerequisite>
92 
93 // <synopsis>
94 // DataManager is the abstract base class for all kind of table data managers.
95 // There are currently 2 classes of data managers:
96 // <ul>
97 // <li> Storage managers handling the storage of data. These classes
98 // have to be derived from DataManager.
99 // StManAipsIO is an example of a storage manager.
100 // <li> Virtual column engines handling the on-the-fly calculation
101 // of data, which are not stored as such. The base class for
102 // these is VirtualColumnEngine (which is derived from DataManager),
103 // from which all virtual columns engine must be derived from.
104 // </ul>
105 // DataManager contains some common data and defines several virtual
106 // functions, which usually have to be implemented in the derived classes.
107 // It also contains some helper functions for the derived classes
108 // (like fileName().
109 //
110 // The actual handling of a column by the data manager is defined in
111 // the abstract base class
112 // <linkto class="DataManagerColumn:description">DataManagerColumn</linkto>.
113 // Each data manager must
114 // have an associated class (derived from DataManagerColumn) to
115 // handle the columns.
116 //
117 // There is a protocol defined how a data manager is created and
118 // initialized. For a new table it is:
119 // <ul>
120 // <li>
121 // The user creates data managers and binds them to columns. For example:
122 // <srcblock>
123 // SetupNewTable newtab("name.data", Table::New); // set up new table
124 // StManAipsIO stman; // define storage manager
125 // newtab.bindColumn ("column1", stman); // bind column to st.man.
126 // newtab.bindColumn ("column2", stman); // bind column to st.man.
127 // Table tab(newtab); // actually create table
128 // </srcblock>
129 // When the given data manager object is used for the first time in a bind
130 // function, a copy of the object is made using the clone function.
131 // Thus in the above example column1 and column2 share the same data
132 // manager; only at the first bind the stman object is cloned.
133 // Columns not explicitly bound to a data manager get implicitly bound
134 // to the default data manager (as defined in the column description)
135 // by the Table constructor (as used in line 5).
136 // <li>
137 // After binding the unbound columns, the PlainTable constructor sets up
138 // the data managers. For each column it asks the data manager to
139 // construct a DataManagerColumn object (in fact, an object of a class
140 // derived from DataManagerColumn). This is done by the functions
141 // createScalarColumn, createIndArrColumn and createDirArrColumn.
142 // For each data manager the create function is called. This allows
143 // them to initialize themselves and/or to call an initialization
144 // function in their column objects.
145 // This is, for instance, used by the storage managers to create files.
146 // Thereafter the prepare function is called to allow the data managers
147 // to do further initialization possibly requiring information from
148 // other columns.
149 // <li>
150 // When the table gets written (by the PlainTable destructor),
151 // the flush function is called for each data manager. This allows
152 // the data manager or their column objects to write or flush their data.
153 // The table system takes care of storing the information required
154 // to reconstruct the data managers. It uses the function dataManagerType
155 // to store the (unique) type name of the data manager class.
156 // <li>
157 // Finally each data manager object gets deleted. Their destructors
158 // must delete their column objects (if any and if needed).
159 // </ul>
160 // For an existing table the procedure is slightly different:
161 // <ul>
162 // <li>
163 // The statement
164 // <br><src> Table tab("name.data"); </src>
165 // will create a table object for an existing table. This has the effect
166 // that the given table file will be read to reconstruct the Table object
167 // and the data managers.
168 // <li>
169 // The stored data manager class names are used to reconstruct
170 // the data managers. This uses the static registration map, which
171 // maps the class name to a static class constructor function (usually
172 // called makeObject). This requires that the type name and constructor
173 // for each possible data manager are registered before the table
174 // is opened. The DataManager function registerMainCtor (implemented
175 // in DataManager.cc) is called before a table is opened, so registration
176 // of data managers should, in principle, be done there.
177 // <br>However, for unknown data managers it is tried to load a shared
178 // library whose name is the lowercase version of the data manager without a
179 // possible template argument (e.g. <src>bitflagsengine</src> for
180 // data manager <src>BitFlagsEngine<Int></src>).
181 // It can be preceeded by lib or libcasa_ and followed by .so or .dylib.
182 // The shared library has to have a function with a name like
183 // <src>register_bitflagsengine</src> that must register the data manager(s).
184 // The function must be declared as <src>extern "C"</src>, otherwise its
185 // name gets mangled.
186 // <li>
187 // Each table column is bound to the correct data manager. The sequence
188 // number stored in the table file is used for that purpose.
189 // <li>
190 // The DataManager createXXXColumn functions are called for each table
191 // column to let the data manager construct a data manager column object.
192 // <li>
193 // For each data manager the open function is called to allow it and
194 // its column objects to read back the information stored in the
195 // flush function.
196 // Thereafter the prepare function is called for each data manager
197 // to allow it to initialize some variables.
198 // The reason that open and prepare are separated is that in order to
199 // initialize variables it may be required to use other columns.
200 // So it may be needed that all columns are read back before they
201 // get initialized.
202 // <li>
203 // Similar to a new table the flush functions gets called when the
204 // table gets written. Destruction is also the same as sketched
205 // for new tables.
206 // </ul>
207 // </synopsis>
208 
209 // <motivation>
210 // An abstract base class is needed to support data managers and
211 // virtual column engines in the table system in a transparant way.
212 // </motivation>
213 
214 // <todo asof="$DATE:$">
215 //# A List of bugs, limitations, extensions or planned refinements.
216 // <li> Handle unregistered data managers in a better way.
217 // Instead of throwing an exception a subprocess could be
218 // started which represents the data manager.
219 // </todo>
220 
221 
223 {
224 friend class SetupNewTable;
225 friend class ColumnSet;
226 
227 public:
228 
229  // Default constructor.
230  DataManager();
231 
232  virtual ~DataManager();
233 
234  // Make a clone of the derived object.
235  virtual DataManager* clone() const = 0;
236 
237  // Return the name of the data manager. This is the name of this
238  // instantiation of the data manager, thus not its type name.
239  // By default it returns an empty string.
240  virtual String dataManagerName() const;
241 
242  // Return the type name of the data manager (in fact its class name).
243  // It has to be a unique name, thus if the class is templated
244  // the template parameter has to be part of the name.
245  // This is used by the open/flush mechanism to be able to reconstruct
246  // the correct data manager.
247  virtual String dataManagerType() const = 0;
248 
249  // Add SEQNR and SPEC (the DataManagerSpec subrecord) to the info.
250  void dataManagerInfo (Record& info) const;
251 
252  // Return a record containing data manager specifications.
253  // The default implementation returns an empty record.
254  virtual Record dataManagerSpec() const;
255 
256  // Get data manager properties that can be modified.
257  // It is a subset of the data manager specification.
258  // The default implementation returns an empty record.
259  virtual Record getProperties() const;
260 
261  // Modify data manager properties given in record fields. Only the
262  // properties as returned by getProperties are used, others are ignored.
263  // The default implementation does nothing.
264  virtual void setProperties (const Record& spec);
265 
266  // Is the data manager a storage manager?
267  // The default is yes.
268  virtual Bool isStorageManager() const;
269 
270  // Tell if the data manager wants to reallocate the data manager
271  // column objects.
272  // This is used by the tiling storage manager.
273  // By default it returns False.
274  virtual Bool canReallocateColumns() const;
275 
276  // Reallocate the column object if it is part of this data manager.
277  // It returns a pointer to the new column object.
278  // This function is used by the tiling storage manager.
279  // By default it does nothing and returns the input pointer.
281 
282  // Get the (unique) sequence nr of this data manager.
283  uInt sequenceNr() const
284  { return seqnr_p; }
285 
286  // Get the nr of columns in this data manager (can be zero).
287  uInt ncolumn() const
288  { return nrcol_p; }
289 
290  // Have the data to be stored in big or little endian canonical format?
292  { return asBigEndian_p; }
293 
294  // Get the TSM option.
295  const TSMOption& tsmOption() const
296  { return tsmOption_p; }
297 
298  // Get the MultiFile pointer (can be 0).
300  { return multiFile_p; }
301 
302  // Compose a keyword name from the given keyword appended with the
303  // sequence number (e.g. key_0).
304  // This makes the keyword name unique if multiple data managers
305  // are used with the same type.
306  String keywordName (const String& keyword) const;
307 
308  // Compose a unique filename from the table name and sequence number.
309  String fileName() const;
310 
311  // Get the AipsIO option of the underlying file.
313 
314  // Is this a regular storage manager?
315  // It is regular if it allows addition of rows and writing data in them.
316  // <br>The default implementation returns True.
317  virtual Bool isRegular() const;
318 
319  // Get the table this object is associated with.
320  Table& table() const
321  { return *table_p; }
322 
323  // Reopen the data manager for read/write access.
324  // By default it is assumed that a reopen for read/write does
325  // not have to do anything.
326  virtual void reopenRW();
327 
328  // Does the data manager allow to add rows? (default no)
329  virtual Bool canAddRow() const;
330 
331  // Does the data manager allow to delete rows? (default no)
332  virtual Bool canRemoveRow() const;
333 
334  // Does the data manager allow to add columns? (default no)
335  virtual Bool canAddColumn() const;
336 
337  // Does the data manager allow to delete columns? (default no)
338  virtual Bool canRemoveColumn() const;
339 
340  // Does the data manager allow to rename columns? (default yes)
341  virtual Bool canRenameColumn() const;
342 
343  // Set the maximum cache size (in bytes) to be used by a storage manager.
344  // The default implementation does nothing.
345  virtual void setMaximumCacheSize (uInt nbytes);
346 
347  // Show the data manager's IO statistics. By default it does nothing.
348  virtual void showCacheStatistics (std::ostream&) const;
349 
350  // Create a column in the data manager on behalf of a table column.
351  // It calls makeXColumn and checks the data type.
352  // <group>
353  // Create a scalar column.
354  // The <src>dataTypeId</src> argument is gives the id (i.e. name)
355  // of the data type of the column. It is only used for virtual
356  // columns of a non-standard data type to be able to check if
357  // the correctness of the column data type.
358  // <br>Storage managers only handle standard data types and
359  // can readily ignore this argument.
360  DataManagerColumn* createScalarColumn (const String& columnName,
361  int dataType,
362  const String& dataTypeId);
363  // Create a direct array column.
364  DataManagerColumn* createDirArrColumn (const String& columnName,
365  int dataType,
366  const String& dataTypeId);
367  // Create an indirect array column.
368  DataManagerColumn* createIndArrColumn (const String& columnName,
369  int dataType,
370  const String& dataTypeId);
371  // </group>
372 
373  // The data manager will be deleted (because all its columns are
374  // requested to be deleted).
375  // So clean up the things needed (e.g. delete files).
376  virtual void deleteManager() = 0;
377 
378 
379 protected:
380  // Decrement number of columns (in case a column is deleted).
382  { nrcol_p--; }
383 
384  // Tell the data manager if big or little endian format is needed.
385  void setEndian (Bool bigEndian)
386  { asBigEndian_p = bigEndian; }
387 
388  // Tell the data manager which TSM option to use.
389  void setTsmOption (const TSMOption& tsmOption);
390 
391  // Tell the data manager that MultiFile can be used.
392  // Because MultiFile cannot be used with mmapped files, it sets
393  // the TSMOption accordingly.
394  void setMultiFile (MultiFileBase* mfile);
395 
396  // Does the data manager support use of MultiFile?
397  // A derived class has to return True if it can use the MultiFile.
398  // The default implementation returns False.
399  virtual Bool hasMultiFileSupport() const;
400 
401  // Throw an exception in case data type is TpOther, because the
402  // storage managers (and maybe other data managers) do not support
403  // such columns.
404  void throwDataTypeOther (const String& columnName, int dataType) const;
405 
406 
407 private:
408  uInt nrcol_p; //# #columns in this st.man.
409  uInt seqnr_p; //# Unique nr of this st.man. in a Table
410  Bool asBigEndian_p; //# store data in big or little endian
412  MultiFileBase* multiFile_p; //# MultiFile to use; 0=no MultiFile
413  Table* table_p; //# Table this data manager belongs to
414  mutable DataManager* clone_p; //# Pointer to clone (used by SetupNewTab)
415 
416 
417  // The copy constructor cannot be used for this base class.
418  // The clone function should be used instead.
419  // The private declaration of this constructor makes it unusable.
420  DataManager (const DataManager&);
421 
422  // Assignment cannot be used for this base class.
423  // The private declaration of this operator makes it unusable.
425 
426  // Create a column in the data manager on behalf of a table column.
427  //# Should be private, but has to be public because friend
428  //# declaration gave internal CFront error.
429  // <group>
430  // Create a scalar column.
431  virtual DataManagerColumn* makeScalarColumn (const String& columnName,
432  int dataType,
433  const String& dataTypeId) = 0;
434  // Create a direct array column.
435  virtual DataManagerColumn* makeDirArrColumn (const String& columnName,
436  int dataType,
437  const String& dataTypeId) = 0;
438  // Create an indirect array column.
439  virtual DataManagerColumn* makeIndArrColumn (const String& columnName,
440  int dataType,
441  const String& dataTypeId) = 0;
442  // </group>
443 
444  // Check if the data type of the created data manager column is correct.
445  void checkDataType (const DataManagerColumn* colPtr,
446  const String& columnName,
447  int dataType, const String& dataTypeId) const;
448 
449  // Add rows to all columns.
450  // The default implementation throws a "not possible" exception.
451  virtual void addRow (uInt nrrow);
452 
453  // Delete a row from all columns.
454  // The default implementation throws a "not possible" exception.
455  virtual void removeRow (uInt rownr);
456 
457  // Add a column.
458  // The default implementation throws a "not possible" exception.
459  virtual void addColumn (DataManagerColumn*);
460 
461  // Delete a column.
462  // The default implementation throws a "not possible" exception.
463  virtual void removeColumn (DataManagerColumn*);
464 
465  // Set the sequence number of this data manager.
466  void setSeqnr (uInt nr)
467  { seqnr_p = nr; }
468 
469  // Link the data manager to the Table object.
470  void linkToTable (Table& tab);
471 
472  // Flush and optionally fsync the data.
473  // The AipsIO stream represents the main table file and can be
474  // used by virtual column engines to store SMALL amounts of data.
475  // It returns a True status if it had to flush (i.e. if data have changed).
476  virtual Bool flush (AipsIO& ios, Bool fsync) = 0;
477 
478  // Let the data manager initialize itself for a new table.
479  virtual void create (uInt nrrow) = 0;
480 
481  // Let the data manager initialize itself for an existing table.
482  // The AipsIO stream represents the main table file and must be
483  // used by virtual column engines to retrieve the data stored
484  // in the flush function.
485  virtual void open (uInt nrrow, AipsIO& ios) = 0;
486 
487  // Open as above.
488  // The data manager can return the number of rows it thinks there are.
489  // This is particularly useful for data managers like LofarStMan whose
490  // data are written outside the table system, thus for which no rows
491  // have been added.
492  // <br>By default it calls open and returns <src>nrrow</src>.
493  virtual uInt open1 (uInt nrrow, AipsIO& ios);
494 
495  // Resync the data by rereading cached data from the file.
496  // This is called when a lock is acquired on the file and it appears
497  // that data in this data manager has been changed by another process.
498  virtual void resync (uInt nrrow) = 0;
499 
500  // Resync as above.
501  // The data manager can return the number of rows it thinks there are.
502  // This is particularly useful for data managers like LofarStMan whose
503  // data are written outside the table system, thus for which no rows
504  // have been added.
505  // <br>By default it calls resync and returns <src>nrrow</src>.
506  virtual uInt resync1 (uInt nrrow);
507 
508  // Let the data manager initialize itself further.
509  // Prepare is called after create/open has been called for all
510  // columns. In this way one can be sure that referenced columns
511  // are read back and partly initialized.
512  // The default implementation does nothing.
513  virtual void prepare();
514 
515  // Declare the mapping of the data manager type name to a static
516  // "makeObject" function.
519 
520 public:
521  // Has the object already been cloned?
523  { return clone_p; }
524 
525  // Set the pointer to the clone.
526  void setClone (DataManager* clone) const
527  { clone_p = clone; }
528 
529  // Register a mapping of a data manager type to its static construction
530  // function. It is fully thread-safe.
531  static void registerCtor (const String& type, DataManagerCtor func);
532 
533  // Get the "constructor" of a data manager (thread-safe).
534  static DataManagerCtor getCtor (const String& dataManagerType);
535 
536  // Test if a data manager is registered (thread-safe).
537  static Bool isRegistered (const String& dataManagerType);
538 
539  // Serve as default function for theirRegisterMap, which catches all
540  // unknown data manager types.
541  // <thrown>
542  // <li> TableUnknownDataManager
543  // </thrown>
544  static DataManager* unknownDataManager (const String& dataManagerType,
545  const Record& spec);
546 
547 private:
548  // Register the main data managers.
550 };
551 
552 
553 
554 
555 // <summary>
556 // Abstract base class for a column in a data manager
557 // </summary>
558 
559 // <use visibility=local>
560 
561 // <reviewed reviewer="Gareth Hunt" date="94Nov17" tests="">
562 // </reviewed>
563 
564 // <prerequisite>
565 //# Classes you should understand before using this one.
566 // <li> DataManager
567 // </prerequisite>
568 
569 // <etymology>
570 // DataManagerColumn handles a column for a data manager.
571 // </etymology>
572 
573 // <synopsis>
574 // DataManagerColumn is the abstract base class to handle a column in
575 // a data manager. Each data manager class must have one or more associated
576 // classes derived from DataManagerColumn to handle the columns.
577 // For example, storage manager StManAipsIO has columns classes
578 // StManColumnAipsIO, StManColumnArrayAipsIO and StManColumnIndArrayAipsIO
579 // to handle scalars, direct arrays and indirect arrays, resp..
580 // However, using multiple inheritance it is possible that the derived
581 // DataManager and DataManagerColumn classes are the same. This is used
582 // in class ScaledArrayEngine<S,T> which represents both the data manager
583 // and its column class. It can do that, because the virtual column engine
584 // <linkto class="ScaledArrayEngine:description">ScaledArrayEngine</linkto>
585 // can handle only one column.
586 //
587 // In the synopsis of class DataManager it is described how the (derived)
588 // DataManagerColumn objects gets created and deleted.
589 //
590 // DataManagerColumn defines various virtual functions to get or put (slices)
591 // of data in a column. These functions are called by the table column
592 // classes ScalarColumnData and ArrayColumnData.
593 // It does not define functions create, open, flush and prepare like
594 // those defined in DataManager. It is left to the derived classes to
595 // define those as needed and to interact properly with their
596 // data manager object.
597 // </synopsis>
598 
599 // <motivation>
600 // An abstract base class is needed to support multiple data
601 // managers in the table system
602 // </motivation>
603 
604 // <todo asof="$DATE:$">
605 //# A List of bugs, limitations, extensions or planned refinements.
606 // </todo>
607 
608 
610 {
611 public:
612 
613  // Create a column.
615  : isFixedShape_p(False) {;}
616 
617  // Frees up the storage.
618  virtual ~DataManagerColumn();
619 
620  // Set the isFixedShape flag.
621  void setIsFixedShape (Bool isFixedShape)
622  { isFixedShape_p = isFixedShape; }
623 
624  // Is this a fixed shape column?
626  { return isFixedShape_p; }
627 
628  // Get the data type of the column as defined in DataType.h.
629  virtual int dataType() const = 0;
630 
631  // Get the data type id of the column for dataType==TpOther.
632  // The default implementation returns an emptry string.
633  // This function is required for virtual column engines handling
634  // non-standard data types. It is used to check the data type.
635  virtual String dataTypeId() const;
636 
637  // Test if data can be put into this column.
638  // This does not test if the data file is writable, only if
639  // it is in principle allowed to store data into the column.
640  // (It may not be allowed for virtual columns).
641  // The default is True.
642  virtual Bool isWritable() const;
643 
644  // Set the maximum length of the value (can be used for strings).
645  // By default the maximum length is ignored.
646  virtual void setMaxLength (uInt maxLength);
647 
648  // Set the shape of all (fixed-shaped) arrays in the column.
649  // Effectively it is the same as setShapeColumn, but it also sets
650  // the isFixedShape_p flag.
652  { setShapeColumn (shape); isFixedShape_p = True; }
653 
654  // Set the shape of an (variable-shaped) array in the given row.
655  // By default it throws a "not possible" exception.
656  virtual void setShape (uInt rownr, const IPosition& shape);
657 
658  // Set the shape and tile shape of an (variable-shaped) array
659  // in the given row.
660  // By default it ignores the tile shape (thus only sets the shape).
661  virtual void setShapeTiled (uInt rownr, const IPosition& shape,
662  const IPosition& tileShape);
663 
664  // Is the value shape defined in the given row?
665  // By default it returns True.
666  virtual Bool isShapeDefined (uInt rownr);
667 
668  // Get the dimensionality of the item in the given row.
669  // By default it returns shape(rownr).nelements().
670  virtual uInt ndim (uInt rownr);
671 
672  // Get the shape of the item in the given row.
673  // By default it returns a zero-length IPosition (for a scalar value).
674  virtual IPosition shape (uInt rownr);
675 
676  // Get the tile shape of the item in the given row.
677  // By default it returns a zero-length IPosition.
678  virtual IPosition tileShape (uInt rownr);
679 
680  // Can the data manager handle chaging the shape of an existing array?
681  // Default is no.
682  virtual Bool canChangeShape() const;
683 
684  // Can the column data manager handle access to a scalar column?
685  // If not, the caller should access the column by looping through
686  // all cells in the column.
687  // Default is no.
688  // <br>
689  // The returned reask switch determines if the information is
690  // permanent. False indicates it is permanent; True indicates it
691  // will be reasked for the next get/putColumn.
692  // By default reask is set to False.
693  virtual Bool canAccessScalarColumn (Bool& reask) const;
694 
695  // Can the column data manager handle access to a clooection of cells
696  // in a scalar column?
697  // If not, the caller should access the column cells by looping through
698  // the cells in the column.
699  // Default is no.
700  // <br>
701  // The returned reask switch determines if the information is
702  // permanent. False indicates it is permanent; True indicates it
703  // will be reasked for the next get/putColumn.
704  // By default reask is set to False.
705  virtual Bool canAccessScalarColumnCells (Bool& reask) const;
706 
707  // Can the column data manager handle access to a scalar column?
708  // If not, the caller should access the column by looping through
709  // all cells in the column.
710  // Default is no.
711  // <br>
712  // The returned reask switch determines if the information is
713  // permanent. False indicates it is permanent; True indicates it
714  // will be reasked for the next get/putColumn.
715  // By default reask is set to False.
716  virtual Bool canAccessArrayColumn (Bool& reask) const;
717 
718  // Can the column data manager handle access to a collection of cells
719  // in an array column?
720  // If not, the caller should access the column cells by looping through
721  // the cells in the column.
722  // Default is no.
723  // <br>
724  // The returned reask switch determines if the information is
725  // permanent. False indicates it is permanent; True indicates it
726  // will be reasked for the next get/putColumn.
727  // By default reask is set to False.
728  virtual Bool canAccessArrayColumnCells (Bool& reask) const;
729 
730  // Can the column data manager handle access to a cell slice?
731  // If not, the caller should do slicing itself (by accessing the
732  // entire array and slicing it).
733  // Default is no.
734  // <br>
735  // The returned reask switch determines if the information is
736  // permanent. False indicates it is permanent; True indicates it
737  // will be reasked for the next get/putColumn.
738  // By default reask is set to False.
739  virtual Bool canAccessSlice (Bool& reask) const;
740 
741  // Can the column data manager handle access to a column slice?
742  // If not, the caller should access the column slice by looping through
743  // all cell slices in the column.
744  // Default is no.
745  // <br>
746  // The returned reask switch determines if the information is
747  // permanent. False indicates it is permanent; True indicates it
748  // will be reasked for the next get/putColumn.
749  // By default reask is set to False.
750  virtual Bool canAccessColumnSlice (Bool& reask) const;
751 
752  // Get access to the ColumnCache object.
753  // <group>
755  { return colCache_p; }
757  { return &colCache_p; }
758  // </group>
759 
760  // Get the scalar value in the given row.
761  // These functions are non-virtual and are converted to their
762  // virtual getV equivalent to achieve that a derived templated class
763  //(like VirtualScalarColumn) does not have to declare and implement
764  // all these functions.
765  // The compiler complains about hiding virtual functions if you do not
766  // declare all virtual functions with the same name in a derived class.
767  // <group>
768  void get (uInt rownr, Bool* dataPtr)
769  { getBoolV (rownr, dataPtr); }
770  void get (uInt rownr, uChar* dataPtr)
771  { getuCharV (rownr, dataPtr); }
772  void get (uInt rownr, Short* dataPtr)
773  { getShortV (rownr, dataPtr); }
774  void get (uInt rownr, uShort* dataPtr)
775  { getuShortV (rownr, dataPtr); }
776  void get (uInt rownr, Int* dataPtr)
777  { getIntV (rownr, dataPtr); }
778  void get (uInt rownr, uInt* dataPtr)
779  { getuIntV (rownr, dataPtr); }
780  void get (uInt rownr, float* dataPtr)
781  { getfloatV (rownr, dataPtr); }
782  void get (uInt rownr, double* dataPtr)
783  { getdoubleV (rownr, dataPtr); }
784  void get (uInt rownr, Complex* dataPtr)
785  { getComplexV (rownr, dataPtr); }
786  void get (uInt rownr, DComplex* dataPtr)
787  { getDComplexV (rownr, dataPtr); }
788  void get (uInt rownr, String* dataPtr)
789  { getStringV (rownr, dataPtr); }
790  // This function is the get for all non-standard data types.
791  void get (uInt rownr, void* dataPtr)
792  { getOtherV (rownr, dataPtr); }
793  // </group>
794 
795  // Put the scalar value into the given row.
796  // These functions are non-virtual and are converted to their
797  // virtual putV equivalent to achieve that a derived templated class
798  //(like VirtualScalarColumn) does not have to declare and implement
799  // all these functions.
800  // The compiler complains about hiding virtual functions if you do not
801  // declare all virtual functions with the same name in a derived class.
802  // <group>
803  void put (uInt rownr, const Bool* dataPtr)
804  { putBoolV (rownr, dataPtr); }
805  void put (uInt rownr, const uChar* dataPtr)
806  { putuCharV (rownr, dataPtr); }
807  void put (uInt rownr, const Short* dataPtr)
808  { putShortV (rownr, dataPtr); }
809  void put (uInt rownr, const uShort* dataPtr)
810  { putuShortV (rownr, dataPtr); }
811  void put (uInt rownr, const Int* dataPtr)
812  { putIntV (rownr, dataPtr); }
813  void put (uInt rownr, const uInt* dataPtr)
814  { putuIntV (rownr, dataPtr); }
815  void put (uInt rownr, const float* dataPtr)
816  { putfloatV (rownr, dataPtr); }
817  void put (uInt rownr, const double* dataPtr)
818  { putdoubleV (rownr, dataPtr); }
819  void put (uInt rownr, const Complex* dataPtr)
820  { putComplexV (rownr, dataPtr); }
821  void put (uInt rownr, const DComplex* dataPtr)
822  { putDComplexV (rownr, dataPtr); }
823  void put (uInt rownr, const String* dataPtr)
824  { putStringV (rownr, dataPtr); }
825  // This function is the put for all non-standard data types.
826  void put (uInt rownr, const void* dataPtr)
827  { putOtherV (rownr, dataPtr); }
828  // </group>
829 
830  // Get all scalar values in the column.
831  // The argument dataPtr is in fact a Vector<T>*, but a void*
832  // is needed to be generic.
833  // The vector pointed to by dataPtr has to have the correct length
834  // (which is guaranteed by the ScalarColumn getColumn function).
835  // The default implementation throws an "invalid operation" exception.
836  virtual void getScalarColumnV (void* dataPtr);
837 
838  // Put all scalar values in the column.
839  // The argument dataPtr is in fact a const Vector<T>*, but a const void*
840  // is needed to be generic.
841  // The vector pointed to by dataPtr has to have the correct length
842  // (which is guaranteed by the ScalarColumn putColumn function).
843  // The default implementation throws an "invalid operation" exception.
844  virtual void putScalarColumnV (const void* dataPtr);
845 
846  // Get some scalar values in the column.
847  // The argument dataPtr is in fact a Vector<T>*, but a void*
848  // is needed to be generic.
849  // The vector pointed to by dataPtr has to have the correct length
850  // (which is guaranteed by the ScalarColumn getColumn function).
851  // The default implementation throws an "invalid operation" exception.
852  virtual void getScalarColumnCellsV (const RefRows& rownrs,
853  void* dataPtr);
854 
855  // Put some scalar values in the column.
856  // The argument dataPtr is in fact a const Vector<T>*, but a const void*
857  // is needed to be generic.
858  // The vector pointed to by dataPtr has to have the correct length
859  // (which is guaranteed by the ScalarColumn getColumn function).
860  // The default implementation throws an "invalid operation" exception.
861  virtual void putScalarColumnCellsV (const RefRows& rownrs,
862  const void* dataPtr);
863 
864  // Get scalars from the given row on with a maximum of nrmax values.
865  // It returns the actual number of values got.
866  // This can be used to get an entire column of scalars or to get
867  // a part of a column (for a cache for example).
868  // The argument dataPtr is in fact a T*, but a void*
869  // is needed to be generic.
870  // The default implementation throws an "invalid operation" exception.
871  virtual uInt getBlockV (uInt rownr, uInt nrmax, void* dataPtr);
872 
873  // Put nrmax scalars from the given row on.
874  // It returns the actual number of values put.
875  // This can be used to put an entire column of scalars or to put
876  // a part of a column (for a cache for example).
877  // The argument dataPtr is in fact a const T*, but a const void*
878  // is needed to be generic.
879  // The default implementation throws an "invalid operation" exception.
880  virtual void putBlockV (uInt rownr, uInt nrmax, const void* dataPtr);
881 
882  // Get the array value in the given row.
883  // The argument dataPtr is in fact an Array<T>*, but a void*
884  // is needed to be generic.
885  // The array pointed to by dataPtr has to have the correct shape
886  // (which is guaranteed by the ArrayColumn get function).
887  // The default implementation throws an "invalid operation" exception.
888  virtual void getArrayV (uInt rownr, void* dataPtr);
889 
890  // Put the array value into the given row.
891  // The argument dataPtr is in fact a const Array<T>*, but a const void*
892  // is needed to be generic.
893  // The array pointed to by dataPtr has to have the correct shape
894  // (which is guaranteed by the ArrayColumn put function).
895  // The default implementation throws an "invalid operation" exception.
896  virtual void putArrayV (uInt rownr, const void* dataPtr);
897 
898  // Get all array values in the column.
899  // The argument dataPtr is in fact an Array<T>*, but a void*
900  // is needed to be generic.
901  // The vector pointed to by dataPtr has to have the correct length
902  // (which is guaranteed by the ArrayColumn getColumn function).
903  // The default implementation throws an "invalid operation" exception.
904  virtual void getArrayColumnV (void* dataPtr);
905 
906  // Put all array values in the column.
907  // The argument dataPtr is in fact a const Array<T>*, but a const void*
908  // is needed to be generic.
909  // The vector pointed to by dataPtr has to have the correct length
910  // (which is guaranteed by the ArrayColumn putColumn function).
911  // The default implementation throws an "invalid operation" exception.
912  virtual void putArrayColumnV (const void* dataPtr);
913 
914  // Get some array values in the column.
915  // The argument dataPtr is in fact an Array<T>*, but a void*
916  // is needed to be generic.
917  // The vector pointed to by dataPtr has to have the correct length
918  // (which is guaranteed by the ArrayColumn getColumn function).
919  // The default implementation throws an "invalid operation" exception.
920  virtual void getArrayColumnCellsV (const RefRows& rownrs,
921  void* dataPtr);
922 
923  // Put some array values in the column.
924  // The argument dataPtr is in fact an const Array<T>*, but a const void*
925  // is needed to be generic.
926  // The vector pointed to by dataPtr has to have the correct length
927  // (which is guaranteed by the ArrayColumn getColumn function).
928  // The default implementation throws an "invalid operation" exception.
929  virtual void putArrayColumnCellsV (const RefRows& rownrs,
930  const void* dataPtr);
931 
932  // Get a section of the array in the given row.
933  // The argument dataPtr is in fact an Array<T>*, but a void*
934  // is needed to be generic.
935  // The array pointed to by dataPtr has to have the correct shape
936  // (which is guaranteed by the ArrayColumn getSlice function).
937  // The default implementation throws an "invalid operation" exception.
938  virtual void getSliceV (uInt rownr, const Slicer& slicer, void* dataPtr);
939 
940  // Put into a section of the array in the given row.
941  // The argument dataPtr is in fact a const Array<T>*, but a const void*
942  // is needed to be generic.
943  // The array pointed to by dataPtr has to have the correct shape
944  // (which is guaranteed by the ArrayColumn putSlice function).
945  // The default implementation throws an "invalid operation" exception.
946  virtual void putSliceV (uInt rownr, const Slicer& slicer,
947  const void* dataPtr);
948 
949  // Get a section of all arrays in the column.
950  // The argument dataPtr is in fact an Array<T>*, but a void*
951  // is needed to be generic.
952  // The array pointed to by dataPtr has to have the correct shape
953  // (which is guaranteed by the ArrayColumn getColumn function).
954  // The default implementation throws an "invalid operation" exception.
955  virtual void getColumnSliceV (const Slicer& slicer, void* dataPtr);
956 
957  // Put into a section of all arrays in the column.
958  // The argument dataPtr is in fact a const Array<T>*, but a const void*
959  // is needed to be generic.
960  // The array pointed to by dataPtr has to have the correct shape
961  // (which is guaranteed by the ArrayColumn putColumn function).
962  // The default implementation throws an "invalid operation" exception.
963  virtual void putColumnSliceV (const Slicer& slicer, const void* dataPtr);
964 
965  // Get a section of some arrays in the column.
966  // The argument dataPtr is in fact an Array<T>*, but a void*
967  // is needed to be generic.
968  // The array pointed to by dataPtr has to have the correct shape
969  // (which is guaranteed by the ArrayColumn getColumn function).
970  // The default implementation throws an "invalid operation" exception.
971  virtual void getColumnSliceCellsV (const RefRows& rownrs,
972  const Slicer& slicer, void* dataPtr);
973 
974  // Put into a section of some arrays in the column.
975  // The argument dataPtr is in fact a const Array<T>*, but a const void*
976  // is needed to be generic.
977  // The array pointed to by dataPtr has to have the correct shape
978  // (which is guaranteed by the ArrayColumn putColumn function).
979  // The default implementation throws an "invalid operation" exception.
980  virtual void putColumnSliceCellsV (const RefRows& rownrs,
981  const Slicer& slicer,
982  const void* dataPtr);
983 
984  // Throw an "invalid operation" exception for the default
985  // implementation of get.
986  void throwGet() const;
987 
988  // Throw an "invalid operation" exception for the default
989  // implementation of put.
990  void throwPut() const;
991 
992  // Set the column name.
993  void setColumnName (const String& colName)
994  { colName_p = colName; }
995 
996  // Get rhe column name.
997  const String& columnName() const
998  { return colName_p; }
999 
1000 protected:
1001  // Get the scalar value in the given row.
1002  // The default implementation throws an "invalid operation" exception.
1003  // <group>
1004  virtual void getBoolV (uInt rownr, Bool* dataPtr);
1005  virtual void getuCharV (uInt rownr, uChar* dataPtr);
1006  virtual void getShortV (uInt rownr, Short* dataPtr);
1007  virtual void getuShortV (uInt rownr, uShort* dataPtr);
1008  virtual void getIntV (uInt rownr, Int* dataPtr);
1009  virtual void getuIntV (uInt rownr, uInt* dataPtr);
1010  virtual void getfloatV (uInt rownr, float* dataPtr);
1011  virtual void getdoubleV (uInt rownr, double* dataPtr);
1012  virtual void getComplexV (uInt rownr, Complex* dataPtr);
1013  virtual void getDComplexV (uInt rownr, DComplex* dataPtr);
1014  virtual void getStringV (uInt rownr, String* dataPtr);
1015  // This function is the get for all non-standard data types.
1016  virtual void getOtherV (uInt rownr, void* dataPtr);
1017  // </group>
1018 
1019  // Put the scalar value into the given row.
1020  // The default implementation throws an "invalid operation" exception.
1021  // <group>
1022  virtual void putBoolV (uInt rownr, const Bool* dataPtr);
1023  virtual void putuCharV (uInt rownr, const uChar* dataPtr);
1024  virtual void putShortV (uInt rownr, const Short* dataPtr);
1025  virtual void putuShortV (uInt rownr, const uShort* dataPtr);
1026  virtual void putIntV (uInt rownr, const Int* dataPtr);
1027  virtual void putuIntV (uInt rownr, const uInt* dataPtr);
1028  virtual void putfloatV (uInt rownr, const float* dataPtr);
1029  virtual void putdoubleV (uInt rownr, const double* dataPtr);
1030  virtual void putComplexV (uInt rownr, const Complex* dataPtr);
1031  virtual void putDComplexV (uInt rownr, const DComplex* dataPtr);
1032  virtual void putStringV (uInt rownr, const String* dataPtr);
1033  // This function is the put for all non-standard data types.
1034  virtual void putOtherV (uInt rownr, const void* dataPtr);
1035  // </group>
1036 
1037 private:
1041 
1042  // Set the shape of all (fixed-shaped) arrays in the column.
1043  // By default it throws a "not possible" exception.
1044  virtual void setShapeColumn (const IPosition& shape);
1045 
1046  // The copy constructor cannot be used for this base class.
1047  // The private declaration of this constructor makes it unusable.
1049 
1050  // Assignment cannot be used for this base class.
1051  // The private declaration of this operator makes it unusable.
1053 };
1054 
1055 
1056 
1057 } //# NAMESPACE CASACORE - END
1058 
1059 #endif
void put(uInt rownr, const uInt *dataPtr)
Definition: DataManager.h:813
A Vector of integers, for indexing into Array<T> objects.
Definition: IPosition.h:119
void setMultiFile(MultiFileBase *mfile)
Tell the data manager that MultiFile can be used.
void setColumnName(const String &colName)
Set the column name.
Definition: DataManager.h:993
virtual Bool canRenameColumn() const
Does the data manager allow to rename columns? (default yes)
const TSMOption & tsmOption() const
Get the TSM option.
Definition: DataManager.h:295
int Int
Definition: aipstype.h:50
static void registerCtor(const String &type, DataManagerCtor func)
Register a mapping of a data manager type to its static construction function.
void setFixedShapeColumn(const IPosition &shape)
Set the shape of all (fixed-shaped) arrays in the column.
Definition: DataManager.h:651
Create a new table - define shapes, data managers, etc.
Definition: SetupNewTab.h:346
void throwDataTypeOther(const String &columnName, int dataType) const
Throw an exception in case data type is TpOther, because the storage managers (and maybe other data m...
Bool isFixedShape() const
Is this a fixed shape column?
Definition: DataManager.h:625
ColumnCache colCache_p
Definition: ConcatColumn.h:293
Main interface class to a read/write table.
Definition: Table.h:153
void put(uInt rownr, const double *dataPtr)
Definition: DataManager.h:817
void decrementNcolumn()
Decrement number of columns (in case a column is deleted).
Definition: DataManager.h:381
const ColumnCache * columnCachePtr() const
Definition: DataManager.h:756
virtual uInt open1(uInt nrrow, AipsIO &ios)
Open as above.
virtual Bool flush(AipsIO &ios, Bool fsync)=0
Flush and optionally fsync the data.
virtual Record getProperties() const
Get data manager properties that can be modified.
Abstract base class to combine multiple files in a single one.
virtual Bool isRegular() const
Is this a regular storage manager? It is regular if it allows addition of rows and writing data in th...
AipsIO is the object persistency mechanism of Casacore.
Definition: AipsIO.h:168
virtual void removeRow(uInt rownr)
Delete a row from all columns.
virtual void showCacheStatistics(std::ostream &) const
Show the data manager&#39;s IO statistics.
Abstract base class for a column in a data manager.
Definition: DataManager.h:609
void put(uInt rownr, const Int *dataPtr)
Definition: DataManager.h:811
virtual void open(uInt nrrow, AipsIO &ios)=0
Let the data manager initialize itself for an existing table.
virtual void reopenRW()
Reopen the data manager for read/write access.
virtual Bool canRemoveColumn() const
Does the data manager allow to delete columns? (default no)
unsigned char uChar
Definition: aipstype.h:47
void put(uInt rownr, const void *dataPtr)
This function is the put for all non-standard data types.
Definition: DataManager.h:826
static DataManagerCtor getCtor(const String &dataManagerType)
Get the "constructor" of a data manager (thread-safe).
const String & columnName() const
Get rhe column name.
Definition: DataManager.h:997
virtual void deleteManager()=0
The data manager will be deleted (because all its columns are requested to be deleted).
virtual Bool canRemoveRow() const
Does the data manager allow to delete rows? (default no)
virtual void setMaximumCacheSize(uInt nbytes)
Set the maximum cache size (in bytes) to be used by a storage manager.
virtual Bool canAddColumn() const
Does the data manager allow to add columns? (default no)
virtual void addRow(uInt nrrow)
Add rows to all columns.
MultiFileBase * multiFile()
Get the MultiFile pointer (can be 0).
Definition: DataManager.h:299
void put(uInt rownr, const Bool *dataPtr)
Put the scalar value into the given row.
Definition: DataManager.h:803
uInt ncolumn() const
Get the nr of columns in this data manager (can be zero).
Definition: DataManager.h:287
Class to manage a set of table columns.
Definition: ColumnSet.h:93
DataManagerColumn * createIndArrColumn(const String &columnName, int dataType, const String &dataTypeId)
Create an indirect array column.
ColumnCache & columnCache()
Get access to the ColumnCache object.
Definition: DataManager.h:754
uInt sequenceNr() const
Get the (unique) sequence nr of this data manager.
Definition: DataManager.h:283
Bool asBigEndian() const
Have the data to be stored in big or little endian canonical format?
Definition: DataManager.h:291
short Short
Definition: aipstype.h:48
Table & table() const
Get the table this object is associated with.
Definition: DataManager.h:320
void dataManagerInfo(Record &info) const
Add SEQNR and SPEC (the DataManagerSpec subrecord) to the info.
DataManager * getClone() const
Has the object already been cloned?
Definition: DataManager.h:522
static SimpleOrderedMap< String, DataManagerCtor > initRegisterMap()
Register the main data managers.
static Bool isRegistered(const String &dataManagerType)
Test if a data manager is registered (thread-safe).
Simple map with keys ordered.
Definition: SimOrdMap.h:69
DataManagerColumn()
Create a column.
Definition: DataManager.h:614
void put(uInt rownr, const DComplex *dataPtr)
Definition: DataManager.h:821
DataManager * clone_p
Definition: DataManager.h:414
ByteIO::OpenOption fileOption() const
Get the AipsIO option of the underlying file.
virtual DataManagerColumn * makeScalarColumn(const String &columnName, int dataType, const String &dataTypeId)=0
Create a column in the data manager on behalf of a table column.
virtual void resync(uInt nrrow)=0
Resync the data by rereading cached data from the file.
void checkDataType(const DataManagerColumn *colPtr, const String &columnName, int dataType, const String &dataTypeId) const
Check if the data type of the created data manager column is correct.
Class holding the row numbers in a RefTable.
Definition: RefRows.h:85
LatticeExprNode ndim(const LatticeExprNode &expr)
1-argument function to get the dimensionality of a lattice.
void put(uInt rownr, const float *dataPtr)
Definition: DataManager.h:815
virtual DataManagerColumn * makeIndArrColumn(const String &columnName, int dataType, const String &dataTypeId)=0
Create an indirect array column.
virtual void setProperties(const Record &spec)
Modify data manager properties given in record fields.
void setTsmOption(const TSMOption &tsmOption)
Tell the data manager which TSM option to use.
static Mutex theirMutex
Definition: DataManager.h:518
virtual void prepare()
Let the data manager initialize itself further.
DataManager & operator=(const DataManager &)
Assignment cannot be used for this base class.
Options for the Tiled Storage Manager Access.
Definition: TSMOption.h:116
static SimpleOrderedMap< String, DataManagerCtor > theirRegisterMap
Declare the mapping of the data manager type name to a static "makeObject" function.
Definition: DataManager.h:517
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
void setClone(DataManager *clone) const
Set the pointer to the clone.
Definition: DataManager.h:526
void linkToTable(Table &tab)
Link the data manager to the Table object.
void put(uInt rownr, const uChar *dataPtr)
Definition: DataManager.h:805
virtual void removeColumn(DataManagerColumn *)
Delete a column.
A caching object for a table column.
Definition: ColumnCache.h:83
virtual Bool isStorageManager() const
Is the data manager a storage manager? The default is yes.
virtual DataManagerColumn * reallocateColumn(DataManagerColumn *column)
Reallocate the column object if it is part of this data manager.
const Bool False
Definition: aipstype.h:44
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
Definition: ExprNode.h:2163
void put(uInt rownr, const Short *dataPtr)
Definition: DataManager.h:807
virtual Bool hasMultiFileSupport() const
Does the data manager support use of MultiFile? A derived class has to return True if it can use the ...
virtual DataManagerColumn * makeDirArrColumn(const String &columnName, int dataType, const String &dataTypeId)=0
Create a direct array column.
virtual void create(uInt nrrow)=0
Let the data manager initialize itself for a new table.
Specify which elements to extract from an n-dimensional array.
Definition: Slicer.h:289
Wrapper around a pthreads mutex.
Definition: Mutex.h:58
DataManager()
Default constructor.
virtual String dataManagerType() const =0
Return the type name of the data manager (in fact its class name).
virtual DataManager * clone() const =0
Make a clone of the derived object.
virtual void addColumn(DataManagerColumn *)
Add a column.
void put(uInt rownr, const uShort *dataPtr)
Definition: DataManager.h:809
OpenOption
Define the possible ByteIO open options.
Definition: ByteIO.h:65
Abstract base class for a data manager.
Definition: DataManager.h:222
virtual Bool canAddRow() const
Does the data manager allow to add rows? (default no)
void setIsFixedShape(Bool isFixedShape)
Set the isFixedShape flag.
Definition: DataManager.h:621
virtual uInt resync1(uInt nrrow)
Resync as above.
String fileName() const
Compose a unique filename from the table name and sequence number.
void setEndian(Bool bigEndian)
Tell the data manager if big or little endian format is needed.
Definition: DataManager.h:385
void put(uInt rownr, const String *dataPtr)
Definition: DataManager.h:823
void put(uInt rownr, const Complex *dataPtr)
Definition: DataManager.h:819
String: the storage and methods of handling collections of characters.
Definition: String.h:223
virtual Record dataManagerSpec() const
Return a record containing data manager specifications.
MultiFileBase * multiFile_p
Definition: DataManager.h:412
DataManagerColumn * createDirArrColumn(const String &columnName, int dataType, const String &dataTypeId)
Create a direct array column.
DataManagerColumn * createScalarColumn(const String &columnName, int dataType, const String &dataTypeId)
Create a column in the data manager on behalf of a table column.
virtual String dataManagerName() const
Return the name of the data manager.
void setSeqnr(uInt nr)
Set the sequence number of this data manager.
Definition: DataManager.h:466
const Bool True
Definition: aipstype.h:43
this file contains all the compiler specific defines
Definition: mainpage.dox:28
virtual Bool canReallocateColumns() const
Tell if the data manager wants to reallocate the data manager column objects.
static DataManager * unknownDataManager(const String &dataManagerType, const Record &spec)
Serve as default function for theirRegisterMap, which catches all unknown data manager types...
unsigned int uInt
Definition: aipstype.h:51
unsigned short uShort
Definition: aipstype.h:49
String keywordName(const String &keyword) const
Compose a keyword name from the given keyword appended with the sequence number (e.g.