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
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  // Set the maximum cache size (in bytes) to be used by a storage manager.
341  // The default implementation does nothing.
342  virtual void setMaximumCacheSize (uInt nbytes);
343 
344  // Show the data manager's IO statistics. By default it does nothing.
345  virtual void showCacheStatistics (std::ostream&) const;
346 
347  // Create a column in the data manager on behalf of a table column.
348  // It calls makeXColumn and checks the data type.
349  // <group>
350  // Create a scalar column.
351  // The <src>dataTypeId</src> argument is gives the id (i.e. name)
352  // of the data type of the column. It is only used for virtual
353  // columns of a non-standard data type to be able to check if
354  // the correctness of the column data type.
355  // <br>Storage managers only handle standard data types and
356  // can readily ignore this argument.
357  DataManagerColumn* createScalarColumn (const String& columnName,
358  int dataType,
359  const String& dataTypeId);
360  // Create a direct array column.
361  DataManagerColumn* createDirArrColumn (const String& columnName,
362  int dataType,
363  const String& dataTypeId);
364  // Create an indirect array column.
365  DataManagerColumn* createIndArrColumn (const String& columnName,
366  int dataType,
367  const String& dataTypeId);
368  // </group>
369 
370  // The data manager will be deleted (because all its columns are
371  // requested to be deleted).
372  // So clean up the things needed (e.g. delete files).
373  virtual void deleteManager() = 0;
374 
375 
376 protected:
377  // Decrement number of columns (in case a column is deleted).
379  { nrcol_p--; }
380 
381  // Tell the data manager if big or little endian format is needed.
382  void setEndian (Bool bigEndian)
383  { asBigEndian_p = bigEndian; }
384 
385  // Tell the data manager which TSM option to use.
386  void setTsmOption (const TSMOption& tsmOption);
387 
388  // Tell the data manager that MultiFile can be used.
389  // Because MultiFile cannot be used with mmapped files, it sets
390  // the TSMOption accordingly.
391  void setMultiFile (MultiFileBase* mfile);
392 
393  // Does the data manager support use of MultiFile?
394  // A derived class has to return True if it can use the MultiFile.
395  // The default implementation returns False.
396  virtual Bool hasMultiFileSupport() const;
397 
398  // Throw an exception in case data type is TpOther, because the
399  // storage managers (and maybe other data managers) do not support
400  // such columns.
401  void throwDataTypeOther (const String& columnName, int dataType) const;
402 
403 
404 private:
405  uInt nrcol_p; //# #columns in this st.man.
406  uInt seqnr_p; //# Unique nr of this st.man. in a Table
407  Bool asBigEndian_p; //# store data in big or little endian
409  MultiFileBase* multiFile_p; //# MultiFile to use; 0=no MultiFile
410  Table* table_p; //# Table this data manager belongs to
411  mutable DataManager* clone_p; //# Pointer to clone (used by SetupNewTab)
412 
413 
414  // The copy constructor cannot be used for this base class.
415  // The clone function should be used instead.
416  // The private declaration of this constructor makes it unusable.
417  DataManager (const DataManager&);
418 
419  // Assignment cannot be used for this base class.
420  // The private declaration of this operator makes it unusable.
422 
423  // Create a column in the data manager on behalf of a table column.
424  //# Should be private, but has to be public because friend
425  //# declaration gave internal CFront error.
426  // <group>
427  // Create a scalar column.
428  virtual DataManagerColumn* makeScalarColumn (const String& columnName,
429  int dataType,
430  const String& dataTypeId) = 0;
431  // Create a direct array column.
432  virtual DataManagerColumn* makeDirArrColumn (const String& columnName,
433  int dataType,
434  const String& dataTypeId) = 0;
435  // Create an indirect array column.
436  virtual DataManagerColumn* makeIndArrColumn (const String& columnName,
437  int dataType,
438  const String& dataTypeId) = 0;
439  // </group>
440 
441  // Check if the data type of the created data manager column is correct.
442  void checkDataType (const DataManagerColumn* colPtr,
443  const String& columnName,
444  int dataType, const String& dataTypeId) const;
445 
446  // Add rows to all columns.
447  // The default implementation throws a "not possible" exception.
448  virtual void addRow (uInt nrrow);
449 
450  // Delete a row from all columns.
451  // The default implementation throws a "not possible" exception.
452  virtual void removeRow (uInt rownr);
453 
454  // Add a column.
455  // The default implementation throws a "not possible" exception.
456  virtual void addColumn (DataManagerColumn*);
457 
458  // Delete a column.
459  // The default implementation throws a "not possible" exception.
460  virtual void removeColumn (DataManagerColumn*);
461 
462  // Set the sequence number of this data manager.
463  void setSeqnr (uInt nr)
464  { seqnr_p = nr; }
465 
466  // Link the data manager to the Table object.
467  void linkToTable (Table& tab);
468 
469  // Flush and optionally fsync the data.
470  // The AipsIO stream represents the main table file and can be
471  // used by virtual column engines to store SMALL amounts of data.
472  // It returns a True status if it had to flush (i.e. if data have changed).
473  virtual Bool flush (AipsIO& ios, Bool fsync) = 0;
474 
475  // Let the data manager initialize itself for a new table.
476  virtual void create (uInt nrrow) = 0;
477 
478  // Let the data manager initialize itself for an existing table.
479  // The AipsIO stream represents the main table file and must be
480  // used by virtual column engines to retrieve the data stored
481  // in the flush function.
482  virtual void open (uInt nrrow, AipsIO& ios) = 0;
483 
484  // Open as above.
485  // The data manager can return the number of rows it thinks there are.
486  // This is particularly useful for data managers like LofarStMan whose
487  // data are written outside the table system, thus for which no rows
488  // have been added.
489  // <br>By default it calls open and returns <src>nrrow</src>.
490  virtual uInt open1 (uInt nrrow, AipsIO& ios);
491 
492  // Resync the data by rereading cached data from the file.
493  // This is called when a lock is acquired on the file and it appears
494  // that data in this data manager has been changed by another process.
495  virtual void resync (uInt nrrow) = 0;
496 
497  // Resync as above.
498  // The data manager can return the number of rows it thinks there are.
499  // This is particularly useful for data managers like LofarStMan whose
500  // data are written outside the table system, thus for which no rows
501  // have been added.
502  // <br>By default it calls resync and returns <src>nrrow</src>.
503  virtual uInt resync1 (uInt nrrow);
504 
505  // Let the data manager initialize itself further.
506  // Prepare is called after create/open has been called for all
507  // columns. In this way one can be sure that referenced columns
508  // are read back and partly initialized.
509  // The default implementation does nothing.
510  virtual void prepare();
511 
512  // Declare the mapping of the data manager type name to a static
513  // "makeObject" function.
516 
517 public:
518  // Has the object already been cloned?
520  { return clone_p; }
521 
522  // Set the pointer to the clone.
523  void setClone (DataManager* clone) const
524  { clone_p = clone; }
525 
526  // Register a mapping of a data manager type to its static construction
527  // function. It is fully thread-safe.
528  static void registerCtor (const String& type, DataManagerCtor func);
529 
530  // Get the "constructor" of a data manager (thread-safe).
531  static DataManagerCtor getCtor (const String& dataManagerType);
532 
533  // Test if a data manager is registered (thread-safe).
534  static Bool isRegistered (const String& dataManagerType);
535 
536  // Register the main data managers (if not done yet).
537  // It is fully thread-safe.
538  static void registerMainCtor()
539  { theirMutexedInit.exec(); }
540 
541  // Serve as default function for theirRegisterMap, which catches all
542  // unknown data manager types.
543  // <thrown>
544  // <li> TableUnknownDataManager
545  // </thrown>
546  static DataManager* unknownDataManager (const String& dataManagerType,
547  const Record& spec);
548 
549 private:
550  // Register a data manager constructor.
551  static void unlockedRegisterCtor (const String& type,
552  DataManagerCtor func)
553  { theirRegisterMap.define (type, func); }
554 
555  // Do the actual (thread-safe) registration of the main data managers.
556  static void doRegisterMainCtor (void*);
557 };
558 
559 
560 
561 
562 // <summary>
563 // Abstract base class for a column in a data manager
564 // </summary>
565 
566 // <use visibility=local>
567 
568 // <reviewed reviewer="Gareth Hunt" date="94Nov17" tests="">
569 // </reviewed>
570 
571 // <prerequisite>
572 //# Classes you should understand before using this one.
573 // <li> DataManager
574 // </prerequisite>
575 
576 // <etymology>
577 // DataManagerColumn handles a column for a data manager.
578 // </etymology>
579 
580 // <synopsis>
581 // DataManagerColumn is the abstract base class to handle a column in
582 // a data manager. Each data manager class must have one or more associated
583 // classes derived from DataManagerColumn to handle the columns.
584 // For example, storage manager StManAipsIO has columns classes
585 // StManColumnAipsIO, StManColumnArrayAipsIO and StManColumnIndArrayAipsIO
586 // to handle scalars, direct arrays and indirect arrays, resp..
587 // However, using multiple inheritance it is possible that the derived
588 // DataManager and DataManagerColumn classes are the same. This is used
589 // in class ScaledArrayEngine<S,T> which represents both the data manager
590 // and its column class. It can do that, because the virtual column engine
591 // <linkto class="ScaledArrayEngine:description">ScaledArrayEngine</linkto>
592 // can handle only one column.
593 //
594 // In the synopsis of class DataManager it is described how the (derived)
595 // DataManagerColumn objects gets created and deleted.
596 //
597 // DataManagerColumn defines various virtual functions to get or put (slices)
598 // of data in a column. These functions are called by the table column
599 // classes ScalarColumnData and ArrayColumnData.
600 // It does not define functions create, open, flush and prepare like
601 // those defined in DataManager. It is left to the derived classes to
602 // define those as needed and to interact properly with their
603 // data manager object.
604 // </synopsis>
605 
606 // <motivation>
607 // An abstract base class is needed to support multiple data
608 // managers in the table system
609 // </motivation>
610 
611 // <todo asof="$DATE:$">
612 //# A List of bugs, limitations, extensions or planned refinements.
613 // </todo>
614 
615 
617 {
618 public:
619 
620  // Create a column.
622  : isFixedShape_p(False) {;}
623 
624  // Frees up the storage.
625  virtual ~DataManagerColumn();
626 
627  // Set the isFixedShape flag.
628  void setIsFixedShape (Bool isFixedShape)
629  { isFixedShape_p = isFixedShape; }
630 
631  // Is this a fixed shape column?
633  { return isFixedShape_p; }
634 
635  // Get the data type of the column as defined in DataType.h.
636  virtual int dataType() const = 0;
637 
638  // Get the data type id of the column for dataType==TpOther.
639  // The default implementation returns an emptry string.
640  // This function is required for virtual column engines handling
641  // non-standard data types. It is used to check the data type.
642  virtual String dataTypeId() const;
643 
644  // Test if data can be put into this column.
645  // This does not test if the data file is writable, only if
646  // it is in principle allowed to store data into the column.
647  // (It may not be allowed for virtual columns).
648  // The default is True.
649  virtual Bool isWritable() const;
650 
651  // Set the maximum length of the value (can be used for strings).
652  // By default the maximum length is ignored.
653  virtual void setMaxLength (uInt maxLength);
654 
655  // Set the shape of all (fixed-shaped) arrays in the column.
656  // Effectively it is the same as setShapeColumn, but it also sets
657  // the isFixedShape_p flag.
659  { setShapeColumn (shape); isFixedShape_p = True; }
660 
661  // Set the shape of an (variable-shaped) array in the given row.
662  // By default it throws a "not possible" exception.
663  virtual void setShape (uInt rownr, const IPosition& shape);
664 
665  // Set the shape and tile shape of an (variable-shaped) array
666  // in the given row.
667  // By default it ignores the tile shape (thus only sets the shape).
668  virtual void setShapeTiled (uInt rownr, const IPosition& shape,
669  const IPosition& tileShape);
670 
671  // Is the value shape defined in the given row?
672  // By default it returns True.
673  virtual Bool isShapeDefined (uInt rownr);
674 
675  // Get the dimensionality of the item in the given row.
676  // By default it returns shape(rownr).nelements().
677  virtual uInt ndim (uInt rownr);
678 
679  // Get the shape of the item in the given row.
680  // By default it returns a zero-length IPosition (for a scalar value).
681  virtual IPosition shape (uInt rownr);
682 
683  // Can the data manager handle chaging the shape of an existing array?
684  // Default is no.
685  virtual Bool canChangeShape() const;
686 
687  // Can the column data manager handle access to a scalar column?
688  // If not, the caller should access the column by looping through
689  // all cells in the column.
690  // Default is no.
691  // <br>
692  // The returned reask switch determines if the information is
693  // permanent. False indicates it is permanent; True indicates it
694  // will be reasked for the next get/putColumn.
695  // By default reask is set to False.
696  virtual Bool canAccessScalarColumn (Bool& reask) const;
697 
698  // Can the column data manager handle access to a clooection of cells
699  // in a scalar column?
700  // If not, the caller should access the column cells by looping through
701  // the cells in the column.
702  // Default is no.
703  // <br>
704  // The returned reask switch determines if the information is
705  // permanent. False indicates it is permanent; True indicates it
706  // will be reasked for the next get/putColumn.
707  // By default reask is set to False.
708  virtual Bool canAccessScalarColumnCells (Bool& reask) const;
709 
710  // Can the column data manager handle access to a scalar column?
711  // If not, the caller should access the column by looping through
712  // all cells in the column.
713  // Default is no.
714  // <br>
715  // The returned reask switch determines if the information is
716  // permanent. False indicates it is permanent; True indicates it
717  // will be reasked for the next get/putColumn.
718  // By default reask is set to False.
719  virtual Bool canAccessArrayColumn (Bool& reask) const;
720 
721  // Can the column data manager handle access to a collection of cells
722  // in an array column?
723  // If not, the caller should access the column cells by looping through
724  // the cells in the column.
725  // Default is no.
726  // <br>
727  // The returned reask switch determines if the information is
728  // permanent. False indicates it is permanent; True indicates it
729  // will be reasked for the next get/putColumn.
730  // By default reask is set to False.
731  virtual Bool canAccessArrayColumnCells (Bool& reask) const;
732 
733  // Can the column data manager handle access to a cell slice?
734  // If not, the caller should do slicing itself (by accessing the
735  // entire array and slicing it).
736  // Default is no.
737  // <br>
738  // The returned reask switch determines if the information is
739  // permanent. False indicates it is permanent; True indicates it
740  // will be reasked for the next get/putColumn.
741  // By default reask is set to False.
742  virtual Bool canAccessSlice (Bool& reask) const;
743 
744  // Can the column data manager handle access to a column slice?
745  // If not, the caller should access the column slice by looping through
746  // all cell slices in the column.
747  // Default is no.
748  // <br>
749  // The returned reask switch determines if the information is
750  // permanent. False indicates it is permanent; True indicates it
751  // will be reasked for the next get/putColumn.
752  // By default reask is set to False.
753  virtual Bool canAccessColumnSlice (Bool& reask) const;
754 
755  // Get access to the ColumnCache object.
756  // <group>
758  { return colCache_p; }
760  { return &colCache_p; }
761  // </group>
762 
763  // Get the scalar value in the given row.
764  // These functions are non-virtual and are converted to their
765  // virtual getV equivalent to achieve that a derived templated class
766  //(like VirtualScalarColumn) does not have to declare and implement
767  // all these functions.
768  // The compiler complains about hiding virtual functions if you do not
769  // declare all virtual functions with the same name in a derived class.
770  // <group>
771  void get (uInt rownr, Bool* dataPtr)
772  { getBoolV (rownr, dataPtr); }
773  void get (uInt rownr, uChar* dataPtr)
774  { getuCharV (rownr, dataPtr); }
775  void get (uInt rownr, Short* dataPtr)
776  { getShortV (rownr, dataPtr); }
777  void get (uInt rownr, uShort* dataPtr)
778  { getuShortV (rownr, dataPtr); }
779  void get (uInt rownr, Int* dataPtr)
780  { getIntV (rownr, dataPtr); }
781  void get (uInt rownr, uInt* dataPtr)
782  { getuIntV (rownr, dataPtr); }
783  void get (uInt rownr, float* dataPtr)
784  { getfloatV (rownr, dataPtr); }
785  void get (uInt rownr, double* dataPtr)
786  { getdoubleV (rownr, dataPtr); }
787  void get (uInt rownr, Complex* dataPtr)
788  { getComplexV (rownr, dataPtr); }
789  void get (uInt rownr, DComplex* dataPtr)
790  { getDComplexV (rownr, dataPtr); }
791  void get (uInt rownr, String* dataPtr)
792  { getStringV (rownr, dataPtr); }
793  // This function is the get for all non-standard data types.
794  void get (uInt rownr, void* dataPtr)
795  { getOtherV (rownr, dataPtr); }
796  // </group>
797 
798  // Put the scalar value into the given row.
799  // These functions are non-virtual and are converted to their
800  // virtual putV equivalent to achieve that a derived templated class
801  //(like VirtualScalarColumn) does not have to declare and implement
802  // all these functions.
803  // The compiler complains about hiding virtual functions if you do not
804  // declare all virtual functions with the same name in a derived class.
805  // <group>
806  void put (uInt rownr, const Bool* dataPtr)
807  { putBoolV (rownr, dataPtr); }
808  void put (uInt rownr, const uChar* dataPtr)
809  { putuCharV (rownr, dataPtr); }
810  void put (uInt rownr, const Short* dataPtr)
811  { putShortV (rownr, dataPtr); }
812  void put (uInt rownr, const uShort* dataPtr)
813  { putuShortV (rownr, dataPtr); }
814  void put (uInt rownr, const Int* dataPtr)
815  { putIntV (rownr, dataPtr); }
816  void put (uInt rownr, const uInt* dataPtr)
817  { putuIntV (rownr, dataPtr); }
818  void put (uInt rownr, const float* dataPtr)
819  { putfloatV (rownr, dataPtr); }
820  void put (uInt rownr, const double* dataPtr)
821  { putdoubleV (rownr, dataPtr); }
822  void put (uInt rownr, const Complex* dataPtr)
823  { putComplexV (rownr, dataPtr); }
824  void put (uInt rownr, const DComplex* dataPtr)
825  { putDComplexV (rownr, dataPtr); }
826  void put (uInt rownr, const String* dataPtr)
827  { putStringV (rownr, dataPtr); }
828  // This function is the put for all non-standard data types.
829  void put (uInt rownr, const void* dataPtr)
830  { putOtherV (rownr, dataPtr); }
831  // </group>
832 
833  // Get all scalar values in the column.
834  // The argument dataPtr is in fact a Vector<T>*, but a void*
835  // is needed to be generic.
836  // The vector pointed to by dataPtr has to have the correct length
837  // (which is guaranteed by the ScalarColumn getColumn function).
838  // The default implementation throws an "invalid operation" exception.
839  virtual void getScalarColumnV (void* dataPtr);
840 
841  // Put all scalar values in the column.
842  // The argument dataPtr is in fact a const Vector<T>*, but a const void*
843  // is needed to be generic.
844  // The vector pointed to by dataPtr has to have the correct length
845  // (which is guaranteed by the ScalarColumn putColumn function).
846  // The default implementation throws an "invalid operation" exception.
847  virtual void putScalarColumnV (const void* dataPtr);
848 
849  // Get some scalar values in the column.
850  // The argument dataPtr is in fact a Vector<T>*, but a void*
851  // is needed to be generic.
852  // The vector pointed to by dataPtr has to have the correct length
853  // (which is guaranteed by the ScalarColumn getColumn function).
854  // The default implementation throws an "invalid operation" exception.
855  virtual void getScalarColumnCellsV (const RefRows& rownrs,
856  void* dataPtr);
857 
858  // Put some scalar values in the column.
859  // The argument dataPtr is in fact a const Vector<T>*, but a const void*
860  // is needed to be generic.
861  // The vector pointed to by dataPtr has to have the correct length
862  // (which is guaranteed by the ScalarColumn getColumn function).
863  // The default implementation throws an "invalid operation" exception.
864  virtual void putScalarColumnCellsV (const RefRows& rownrs,
865  const void* dataPtr);
866 
867  // Get scalars from the given row on with a maximum of nrmax values.
868  // It returns the actual number of values got.
869  // This can be used to get an entire column of scalars or to get
870  // a part of a column (for a cache for example).
871  // The argument dataPtr is in fact a T*, but a void*
872  // is needed to be generic.
873  // The default implementation throws an "invalid operation" exception.
874  virtual uInt getBlockV (uInt rownr, uInt nrmax, void* dataPtr);
875 
876  // Put nrmax scalars from the given row on.
877  // It returns the actual number of values put.
878  // This can be used to put an entire column of scalars or to put
879  // a part of a column (for a cache for example).
880  // The argument dataPtr is in fact a const T*, but a const void*
881  // is needed to be generic.
882  // The default implementation throws an "invalid operation" exception.
883  virtual void putBlockV (uInt rownr, uInt nrmax, const void* dataPtr);
884 
885  // Get the array value in the given row.
886  // The argument dataPtr is in fact an Array<T>*, but a void*
887  // is needed to be generic.
888  // The array pointed to by dataPtr has to have the correct shape
889  // (which is guaranteed by the ArrayColumn get function).
890  // The default implementation throws an "invalid operation" exception.
891  virtual void getArrayV (uInt rownr, void* dataPtr);
892 
893  // Put the array value into the given row.
894  // The argument dataPtr is in fact a const Array<T>*, but a const void*
895  // is needed to be generic.
896  // The array pointed to by dataPtr has to have the correct shape
897  // (which is guaranteed by the ArrayColumn put function).
898  // The default implementation throws an "invalid operation" exception.
899  virtual void putArrayV (uInt rownr, const void* dataPtr);
900 
901  // Get all array values in the column.
902  // The argument dataPtr is in fact an Array<T>*, but a void*
903  // is needed to be generic.
904  // The vector pointed to by dataPtr has to have the correct length
905  // (which is guaranteed by the ArrayColumn getColumn function).
906  // The default implementation throws an "invalid operation" exception.
907  virtual void getArrayColumnV (void* dataPtr);
908 
909  // Put all array values in the column.
910  // The argument dataPtr is in fact a const Array<T>*, but a const void*
911  // is needed to be generic.
912  // The vector pointed to by dataPtr has to have the correct length
913  // (which is guaranteed by the ArrayColumn putColumn function).
914  // The default implementation throws an "invalid operation" exception.
915  virtual void putArrayColumnV (const void* dataPtr);
916 
917  // Get some array values in the column.
918  // The argument dataPtr is in fact an Array<T>*, but a void*
919  // is needed to be generic.
920  // The vector pointed to by dataPtr has to have the correct length
921  // (which is guaranteed by the ArrayColumn getColumn function).
922  // The default implementation throws an "invalid operation" exception.
923  virtual void getArrayColumnCellsV (const RefRows& rownrs,
924  void* dataPtr);
925 
926  // Put some array values in the column.
927  // The argument dataPtr is in fact an const Array<T>*, but a const void*
928  // is needed to be generic.
929  // The vector pointed to by dataPtr has to have the correct length
930  // (which is guaranteed by the ArrayColumn getColumn function).
931  // The default implementation throws an "invalid operation" exception.
932  virtual void putArrayColumnCellsV (const RefRows& rownrs,
933  const void* dataPtr);
934 
935  // Get a section of the array in the given row.
936  // The argument dataPtr is in fact an Array<T>*, but a void*
937  // is needed to be generic.
938  // The array pointed to by dataPtr has to have the correct shape
939  // (which is guaranteed by the ArrayColumn getSlice function).
940  // The default implementation throws an "invalid operation" exception.
941  virtual void getSliceV (uInt rownr, const Slicer& slicer, void* dataPtr);
942 
943  // Put into a section of the array in the given row.
944  // The argument dataPtr is in fact a const Array<T>*, but a const void*
945  // is needed to be generic.
946  // The array pointed to by dataPtr has to have the correct shape
947  // (which is guaranteed by the ArrayColumn putSlice function).
948  // The default implementation throws an "invalid operation" exception.
949  virtual void putSliceV (uInt rownr, const Slicer& slicer,
950  const void* dataPtr);
951 
952  // Get a section of all arrays in the column.
953  // The argument dataPtr is in fact an Array<T>*, but a void*
954  // is needed to be generic.
955  // The array pointed to by dataPtr has to have the correct shape
956  // (which is guaranteed by the ArrayColumn getColumn function).
957  // The default implementation throws an "invalid operation" exception.
958  virtual void getColumnSliceV (const Slicer& slicer, void* dataPtr);
959 
960  // Put into a section of all arrays in the column.
961  // The argument dataPtr is in fact a const Array<T>*, but a const void*
962  // is needed to be generic.
963  // The array pointed to by dataPtr has to have the correct shape
964  // (which is guaranteed by the ArrayColumn putColumn function).
965  // The default implementation throws an "invalid operation" exception.
966  virtual void putColumnSliceV (const Slicer& slicer, const void* dataPtr);
967 
968  // Get a section of some arrays in the column.
969  // The argument dataPtr is in fact an Array<T>*, but a void*
970  // is needed to be generic.
971  // The array pointed to by dataPtr has to have the correct shape
972  // (which is guaranteed by the ArrayColumn getColumn function).
973  // The default implementation throws an "invalid operation" exception.
974  virtual void getColumnSliceCellsV (const RefRows& rownrs,
975  const Slicer& slicer, void* dataPtr);
976 
977  // Put into a section of some arrays in the column.
978  // The argument dataPtr is in fact a const Array<T>*, but a const void*
979  // is needed to be generic.
980  // The array pointed to by dataPtr has to have the correct shape
981  // (which is guaranteed by the ArrayColumn putColumn function).
982  // The default implementation throws an "invalid operation" exception.
983  virtual void putColumnSliceCellsV (const RefRows& rownrs,
984  const Slicer& slicer,
985  const void* dataPtr);
986 
987  // Throw an "invalid operation" exception for the default
988  // implementation of get.
989  void throwGet() const;
990 
991  // Throw an "invalid operation" exception for the default
992  // implementation of put.
993  void throwPut() const;
994 
995  // Set the column name.
996  void setColumnName (const String& colName)
997  { colName_p = colName; }
998 
999  // Get rhe column name.
1000  const String& columnName() const
1001  { return colName_p; }
1002 
1003 protected:
1004  // Get the scalar value in the given row.
1005  // The default implementation throws an "invalid operation" exception.
1006  // <group>
1007  virtual void getBoolV (uInt rownr, Bool* dataPtr);
1008  virtual void getuCharV (uInt rownr, uChar* dataPtr);
1009  virtual void getShortV (uInt rownr, Short* dataPtr);
1010  virtual void getuShortV (uInt rownr, uShort* dataPtr);
1011  virtual void getIntV (uInt rownr, Int* dataPtr);
1012  virtual void getuIntV (uInt rownr, uInt* dataPtr);
1013  virtual void getfloatV (uInt rownr, float* dataPtr);
1014  virtual void getdoubleV (uInt rownr, double* dataPtr);
1015  virtual void getComplexV (uInt rownr, Complex* dataPtr);
1016  virtual void getDComplexV (uInt rownr, DComplex* dataPtr);
1017  virtual void getStringV (uInt rownr, String* dataPtr);
1018  // This function is the get for all non-standard data types.
1019  virtual void getOtherV (uInt rownr, void* dataPtr);
1020  // </group>
1021 
1022  // Put the scalar value into the given row.
1023  // The default implementation throws an "invalid operation" exception.
1024  // <group>
1025  virtual void putBoolV (uInt rownr, const Bool* dataPtr);
1026  virtual void putuCharV (uInt rownr, const uChar* dataPtr);
1027  virtual void putShortV (uInt rownr, const Short* dataPtr);
1028  virtual void putuShortV (uInt rownr, const uShort* dataPtr);
1029  virtual void putIntV (uInt rownr, const Int* dataPtr);
1030  virtual void putuIntV (uInt rownr, const uInt* dataPtr);
1031  virtual void putfloatV (uInt rownr, const float* dataPtr);
1032  virtual void putdoubleV (uInt rownr, const double* dataPtr);
1033  virtual void putComplexV (uInt rownr, const Complex* dataPtr);
1034  virtual void putDComplexV (uInt rownr, const DComplex* dataPtr);
1035  virtual void putStringV (uInt rownr, const String* dataPtr);
1036  // This function is the put for all non-standard data types.
1037  virtual void putOtherV (uInt rownr, const void* dataPtr);
1038  // </group>
1039 
1040 private:
1044 
1045  // Set the shape of all (fixed-shaped) arrays in the column.
1046  // By default it throws a "not possible" exception.
1047  virtual void setShapeColumn (const IPosition& shape);
1048 
1049  // The copy constructor cannot be used for this base class.
1050  // The private declaration of this constructor makes it unusable.
1052 
1053  // Assignment cannot be used for this base class.
1054  // The private declaration of this operator makes it unusable.
1056 };
1057 
1058 
1059 
1060 } //# NAMESPACE CASACORE - END
1061 
1062 #endif
void put(uInt rownr, const uInt *dataPtr)
Definition: DataManager.h:816
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:996
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...
int Int
Definition: aipstype.h:47
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:658
Create a new table - define shapes, data managers, etc.
Definition: SetupNewTab.h:346
uInt ncolumn() const
Get the nr of columns in this data manager (can be zero).
Definition: DataManager.h:287
ColumnCache colCache_p
Definition: ConcatColumn.h:290
ByteIO::OpenOption fileOption() const
Get the AipsIO option of the underlying file.
Main interface class to a read/write table.
Definition: Table.h:149
void put(uInt rownr, const double *dataPtr)
Definition: DataManager.h:820
void decrementNcolumn()
Decrement number of columns (in case a column is deleted).
Definition: DataManager.h:378
virtual Bool canAddRow() const
Does the data manager allow to add rows? (default no)
virtual uInt open1(uInt nrrow, AipsIO &ios)
Open as above.
virtual Bool flush(AipsIO &ios, Bool fsync)=0
Flush and optionally fsync the data.
Abstract base class to combine multiple files in a single one.
void dataManagerInfo(Record &info) const
Add SEQNR and SPEC (the DataManagerSpec subrecord) to the info.
const String & columnName() const
Get rhe column name.
Definition: DataManager.h:1000
AipsIO is the object persistency mechanism of Casacore.
Definition: AipsIO.h:168
virtual void removeRow(uInt rownr)
Delete a row from all columns.
virtual Record dataManagerSpec() const
Return a record containing data manager specifications.
Abstract base class for a column in a data manager.
Definition: DataManager.h:616
void put(uInt rownr, const Int *dataPtr)
Definition: DataManager.h:814
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.
const TSMOption & tsmOption() const
Get the TSM option.
Definition: DataManager.h:295
unsigned char uChar
Definition: aipstype.h:44
String fileName() const
Compose a unique filename from the table name and sequence number.
void put(uInt rownr, const void *dataPtr)
This function is the put for all non-standard data types.
Definition: DataManager.h:829
static DataManagerCtor getCtor(const String &dataManagerType)
Get the "constructor" of a data manager (thread-safe).
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 void deleteManager()=0
The data manager will be deleted (because all its columns are requested to be deleted).
virtual void setMaximumCacheSize(uInt nbytes)
Set the maximum cache size (in bytes) to be used by a storage manager.
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:806
String keywordName(const String &keyword) const
Compose a keyword name from the given keyword appended with the sequence number (e.g.
virtual String dataManagerName() const
Return the name of the data manager.
Thread-safe initialization of global variables.
Definition: Mutex.h:161
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:757
virtual void showCacheStatistics(std::ostream &) const
Show the data manager&#39;s IO statistics.
static void registerMainCtor()
Register the main data managers (if not done yet).
Definition: DataManager.h:538
void setClone(DataManager *clone) const
Set the pointer to the clone.
Definition: DataManager.h:523
short Short
Definition: aipstype.h:45
static void unlockedRegisterCtor(const String &type, DataManagerCtor func)
Register a data manager constructor.
Definition: DataManager.h:551
static Bool isRegistered(const String &dataManagerType)
Test if a data manager is registered (thread-safe).
const ColumnCache * columnCachePtr() const
Definition: DataManager.h:759
Simple map with keys ordered.
Definition: SimOrdMap.h:69
Bool isFixedShape() const
Is this a fixed shape column?
Definition: DataManager.h:632
DataManagerColumn()
Create a column.
Definition: DataManager.h:621
virtual Bool canRemoveColumn() const
Does the data manager allow to delete columns? (default no)
void put(uInt rownr, const DComplex *dataPtr)
Definition: DataManager.h:824
virtual Bool canRemoveRow() const
Does the data manager allow to delete rows? (default no)
DataManager * clone_p
Definition: DataManager.h:411
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.
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:818
virtual DataManagerColumn * makeIndArrColumn(const String &columnName, int dataType, const String &dataTypeId)=0
Create an indirect array column.
virtual Record getProperties() const
Get data manager properties that can be modified.
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.
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:514
A hierarchical collection of named fields of various types.
Definition: Record.h:181
virtual Bool canReallocateColumns() const
Tell if the data manager wants to reallocate the data manager column objects.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:39
void linkToTable(Table &tab)
Link the data manager to the Table object.
void put(uInt rownr, const uChar *dataPtr)
Definition: DataManager.h:808
virtual void removeColumn(DataManagerColumn *)
Delete a column.
A caching object for a table column.
Definition: ColumnCache.h:83
virtual DataManagerColumn * reallocateColumn(DataManagerColumn *column)
Reallocate the column object if it is part of this data manager.
const Bool False
Definition: aipstype.h:41
static MutexedInit theirMutexedInit
Definition: DataManager.h:515
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
Definition: ExprNode.h:2015
void put(uInt rownr, const Short *dataPtr)
Definition: DataManager.h:810
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.
virtual Bool isRegular() const
Is this a regular storage manager? It is regular if it allows addition of rows and writing data in th...
void exec()
Execute the initialization function if not done yet.
Definition: Mutex.h:171
DataManager * getClone() const
Has the object already been cloned?
Definition: DataManager.h:519
Specify which elements to extract from an n-dimensional array.
Definition: Slicer.h:275
DataManager()
Default constructor.
uInt sequenceNr() const
Get the (unique) sequence nr of this data manager.
Definition: DataManager.h:283
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:812
OpenOption
Define the possible ByteIO open options.
Definition: ByteIO.h:65
Abstract base class for a data manager.
Definition: DataManager.h:222
void setIsFixedShape(Bool isFixedShape)
Set the isFixedShape flag.
Definition: DataManager.h:628
virtual uInt resync1(uInt nrrow)
Resync as above.
static void doRegisterMainCtor(void *)
Do the actual (thread-safe) registration of the main data managers.
void setEndian(Bool bigEndian)
Tell the data manager if big or little endian format is needed.
Definition: DataManager.h:382
virtual Bool isStorageManager() const
Is the data manager a storage manager? The default is yes.
void put(uInt rownr, const String *dataPtr)
Definition: DataManager.h:826
void put(uInt rownr, const Complex *dataPtr)
Definition: DataManager.h:822
String: the storage and methods of handling collections of characters.
Definition: String.h:223
virtual Bool canAddColumn() const
Does the data manager allow to add columns? (default no)
MultiFileBase * multiFile_p
Definition: DataManager.h:409
Table & table() const
Get the table this object is associated with.
Definition: DataManager.h:320
DataManagerColumn * createDirArrColumn(const String &columnName, int dataType, const String &dataTypeId)
Create a direct array column.
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.
DataManagerColumn * createScalarColumn(const String &columnName, int dataType, const String &dataTypeId)
Create a column in the data manager on behalf of a table column.
void setSeqnr(uInt nr)
Set the sequence number of this data manager.
Definition: DataManager.h:463
V & define(const K &, const V &)
Defines a mapping (ie.
const Bool True
Definition: aipstype.h:40
Bool asBigEndian() const
Have the data to be stored in big or little endian canonical format?
Definition: DataManager.h:291
this file contains all the compiler specific defines
Definition: mainpage.dox:28
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:48
unsigned short uShort
Definition: aipstype.h:46