casacore
Loading...
Searching...
No Matches
AntennaPairStMan.h
Go to the documentation of this file.
1#ifndef CASACORE_ANTENNA_PAIR_STORAGE_MANAGER_H_
2#define CASACORE_ANTENNA_PAIR_STORAGE_MANAGER_H_
3
4#include <casacore/tables/DataMan/DataManager.h>
5
6#include <casacore/casa/Containers/Record.h>
7
8#include "AntennaPairFile.h"
9
10#include <memory>
11#include <stdexcept>
12
13namespace casacore {
14
15class AntennaPairStManColumn;
16
20class AntennaPairStMan final : public DataManager {
21 public:
22 AntennaPairStMan(const String &, const Record &);
23
28
30
31 AntennaPairStMan &operator=(const AntennaPairStMan &source) = delete;
32
33 DataManager *clone() const final { return new AntennaPairStMan(*this); }
34
35 static DataManager *makeObject(const String &name, const Record &spec) {
36 return new AntennaPairStMan(name, spec);
37 }
38
39 String dataManagerType() const final { return "AntennaPairStMan"; }
40
41 Record dataManagerSpec() const final { return Record(); }
42
43 casacore::Bool canAddColumn() const final { return true; }
44
45 private:
46 Bool flush(AipsIO &, Bool) final { return false; }
47
48 void create64(rownr_t nRow) final;
49
50 rownr_t open64(rownr_t nRow, AipsIO &) final;
51
52 DataManagerColumn *makeScalarColumn(const String &name, int dataType,
53 const String &dataTypeID) final;
54
56 const String &) final {
57 throw std::runtime_error(
58 "makeDirArrColumn() called on a AntennaPairStMan. AntennaPairStMan can "
59 "only make scalar columns");
60 }
61
63 const String &) final {
64 throw std::runtime_error(
65 "makeIndArrColumn() called on a AntennaPairStMan. AntennaPairStMan can "
66 "only make scalar columns");
67 }
68
69 rownr_t resync64(rownr_t nRow) final { return nRow; }
70
71 void deleteManager() final;
72
73 // Reopen the storage manager files for read/write.
74 void reopenRW() final {}
75
76 // Add rows to the storage manager.
77 void addRow64(rownr_t nrrow) final;
78
79 // Delete a row from all columns.
80 void removeRow64(rownr_t row_nr) final;
81
82 // Do the final addition of a column.
84
85 // Remove a column from the data file.
87
88 std::string name_;
89 std::array<std::unique_ptr<AntennaPairStManColumn>, 2> columns_;
91};
92
93} // namespace casacore
94
95#endif
This class is able to store the combination of ANTENNA1 and ANTENNA2 columns in a compressed manner.
A storage manager that saves the antenna columns with (lossless) compression.
Record dataManagerSpec() const final
Return a record containing data manager specifications.
void create64(rownr_t nRow) final
Let the data manager initialize itself for a new table.
void removeColumn(DataManagerColumn *) final
Remove a column from the data file.
void addColumn(DataManagerColumn *) final
Do the final addition of a column.
rownr_t resync64(rownr_t nRow) final
Resync the data by rereading cached data from the file.
void deleteManager() final
The data manager will be deleted (because all its columns are requested to be deleted).
Bool flush(AipsIO &, Bool) final
Flush and optionally fsync the data.
String dataManagerType() const final
Return the type name of the data manager (in fact its class name).
AntennaPairStMan(const String &, const Record &)
DataManagerColumn * makeScalarColumn(const String &name, int dataType, const String &dataTypeID) final
Create a column in the data manager on behalf of a table column.
void reopenRW() final
Reopen the storage manager files for read/write.
DataManager * clone() const final
Make a clone of the derived object.
casacore::Bool canAddColumn() const final
Does the data manager allow to add columns? (default no)
AntennaPairStMan(const AntennaPairStMan &source)
The columns are not copied: the new manager will be empty.
std::array< std::unique_ptr< AntennaPairStManColumn >, 2 > columns_
DataManagerColumn * makeDirArrColumn(const String &, int, const String &) final
Create a direct array column.
rownr_t open64(rownr_t nRow, AipsIO &) final
Let the data manager initialize itself for an existing table.
void addRow64(rownr_t nrrow) final
Add rows to the storage manager.
void removeRow64(rownr_t row_nr) final
Delete a row from all columns.
static DataManager * makeObject(const String &name, const Record &spec)
DataManagerColumn * makeIndArrColumn(const String &, int, const String &) final
Create an indirect array column.
Abstract base class for a data manager.
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
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