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