casacore
Loading...
Searching...
No Matches
SiscoStMan.h
Go to the documentation of this file.
1#ifndef CASACORE_SISCO_ST_MAN_H_
2#define CASACORE_SISCO_ST_MAN_H_
3
4#include <casacore/tables/DataMan/DataManager.h>
5
6#include "SiscoStoreMode.h"
7
8#include <memory>
9
10#ifndef DOXYGEN_SHOULD_SKIP_THIS
11extern "C" {
12#endif
14#ifndef DOXYGEN_SHOULD_SKIP_THIS
15}
16#endif
17
18namespace casacore {
19
21
26class SiscoStMan final : public casacore::DataManager {
27 public:
38
43 SiscoStMan(const SiscoStMan &source);
44
45 ~SiscoStMan() noexcept;
46
51 SiscoStMan &operator=(const SiscoStMan &source) = delete;
52
53 casacore::DataManager *clone() const final { return new SiscoStMan(*this); }
63 const casacore::Record &spec) {
64 return new SiscoStMan(name, spec);
65 }
66
67 casacore::String dataManagerType() const final { return "SiscoStMan"; }
68
70
71 bool canAddRow() const final { return true; }
72
73 bool canRemoveRow() const final { return false; }
74
75 bool canAddColumn() const final { return !column_; }
76
77 bool canRemoveColumn() const final { return static_cast<bool>(column_); }
78
82 static void registerClass();
83
84 int DeflateLevel() const { return deflate_level_; }
85 int PredictLevel() const { return predict_level_; }
86
87 protected:
88 private:
89 friend class SiscoStManColumn;
90
92 [[maybe_unused]] casacore::Bool doFsync) final {
93 return false;
94 }
95
96 // Let the storage manager create files as needed for a new table.
97 // This allows a column with an indirect array to create its file.
98 void create64(casacore::rownr_t nRow) final;
99
100 // Open the storage manager file for an existing table.
101 // Return the number of rows in the data file.
103
104 // Create a column in the storage manager on behalf of a table column.
105 // The caller will NOT delete the newly created object.
106 // Create a scalar column.
108 const casacore::String &name, int dataType,
109 const casacore::String &dataTypeID) final;
110
111 // Create a direct array column.
113 const casacore::String &name, int dataType,
114 const casacore::String &dataTypeID) final;
115
116 // Create an indirect array column.
118 const casacore::String &name, int dataType,
119 const casacore::String &dataTypeID) final;
120
122
123 void deleteManager() final;
124
125 // Prepare the columns, let the data manager initialize itself further.
126 // Prepare is called after create/open has been called for all
127 // columns. In this way one can be sure that referenced columns
128 // are read back and partly initialized.
129 void prepare() final;
130
131 // Reopen the storage manager files for read/write.
132 void reopenRW() final;
133
134 // Add rows to the storage manager.
135 void addRow64(casacore::rownr_t nrrow) final;
136
137 // Delete a row from all columns.
138 void removeRow64(casacore::rownr_t row_nr) final;
139
140 // Do the final addition of a column.
142
143 // Remove a column from the data file.
145
146 std::string name_;
147 // The item-type needs to be a pointer, because casacore::StManColumn
148 // does not have move construct/assignment.
153};
154
155} // namespace casacore
156
157#endif
void register_siscostman()
Abstract base class for a data manager.
DataManager()
Default constructor.
Base class for columns of the StokesIStMan.
void addRow64(casacore::rownr_t nrrow) final
Add rows to the storage manager.
void deleteManager() final
The data manager will be deleted (because all its columns are requested to be deleted).
casacore::rownr_t open64(casacore::rownr_t nRow, casacore::AipsIO &) final
Open the storage manager file for an existing table.
bool canRemoveRow() const final
Does the data manager allow to delete rows?
Definition SiscoStMan.h:73
SiscoStMan(const SiscoStMan &source)
Copy constructor that initializes a storage manager with similar specs.
friend class SiscoStManColumn
Definition SiscoStMan.h:89
casacore::DataManagerColumn * makeDirArrColumn(const casacore::String &name, int dataType, const casacore::String &dataTypeID) final
Create a direct array column.
casacore::DataManagerColumn * makeIndArrColumn(const casacore::String &name, int dataType, const casacore::String &dataTypeID) final
Create an indirect array column.
void removeRow64(casacore::rownr_t row_nr) final
Delete a row from all columns.
casacore::Record dataManagerSpec() const final
Return a record containing data manager specifications.
int PredictLevel() const
Definition SiscoStMan.h:85
void addColumn(casacore::DataManagerColumn *) final
Do the final addition of a column.
casacore::rownr_t resync64(casacore::rownr_t nRow) final
Resync the data by rereading cached data from the file.
void removeColumn(casacore::DataManagerColumn *) final
Remove a column from the data file.
SiscoStoreMode store_mode_
Definition SiscoStMan.h:152
casacore::Bool flush(casacore::AipsIO &, casacore::Bool doFsync) final
Flush and optionally fsync the data.
Definition SiscoStMan.h:91
static void registerClass()
This function makes the SiscoStMan known to Casacore.
std::unique_ptr< SiscoStManColumn > column_
The item-type needs to be a pointer, because casacore::StManColumn does not have move construct/assig...
Definition SiscoStMan.h:149
bool canAddColumn() const final
Does the data manager allow to add columns?
Definition SiscoStMan.h:75
~SiscoStMan() noexcept
casacore::String dataManagerType() const final
Return the type name of the data manager (in fact its class name).
Definition SiscoStMan.h:67
void prepare() final
Prepare the columns, let the data manager initialize itself further.
casacore::DataManagerColumn * makeScalarColumn(const casacore::String &name, int dataType, const casacore::String &dataTypeID) final
Create a column in the storage manager on behalf of a table column.
int DeflateLevel() const
Definition SiscoStMan.h:84
void reopenRW() final
Reopen the storage manager files for read/write.
bool canRemoveColumn() const final
Does the data manager allow to delete columns?
Definition SiscoStMan.h:77
casacore::DataManager * clone() const final
Make a clone of the derived object.
Definition SiscoStMan.h:53
SiscoStMan(const casacore::String &name, const casacore::Record &spec)
This constructor is called by Casacore when it needs to create a SiscoStMan.
bool canAddRow() const final
Does the data manager allow to add rows?
Definition SiscoStMan.h:71
static casacore::DataManager * makeObject(const casacore::String &name, const casacore::Record &spec)
Create an object with given name and spec.
Definition SiscoStMan.h:62
void create64(casacore::rownr_t nRow) final
Let the storage manager create files as needed for a new table.
String: the storage and methods of handling collections of characters.
Definition String.h:223
bool Bool
Define the standard types used by Casacore.
uInt64 rownr_t
Define the type of a row number in a table.
this file contains all the compiler specific defines
Definition mainpage.dox:28
String name() const
Return the name of the field.
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44
DataType dataType(const RecordFieldId &) const
Define real & complex conjugation for non-complex types and put comparisons into std namespace.
Definition Complex.h:350