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