casacore
Loading...
Searching...
No Matches
UvwStMan.h
Go to the documentation of this file.
1#ifndef CASACORE_UVW_STORAGE_MANAGER_H_
2#define CASACORE_UVW_STORAGE_MANAGER_H_
3
4#include <casacore/tables/DataMan/DataManager.h>
5
6#include <casacore/casa/Containers/Record.h>
7
8#include "UvwFile.h"
9
10#include <memory>
11#include <stdexcept>
12
13namespace casacore {
14
15class UvwStManColumn;
16
24class UvwStMan final : public DataManager {
25 public:
26 UvwStMan(const String &, const Record &);
27
31 UvwStMan(const UvwStMan &source);
32
33 ~UvwStMan() noexcept;
34
35 UvwStMan &operator=(const UvwStMan &source) = delete;
36
37 DataManager *clone() const final { return new UvwStMan(*this); }
38
39 static DataManager *makeObject(const String &name, const Record &spec) {
40 return new UvwStMan(name, spec);
41 }
42
43 String dataManagerType() const final { return "UvwStMan"; }
44
45 Record dataManagerSpec() const final { return Record(); }
46
47 private:
48 Bool flush(AipsIO &, Bool) final { return false; }
49
50 void create64(rownr_t nRow) final;
51
52 rownr_t open64(rownr_t nRow, AipsIO &) final;
53
55 const String &) final {
56 throw std::runtime_error(
57 "makeScalarColumn() called on a UvwStMan. UvwStMan can only make array "
58 "columns");
59 }
60
61 DataManagerColumn *makeDirArrColumn(const String &name, int dataType,
62 const String &dataTypeID) final;
63
65 const String &) final {
66 throw std::runtime_error(
67 "makeIndArrColumn() called on a UvwStMan. UvwStMan can only make "
68 "direct columns");
69 }
70
71 rownr_t resync64(rownr_t nRow) final { return nRow; }
72
73 void deleteManager() final;
74
75 // Prepare is called after create/open has been called for all
76 // columns. In this way one can be sure that referenced columns
77 // are read back and partly initialized.
78 void prepare() final;
79
80 // Reopen the storage manager files for read/write.
81 void reopenRW() final {}
82
83 // Add rows to the storage manager.
84 void addRow64(rownr_t nrrow) final;
85
86 // Delete a row from all columns.
87 void removeRow64(rownr_t row_nr) final;
88
89 // Do the final addition of a column.
91
92 // Remove a column from the data file.
94
95 std::string name_;
96 std::unique_ptr<UvwStManColumn> column_;
98};
99
100} // namespace casacore
101
102#endif
Abstract base class for a data manager.
String: the storage and methods of handling collections of characters.
Definition String.h:223
Stores values of a UVW column in a compressed way.
Definition UvwFile.h:49
A storage manager that saves the UVW with (lossless) compression.
Definition UvwStMan.h:24
UvwStMan(const UvwStMan &source)
The columns are not copied: the new manager will be empty.
DataManagerColumn * makeScalarColumn(const String &, int, const String &) final
Create a column in the data manager on behalf of a table column.
Definition UvwStMan.h:54
~UvwStMan() noexcept
void prepare() final
Prepare is called after create/open has been called for all columns.
void create64(rownr_t nRow) final
Let the data manager initialize itself for a new table.
rownr_t open64(rownr_t nRow, AipsIO &) final
Let the data manager initialize itself for an existing table.
String dataManagerType() const final
Return the type name of the data manager (in fact its class name).
Definition UvwStMan.h:43
rownr_t resync64(rownr_t nRow) final
Resync the data by rereading cached data from the file.
Definition UvwStMan.h:71
void removeColumn(DataManagerColumn *) final
Remove a column from the data file.
std::unique_ptr< UvwStManColumn > column_
Definition UvwStMan.h:96
static DataManager * makeObject(const String &name, const Record &spec)
Definition UvwStMan.h:39
void reopenRW() final
Reopen the storage manager files for read/write.
Definition UvwStMan.h:81
Bool flush(AipsIO &, Bool) final
Flush and optionally fsync the data.
Definition UvwStMan.h:48
void deleteManager() final
The data manager will be deleted (because all its columns are requested to be deleted).
Record dataManagerSpec() const final
Return a record containing data manager specifications.
Definition UvwStMan.h:45
DataManager * clone() const final
Make a clone of the derived object.
Definition UvwStMan.h:37
void removeRow64(rownr_t row_nr) final
Delete a row from all columns.
std::string name_
Definition UvwStMan.h:95
void addColumn(DataManagerColumn *) final
Do the final addition of a column.
DataManagerColumn * makeDirArrColumn(const String &name, int dataType, const String &dataTypeID) final
Create a direct array column.
UvwStMan(const String &, const Record &)
void addRow64(rownr_t nrrow) final
Add rows to the storage manager.
DataManagerColumn * makeIndArrColumn(const String &, int, const String &) final
Create an indirect array column.
Definition UvwStMan.h:64
this file contains all the compiler specific defines
Definition mainpage.dox:28
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