casacore
DataManager.h
Go to the documentation of this file.
1 //# DataManager.h: Abstract base class 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/DataMan/DataManagerColumn.h>
35 #include <casacore/tables/DataMan/TSMOption.h>
36 #include <casacore/casa/Arrays/ArrayFwd.h>
37 #include <casacore/casa/BasicSL/String.h>
38 #include <casacore/casa/IO/ByteIO.h>
39 #include <casacore/casa/OS/Mutex.h>
40 #include <map>
41 #include <iosfwd>
42 
43 namespace casacore { //# NAMESPACE CASACORE - BEGIN
44 
45 //# Forward Declarations
46 class DataManager;
47 class SetupNewTable;
48 class Table;
49 class MultiFileBase;
50 class Record;
51 class AipsIO;
52 
53 
54 // <summary>
55 // Define the type of the static construction function.
56 // </summary>
57 
58 // <use visibility=local>
59 
60 // <reviewed reviewer="Gareth Hunt" date="94Nov17" tests="">
61 // </reviewed>
62 
63 // <synopsis>
64 // Class names of data managers and pointers to their associated constructor
65 // function are registered in a static map to be able to create the correct
66 // data manager object from a string giving the type name of the data manager.
67 // DataManagerCtor is the type of the constructor functions.
68 // </synopsis>
69 // <group name=DataManagerCtor>
70 typedef DataManager* (*DataManagerCtor) (const String& dataManagerType,
71  const Record& spec);
72 // </group>
73 
74 
75 // <summary>
76 // Abstract base class for a data manager
77 // </summary>
78 
79 // <use visibility=local>
80 
81 // <reviewed reviewer="Gareth Hunt" date="94Nov17" tests="">
82 // </reviewed>
83 
84 // <prerequisite>
85 //# Classes you should understand before using this one.
86 // </prerequisite>
87 
88 // <synopsis>
89 // DataManager is the abstract base class for all kind of table data managers.
90 // There are currently 2 classes of data managers:
91 // <ul>
92 // <li> Storage managers handling the storage of data. These classes
93 // have to be derived from DataManager.
94 // StManAipsIO is an example of a storage manager.
95 // <li> Virtual column engines handling the on-the-fly calculation
96 // of data, which are not stored as such. The base class for
97 // these is VirtualColumnEngine (which is derived from DataManager),
98 // from which all virtual columns engine must be derived from.
99 // </ul>
100 // DataManager contains some common data and defines several virtual
101 // functions, which usually have to be implemented in the derived classes.
102 // It also contains some helper functions for the derived classes
103 // (like fileName().
104 //
105 // The actual handling of a column by the data manager is defined in
106 // the abstract base class
107 // <linkto class="DataManagerColumn:description">DataManagerColumn</linkto>.
108 // Each data manager must
109 // have an associated class (derived from DataManagerColumn) to
110 // handle the columns.
111 //
112 // There is a protocol defined how a data manager is created and
113 // initialized. For a new table it is:
114 // <ul>
115 // <li>
116 // The user creates data managers and binds them to columns. For example:
117 // <srcblock>
118 // SetupNewTable newtab("name.data", Table::New); // set up new table
119 // StManAipsIO stman; // define storage manager
120 // newtab.bindColumn ("column1", stman); // bind column to st.man.
121 // newtab.bindColumn ("column2", stman); // bind column to st.man.
122 // Table tab(newtab); // actually create table
123 // </srcblock>
124 // When the given data manager object is used for the first time in a bind
125 // function, a copy of the object is made using the clone function.
126 // Thus in the above example column1 and column2 share the same data
127 // manager; only at the first bind the stman object is cloned.
128 // Columns not explicitly bound to a data manager get implicitly bound
129 // to the default data manager (as defined in the column description)
130 // by the Table constructor (as used in line 5).
131 // <li>
132 // After binding the unbound columns, the PlainTable constructor sets up
133 // the data managers. For each column it asks the data manager to
134 // construct a DataManagerColumn object (in fact, an object of a class
135 // derived from DataManagerColumn). This is done by the functions
136 // createScalarColumn, createIndArrColumn and createDirArrColumn.
137 // For each data manager the create function is called. This allows
138 // them to initialize themselves and/or to call an initialization
139 // function in their column objects.
140 // This is, for instance, used by the storage managers to create files.
141 // Thereafter the prepare function is called to allow the data managers
142 // to do further initialization possibly requiring information from
143 // other columns.
144 // <li>
145 // When the table gets written (by the PlainTable destructor),
146 // the flush function is called for each data manager. This allows
147 // the data manager or their column objects to write or flush their data.
148 // The table system takes care of storing the information required
149 // to reconstruct the data managers. It uses the function dataManagerType
150 // to store the (unique) type name of the data manager class.
151 // <li>
152 // Finally each data manager object gets deleted. Their destructors
153 // must delete their column objects (if any and if needed).
154 // </ul>
155 // For an existing table the procedure is slightly different:
156 // <ul>
157 // <li>
158 // The statement
159 // <br><src> Table tab("name.data"); </src>
160 // will create a table object for an existing table. This has the effect
161 // that the given table file will be read to reconstruct the Table object
162 // and the data managers.
163 // <li>
164 // The stored data manager class names are used to reconstruct
165 // the data managers. This uses the static registration map, which
166 // maps the class name to a static class constructor function (usually
167 // called makeObject). This requires that the type name and constructor
168 // for each possible data manager are registered before the table
169 // is opened. The DataManager function registerMainCtor (implemented
170 // in DataManager.cc) is called before a table is opened, so registration
171 // of data managers should, in principle, be done there.
172 // <br>However, for unknown data managers it is tried to load a shared
173 // library whose name is the lowercase version of the data manager without a
174 // possible template argument (e.g. <src>bitflagsengine</src> for
175 // data manager <src>BitFlagsEngine<Int></src>).
176 // It can be preceeded by lib or libcasa_ and followed by .so or .dylib.
177 // The shared library has to have a function with a name like
178 // <src>register_bitflagsengine</src> that must register the data manager(s).
179 // The function must be declared as <src>extern "C"</src>, otherwise its
180 // name gets mangled.
181 // <li>
182 // Each table column is bound to the correct data manager. The sequence
183 // number stored in the table file is used for that purpose.
184 // <li>
185 // The DataManager createXXXColumn functions are called for each table
186 // column to let the data manager construct a data manager column object.
187 // <li>
188 // For each data manager the open function is called to allow it and
189 // its column objects to read back the information stored in the
190 // flush function.
191 // Thereafter the prepare function is called for each data manager
192 // to allow it to initialize some variables.
193 // The reason that open and prepare are separated is that in order to
194 // initialize variables it may be required to use other columns.
195 // So it may be needed that all columns are read back before they
196 // get initialized.
197 // <li>
198 // Similar to a new table the flush functions gets called when the
199 // table gets written. Destruction is also the same as sketched
200 // for new tables.
201 // </ul>
202 // </synopsis>
203 
204 // <motivation>
205 // An abstract base class is needed to support data managers and
206 // virtual column engines in the table system in a transparant way.
207 // </motivation>
208 
209 // <todo asof="$DATE:$">
210 //# A List of bugs, limitations, extensions or planned refinements.
211 // <li> Handle unregistered data managers in a better way.
212 // Instead of throwing an exception a subprocess could be
213 // started which represents the data manager.
214 // </todo>
215 
216 
218 {
219 friend class SetupNewTable;
220 friend class ColumnSet;
221 
222 public:
223 
224  // Default constructor.
226 
227  virtual ~DataManager();
228 
229  // Make a clone of the derived object.
230  virtual DataManager* clone() const = 0;
231 
232  // Return the name of the data manager. This is the name of this
233  // instantiation of the data manager, thus not its type name.
234  // By default it returns an empty string.
235  virtual String dataManagerName() const;
236 
237  // Return the type name of the data manager (in fact its class name).
238  // It has to be a unique name, thus if the class is templated
239  // the template parameter has to be part of the name.
240  // This is used by the open/flush mechanism to be able to reconstruct
241  // the correct data manager.
242  virtual String dataManagerType() const = 0;
243 
244  // Add SEQNR and SPEC (the DataManagerSpec subrecord) to the info.
245  void dataManagerInfo (Record& info) const;
246 
247  // Return a record containing data manager specifications.
248  // The default implementation returns an empty record.
249  virtual Record dataManagerSpec() const;
250 
251  // Get data manager properties that can be modified.
252  // It is a subset of the data manager specification.
253  // The default implementation returns an empty record.
254  virtual Record getProperties() const;
255 
256  // Modify data manager properties given in record fields. Only the
257  // properties as returned by getProperties are used, others are ignored.
258  // The default implementation does nothing.
259  virtual void setProperties (const Record& spec);
260 
261  // Is the data manager a storage manager?
262  // The default is yes.
263  virtual Bool isStorageManager() const;
264 
265  // Tell if the data manager wants to reallocate the data manager
266  // column objects.
267  // This is used by the tiling storage manager.
268  // By default it returns False.
269  virtual Bool canReallocateColumns() const;
270 
271  // Reallocate the column object if it is part of this data manager.
272  // It returns a pointer to the new column object.
273  // This function is used by the tiling storage manager.
274  // By default it does nothing and returns the input pointer.
276 
277  // Get the (unique) sequence nr of this data manager.
278  uInt sequenceNr() const
279  { return seqnr_p; }
280 
281  // Get the nr of columns in this data manager (can be zero).
282  uInt ncolumn() const
283  { return nrcol_p; }
284 
285  // Have the data to be stored in big or little endian canonical format?
287  { return asBigEndian_p; }
288 
289  // Get the TSM option.
290  const TSMOption& tsmOption() const
291  { return tsmOption_p; }
292 
293  // Get the MultiFile pointer (can be 0).
295  { return multiFile_p; }
296 
297  // Compose a keyword name from the given keyword appended with the
298  // sequence number (e.g. key_0).
299  // This makes the keyword name unique if multiple data managers
300  // are used with the same type.
301  String keywordName (const String& keyword) const;
302 
303  // Compose a unique filename from the table name and sequence number.
304  String fileName() const;
305 
306  // Get the AipsIO option of the underlying file.
308 
309  // Is this a regular storage manager?
310  // It is regular if it allows addition of rows and writing data in them.
311  // <br>The default implementation returns True.
312  virtual Bool isRegular() const;
313 
314  // Get the table this object is associated with.
315  Table& table() const
316  { return *table_p; }
317 
318  // Reopen the data manager for read/write access.
319  // By default it is assumed that a reopen for read/write does
320  // not have to do anything.
321  virtual void reopenRW();
322 
323  // Does the data manager allow to add rows? (default no)
324  virtual Bool canAddRow() const;
325 
326  // Does the data manager allow to delete rows? (default no)
327  virtual Bool canRemoveRow() const;
328 
329  // Does the data manager allow to add columns? (default no)
330  virtual Bool canAddColumn() const;
331 
332  // Does the data manager allow to delete columns? (default no)
333  virtual Bool canRemoveColumn() const;
334 
335  // Does the data manager allow to rename columns? (default yes)
336  virtual Bool canRenameColumn() const;
337 
338  // Set the maximum cache size (in bytes) to be used by a storage manager.
339  // The default implementation does nothing.
340  virtual void setMaximumCacheSize (uInt nMiB);
341 
342  // Show the data manager's IO statistics. By default it does nothing.
343  virtual void showCacheStatistics (std::ostream&) const;
344 
345  // Create a column in the data manager on behalf of a table column.
346  // It calls makeXColumn and checks the data type.
347  // <group>
348  // Create a scalar column.
349  // The <src>dataTypeId</src> argument is gives the id (i.e. name)
350  // of the data type of the column. It is only used for virtual
351  // columns of a non-standard data type to be able to check if
352  // the correctness of the column data type.
353  // <br>Storage managers only handle standard data types and
354  // can readily ignore this argument.
356  int dataType,
357  const String& dataTypeId);
358  // Create a direct array column.
360  int dataType,
361  const String& dataTypeId);
362  // Create an indirect array column.
364  int dataType,
365  const String& dataTypeId);
366  // </group>
367 
368  // The data manager will be deleted (because all its columns are
369  // requested to be deleted).
370  // So clean up the things needed (e.g. delete files).
371  virtual void deleteManager() = 0;
372 
373 
374 protected:
375  // Decrement number of columns (in case a column is deleted).
377  { nrcol_p--; }
378 
379  // Tell the data manager if big or little endian format is needed.
380  void setEndian (Bool bigEndian)
381  { asBigEndian_p = bigEndian; }
382 
383  // Tell the data manager which TSM option to use.
385 
386  // Tell the data manager that MultiFile can be used.
387  // Because MultiFile cannot be used with mmapped files, it sets
388  // the TSMOption accordingly.
390 
391  // Does the data manager support use of MultiFile?
392  // A derived class has to return True if it can use the MultiFile.
393  // The default implementation returns False.
394  virtual Bool hasMultiFileSupport() const;
395 
396  // Throw an exception in case data type is TpOther, because the
397  // storage managers (and maybe other data managers) do not support
398  // such columns.
399  void throwDataTypeOther (const String& columnName, int dataType) const;
400 
401 
402 private:
403  uInt nrcol_p; //# #columns in this st.man.
404  uInt seqnr_p; //# Unique nr of this st.man. in a Table
405  Bool asBigEndian_p; //# store data in big or little endian
407  MultiFileBase* multiFile_p; //# MultiFile to use; 0=no MultiFile
408  Table* table_p; //# Table this data manager belongs to
409  mutable DataManager* clone_p; //# Pointer to clone (used by SetupNewTab)
410 
411 
412  // The copy constructor cannot be used for this base class.
413  // The clone function should be used instead.
414  // The private declaration of this constructor makes it unusable.
416 
417  // Assignment cannot be used for this base class.
418  // The private declaration of this operator makes it unusable.
420 
421  // Create a column in the data manager on behalf of a table column.
422  //# Should be private, but has to be public because friend
423  //# declaration gave internal CFront error.
424  // <group>
425  // Create a scalar column.
426  virtual DataManagerColumn* makeScalarColumn (const String& columnName,
427  int dataType,
428  const String& dataTypeId) = 0;
429  // Create a direct array column.
430  virtual DataManagerColumn* makeDirArrColumn (const String& columnName,
431  int dataType,
432  const String& dataTypeId) = 0;
433  // Create an indirect array column.
434  virtual DataManagerColumn* makeIndArrColumn (const String& columnName,
435  int dataType,
436  const String& dataTypeId) = 0;
437  // </group>
438 
439  // Check if the data type of the created data manager column is correct.
440  void checkDataType (const DataManagerColumn* colPtr,
441  const String& columnName,
442  int dataType, const String& dataTypeId) const;
443 
444  // Add rows to all columns.
445  // <br>The default implementation calls the uInt version.
446  virtual void addRow64 (rownr_t nrrow);
447 
448  // Delete a row from all columns.
449  // <br>The default implementation calls the uInt version.
450  virtual void removeRow64 (rownr_t rownr);
451 
452  // Add a column.
453  // The default implementation throws a "not possible" exception.
454  virtual void addColumn (DataManagerColumn*);
455 
456  // Delete a column.
457  // The default implementation throws a "not possible" exception.
459 
460  // Set the sequence number of this data manager.
461  void setSeqnr (uInt nr)
462  { seqnr_p = nr; }
463 
464  // Link the data manager to the Table object.
465  void linkToTable (Table& tab);
466 
467  // Flush and optionally fsync the data.
468  // The AipsIO stream represents the main table file and can be
469  // used by virtual column engines to store SMALL amounts of data.
470  // It returns a True status if it had to flush (i.e. if data have changed).
471  virtual Bool flush (AipsIO& ios, Bool fsync) = 0;
472 
473  // Let the data manager initialize itself for a new table.
474  // <br>The default implementation calls the uInt version.
475  virtual void create64 (rownr_t nrrow);
476 
477  // Let the data manager initialize itself for an existing table.
478  // The AipsIO stream represents the main table file and must be
479  // used by virtual column engines to retrieve the data stored
480  // in the flush function.
481  // <br>The data manager returns 0 or the nr of rows it thinks there are.
482  // This is particularly useful for data managers like LofarStMan whose
483  // data are written outside the table system, thus for which no rows
484  // have been added.
485  // <br>The default implementation calls the uInt version of open and open1.
486  virtual rownr_t open64 (rownr_t nrrow, AipsIO& ios);
487 
488  // Resync the data by rereading cached data from the file.
489  // This is called when a lock is acquired on the file and it appears
490  // that data in this data manager has been changed by another process.
491  // <br>The data manager returns 0 or the number of rows it thinks there are.
492  // This is particularly useful for data managers like LofarStMan whose
493  // data are written outside the table system, thus for which no rows
494  // have been added.
495  // <br>The default implementation calls the uInt version of resync and
496  // resync1.
497  virtual rownr_t resync64 (rownr_t nrrow);
498 
499  // Let the data manager initialize itself further.
500  // Prepare is called after create/open has been called for all
501  // columns. In this way one can be sure that referenced columns
502  // are read back and partly initialized.
503  // The default implementation does nothing.
504  virtual void prepare();
505 
506  // Backward compatibility function using uInt instead of rownr_t.
507  // The default implementations throw an exception.
508  // <group>
509  virtual void addRow (uInt nrrow);
510  virtual void removeRow (uInt rownr);
511  virtual void create (uInt nrrow);
512  virtual void open (uInt nrrow, AipsIO& ios);
513  virtual uInt open1 (uInt nrrow, AipsIO& ios);
514  virtual void resync (uInt nrrow);
515  virtual uInt resync1 (uInt nrrow);
516  // </group>
517 
518  // Declare the mapping of the data manager type name to a static
519  // "makeObject" function.
520  static std::map<String,DataManagerCtor> theirRegisterMap;
522 
523 public:
524  // Has the object already been cloned?
526  { return clone_p; }
527 
528  // Set the pointer to the clone.
529  void setClone (DataManager* clone) const
530  { clone_p = clone; }
531 
532  // Register a mapping of a data manager type to its static construction
533  // function. It is fully thread-safe.
534  static void registerCtor (const String& type, DataManagerCtor func);
535 
536  // Get the "constructor" of a data manager (thread-safe).
537  static DataManagerCtor getCtor (const String& dataManagerType);
538 
539  // Test if a data manager is registered (thread-safe).
541 
542  // Serve as default function for theirRegisterMap, which catches all
543  // unknown data manager types.
544  // <thrown>
545  // <li> TableUnknownDataManager
546  // </thrown>
548  const Record& spec);
549 
550  // Define the highest row number that can be represented as signed 32-bit.
551  // In principle it is the maximum uInt number, but for test purposes it
552  // can be reset (to a lower number).
553  static rownr_t MAXROWNR32; //# set to 2147483647
554 
555 private:
556  // Register the main data managers.
557  static std::map<String,DataManagerCtor> initRegisterMap();
558 };
559 
560 
561 } //# NAMESPACE CASACORE - END
562 
563 #endif
OpenOption
Define the possible ByteIO open options.
Definition: ByteIO.h:65
Abstract base class for a data manager.
Definition: DataManager.h:218
virtual String dataManagerType() const =0
Return the type name of the data manager (in fact its class name).
virtual void resync(uInt nrrow)
virtual void removeColumn(DataManagerColumn *)
Delete a column.
virtual void addColumn(DataManagerColumn *)
Add a column.
virtual void showCacheStatistics(std::ostream &) const
Show the data manager's IO statistics.
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...
void setSeqnr(uInt nr)
Set the sequence number of this data manager.
Definition: DataManager.h:461
ByteIO::OpenOption fileOption() const
Get the AipsIO option of the underlying file.
virtual rownr_t resync64(rownr_t nrrow)
Resync the data by rereading cached data from the file.
static DataManagerCtor getCtor(const String &dataManagerType)
Get the "constructor" of a data manager (thread-safe).
static std::map< String, DataManagerCtor > initRegisterMap()
Register the main data managers.
void dataManagerInfo(Record &info) const
Add SEQNR and SPEC (the DataManagerSpec subrecord) to the info.
void setEndian(Bool bigEndian)
Tell the data manager if big or little endian format is needed.
Definition: DataManager.h:380
virtual Record getProperties() const
Get data manager properties that can be modified.
DataManager * clone_p
Definition: DataManager.h:409
virtual void deleteManager()=0
The data manager will be deleted (because all its columns are requested to be deleted).
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 Bool canRemoveRow() const
Does the data manager allow to delete rows? (default no)
virtual void create64(rownr_t nrrow)
Let the data manager initialize itself for a new table.
virtual Bool canRemoveColumn() const
Does the data manager allow to delete columns? (default no)
DataManager(const DataManager &)
The copy constructor cannot be used for this base class.
DataManagerColumn * createScalarColumn(const String &columnName, int dataType, const String &dataTypeId)
Create a column in the data manager on behalf of a table column.
virtual Bool canRenameColumn() const
Does the data manager allow to rename columns? (default yes)
DataManagerColumn * createIndArrColumn(const String &columnName, int dataType, const String &dataTypeId)
Create an indirect array column.
virtual void removeRow64(rownr_t rownr)
Delete a row from all columns.
virtual void removeRow(uInt rownr)
void decrementNcolumn()
Decrement number of columns (in case a column is deleted).
Definition: DataManager.h:376
Table & table() const
Get the table this object is associated with.
Definition: DataManager.h:315
static std::map< String, DataManagerCtor > theirRegisterMap
Declare the mapping of the data manager type name to a static "makeObject" function.
Definition: DataManager.h:520
DataManager & operator=(const DataManager &)
Assignment cannot be used for this base class.
virtual Bool canReallocateColumns() const
Tell if the data manager wants to reallocate the data manager column objects.
uInt ncolumn() const
Get the nr of columns in this data manager (can be zero).
Definition: DataManager.h:282
virtual void reopenRW()
Reopen the data manager for read/write access.
virtual Bool canAddColumn() const
Does the data manager allow to add columns? (default no)
virtual void addRow64(rownr_t nrrow)
Add rows to all columns.
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 Record dataManagerSpec() const
Return a record containing data manager specifications.
String keywordName(const String &keyword) const
Compose a keyword name from the given keyword appended with the sequence number (e....
virtual void prepare()
Let the data manager initialize itself further.
static DataManager * unknownDataManager(const String &dataManagerType, const Record &spec)
Serve as default function for theirRegisterMap, which catches all unknown data manager types.
virtual void addRow(uInt nrrow)
Backward compatibility function using uInt instead of rownr_t.
DataManager()
Default constructor.
virtual void setProperties(const Record &spec)
Modify data manager properties given in record fields.
virtual Bool isRegular() const
Is this a regular storage manager? It is regular if it allows addition of rows and writing data in th...
DataManager * getClone() const
Has the object already been cloned?
Definition: DataManager.h:525
virtual uInt resync1(uInt nrrow)
virtual Bool isStorageManager() const
Is the data manager a storage manager? The default is yes.
void setClone(DataManager *clone) const
Set the pointer to the clone.
Definition: DataManager.h:529
MultiFileBase * multiFile_p
Definition: DataManager.h:407
virtual DataManagerColumn * makeIndArrColumn(const String &columnName, int dataType, const String &dataTypeId)=0
Create an indirect array column.
Bool asBigEndian() const
Have the data to be stored in big or little endian canonical format?
Definition: DataManager.h:286
virtual rownr_t open64(rownr_t nrrow, AipsIO &ios)
Let the data manager initialize itself for an existing table.
virtual DataManagerColumn * makeDirArrColumn(const String &columnName, int dataType, const String &dataTypeId)=0
Create a direct array column.
virtual String dataManagerName() const
Return the name of the data manager.
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.
virtual uInt open1(uInt nrrow, AipsIO &ios)
virtual DataManager * clone() const =0
Make a clone of the derived object.
DataManagerColumn * createDirArrColumn(const String &columnName, int dataType, const String &dataTypeId)
Create a direct array column.
MultiFileBase * multiFile()
Get the MultiFile pointer (can be 0).
Definition: DataManager.h:294
virtual void setMaximumCacheSize(uInt nMiB)
Set the maximum cache size (in bytes) to be used by a storage manager.
void linkToTable(Table &tab)
Link the data manager to the Table object.
const TSMOption & tsmOption() const
Get the TSM option.
Definition: DataManager.h:290
virtual Bool canAddRow() const
Does the data manager allow to add rows? (default no)
static Bool isRegistered(const String &dataManagerType)
Test if a data manager is registered (thread-safe).
static void registerCtor(const String &type, DataManagerCtor func)
Register a mapping of a data manager type to its static construction function.
virtual void open(uInt nrrow, AipsIO &ios)
virtual DataManagerColumn * reallocateColumn(DataManagerColumn *column)
Reallocate the column object if it is part of this data manager.
virtual void create(uInt nrrow)
virtual Bool flush(AipsIO &ios, Bool fsync)=0
Flush and optionally fsync the data.
uInt sequenceNr() const
Get the (unique) sequence nr of this data manager.
Definition: DataManager.h:278
void setTsmOption(const TSMOption &tsmOption)
Tell the data manager which TSM option to use.
void setMultiFile(MultiFileBase *mfile)
Tell the data manager that MultiFile can be used.
static rownr_t MAXROWNR32
Define the highest row number that can be represented as signed 32-bit.
Definition: DataManager.h:553
String fileName() const
Compose a unique filename from the table name and sequence number.
static Mutex theirMutex
Definition: DataManager.h:521
Abstract base class to combine multiple files in a single one.
Create a new table - define shapes, data managers, etc.
Definition: SetupNewTab.h:341
String: the storage and methods of handling collections of characters.
Definition: String.h:223
this file contains all the compiler specific defines
Definition: mainpage.dox:28
unsigned int uInt
Definition: aipstype.h:51
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
uInt64 rownr_t
Define the type of a row number in a table.
Definition: aipsxtype.h:46