Loading...
Searching...
No Matches
AntennaPairStMan.h
Go to the documentation of this file.
#ifndef CASACORE_ANTENNA_PAIR_STORAGE_MANAGER_H_
#define CASACORE_ANTENNA_PAIR_STORAGE_MANAGER_H_
#include <casacore/tables/DataMan/DataManager.h>
#include <casacore/casa/Containers/Record.h>
#include "AntennaPairFile.h"
#include <memory>
#include <stdexcept>
namespace casacore {
class AntennaPairStManColumn;
class AntennaPairStMan final : public DataManager {
public:
AntennaPairStMan(const String &, const Record &);
AntennaPairStMan(const AntennaPairStMan &source);
~AntennaPairStMan() noexcept;
AntennaPairStMan &operator=(const AntennaPairStMan &source) = delete;
DataManager *clone() const final { return new AntennaPairStMan(*this); }
static DataManager *makeObject(const String &name, const Record &spec) {
return new AntennaPairStMan(name, spec);
}
String dataManagerType() const final { return "AntennaPairStMan"; }
Record dataManagerSpec() const final { return Record(); }
casacore::Bool canAddColumn() const final { return true; }
private:
Bool flush(AipsIO &, Bool) final { return false; }
void create64(rownr_t nRow) final;
rownr_t open64(rownr_t nRow, AipsIO &) final;
DataManagerColumn *makeScalarColumn(const String &name, int dataType,
const String &dataTypeID) final;
DataManagerColumn *makeDirArrColumn(const String &, int,
const String &) final {
throw std::runtime_error(
"makeDirArrColumn() called on a AntennaPairStMan. AntennaPairStMan can "
"only make scalar columns");
}
DataManagerColumn *makeIndArrColumn(const String &, int,
const String &) final {
throw std::runtime_error(
"makeIndArrColumn() called on a AntennaPairStMan. AntennaPairStMan can "
"only make scalar columns");
}
rownr_t resync64(rownr_t nRow) final { return nRow; }
void deleteManager() final;
// Reopen the storage manager files for read/write.
void reopenRW() final {}
// Add rows to the storage manager.
void addRow64(rownr_t nrrow) final;
// Delete a row from all columns.
void removeRow64(rownr_t row_nr) final;
// Do the final addition of a column.
void addColumn(DataManagerColumn *) final {}
// Remove a column from the data file.
void removeColumn(DataManagerColumn *) final;
std::string name_;
std::array<std::unique_ptr<AntennaPairStManColumn>, 2> columns_;
AntennaPairFile file_;
};
} // namespace casacore
#endif
AntennaPairFile.h
casacore::AipsIO
Definition AipsIO.h:167
casacore::AntennaPairFile
This class is able to store the combination of ANTENNA1 and ANTENNA2 columns in a compressed manner.
Definition AntennaPairFile.h:24
casacore::AntennaPairStManColumn
Definition AntennaPairStManColumn.h:16
casacore::AntennaPairStMan::dataManagerSpec
Record dataManagerSpec() const final
Return a record containing data manager specifications.
Definition AntennaPairStMan.h:41
casacore::AntennaPairStMan::create64
void create64(rownr_t nRow) final
Let the data manager initialize itself for a new table.
casacore::AntennaPairStMan::removeColumn
void removeColumn(DataManagerColumn *) final
Remove a column from the data file.
casacore::AntennaPairStMan::addColumn
void addColumn(DataManagerColumn *) final
Do the final addition of a column.
Definition AntennaPairStMan.h:83
casacore::AntennaPairStMan::resync64
rownr_t resync64(rownr_t nRow) final
Resync the data by rereading cached data from the file.
Definition AntennaPairStMan.h:69
casacore::AntennaPairStMan::deleteManager
void deleteManager() final
The data manager will be deleted (because all its columns are requested to be deleted).
casacore::AntennaPairStMan::~AntennaPairStMan
~AntennaPairStMan() noexcept
casacore::AntennaPairStMan::name_
std::string name_
Definition AntennaPairStMan.h:88
casacore::AntennaPairStMan::flush
Bool flush(AipsIO &, Bool) final
Flush and optionally fsync the data.
Definition AntennaPairStMan.h:46
casacore::AntennaPairStMan::dataManagerType
String dataManagerType() const final
Return the type name of the data manager (in fact its class name).
Definition AntennaPairStMan.h:39
casacore::AntennaPairStMan::AntennaPairStMan
AntennaPairStMan(const String &, const Record &)
casacore::AntennaPairStMan::makeScalarColumn
DataManagerColumn * makeScalarColumn(const String &name, int dataType, const String &dataTypeID) final
Create a column in the data manager on behalf of a table column.
casacore::AntennaPairStMan::reopenRW
void reopenRW() final
Reopen the storage manager files for read/write.
Definition AntennaPairStMan.h:74
casacore::AntennaPairStMan::clone
DataManager * clone() const final
Make a clone of the derived object.
Definition AntennaPairStMan.h:33
casacore::AntennaPairStMan::file_
AntennaPairFile file_
Definition AntennaPairStMan.h:90
casacore::AntennaPairStMan::canAddColumn
casacore::Bool canAddColumn() const final
Does the data manager allow to add columns?
Definition AntennaPairStMan.h:43
casacore::AntennaPairStMan::AntennaPairStMan
AntennaPairStMan(const AntennaPairStMan &source)
The columns are not copied: the new manager will be empty.
casacore::AntennaPairStMan::columns_
std::array< std::unique_ptr< AntennaPairStManColumn >, 2 > columns_
Definition AntennaPairStMan.h:89
casacore::AntennaPairStMan::makeDirArrColumn
DataManagerColumn * makeDirArrColumn(const String &, int, const String &) final
Create a direct array column.
Definition AntennaPairStMan.h:55
casacore::AntennaPairStMan::open64
rownr_t open64(rownr_t nRow, AipsIO &) final
Let the data manager initialize itself for an existing table.
casacore::AntennaPairStMan::addRow64
void addRow64(rownr_t nrrow) final
Add rows to the storage manager.
casacore::AntennaPairStMan::removeRow64
void removeRow64(rownr_t row_nr) final
Delete a row from all columns.
casacore::AntennaPairStMan::makeObject
static DataManager * makeObject(const String &name, const Record &spec)
Definition AntennaPairStMan.h:35
casacore::AntennaPairStMan::makeIndArrColumn
DataManagerColumn * makeIndArrColumn(const String &, int, const String &) final
Create an indirect array column.
Definition AntennaPairStMan.h:62
casacore::DataManagerColumn
Definition DataManagerColumn.h:149
casacore::DataManager::DataManager
DataManager()
Default constructor.
casacore::String
String: the storage and methods of handling collections of characters.
Definition String.h:223
casacore::Record
Record()
casacore::casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition LatticeStatistics.h:41
casacore
this file contains all the compiler specific defines
Definition mainpage.dox:28
casacore::name
String name() const
Return the name of the field.
Definition RecordField.h:163
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
casacore::rownr_t
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44
casacore::dataType
DataType dataType(const RecordFieldId &) const