Loading...
Searching...
No Matches
UvwStMan.h
Go to the documentation of this file.
#ifndef CASACORE_UVW_STORAGE_MANAGER_H_
#define CASACORE_UVW_STORAGE_MANAGER_H_
#include <casacore/tables/DataMan/DataManager.h>
#include <casacore/casa/Containers/Record.h>
#include "UvwFile.h"
#include <memory>
#include <stdexcept>
namespace casacore {
class UvwStManColumn;
class UvwStMan final : public DataManager {
public:
UvwStMan(const String &, const Record &);
UvwStMan(const UvwStMan &source);
~UvwStMan() noexcept;
UvwStMan &operator=(const UvwStMan &source) = delete;
DataManager *clone() const final { return new UvwStMan(*this); }
static DataManager *makeObject(const String &name, const Record &spec) {
return new UvwStMan(name, spec);
}
String dataManagerType() const final { return "UvwStMan"; }
Record dataManagerSpec() const final { return Record(); }
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 &, int,
const String &) final {
throw std::runtime_error(
"makeScalarColumn() called on a UvwStMan. UvwStMan can only make array "
"columns");
}
DataManagerColumn *makeDirArrColumn(const String &name, int dataType,
const String &dataTypeID) final;
DataManagerColumn *makeIndArrColumn(const String &, int,
const String &) final {
throw std::runtime_error(
"makeIndArrColumn() called on a UvwStMan. UvwStMan can only make "
"direct columns");
}
rownr_t resync64(rownr_t nRow) final { return nRow; }
void deleteManager() final;
// Prepare is called after create/open has been called for all
// columns. In this way one can be sure that referenced columns
// are read back and partly initialized.
void prepare() 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::unique_ptr<UvwStManColumn> column_;
UvwFile file_;
};
} // namespace casacore
#endif
UvwFile.h
casacore::AipsIO
Definition AipsIO.h:167
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::UvwFile
Stores values of a UVW column in a compressed way.
Definition UvwFile.h:49
casacore::UvwStManColumn
Definition UvwStManColumn.h:16
casacore::UvwStMan::UvwStMan
UvwStMan(const UvwStMan &source)
The columns are not copied: the new manager will be empty.
casacore::UvwStMan::makeScalarColumn
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
casacore::UvwStMan::~UvwStMan
~UvwStMan() noexcept
casacore::UvwStMan::prepare
void prepare() final
Prepare is called after create/open has been called for all columns.
casacore::UvwStMan::create64
void create64(rownr_t nRow) final
Let the data manager initialize itself for a new table.
casacore::UvwStMan::open64
rownr_t open64(rownr_t nRow, AipsIO &) final
Let the data manager initialize itself for an existing table.
casacore::UvwStMan::dataManagerType
String dataManagerType() const final
Return the type name of the data manager (in fact its class name).
Definition UvwStMan.h:43
casacore::UvwStMan::resync64
rownr_t resync64(rownr_t nRow) final
Resync the data by rereading cached data from the file.
Definition UvwStMan.h:71
casacore::UvwStMan::removeColumn
void removeColumn(DataManagerColumn *) final
Remove a column from the data file.
casacore::UvwStMan::column_
std::unique_ptr< UvwStManColumn > column_
Definition UvwStMan.h:96
casacore::UvwStMan::makeObject
static DataManager * makeObject(const String &name, const Record &spec)
Definition UvwStMan.h:39
casacore::UvwStMan::reopenRW
void reopenRW() final
Reopen the storage manager files for read/write.
Definition UvwStMan.h:81
casacore::UvwStMan::flush
Bool flush(AipsIO &, Bool) final
Flush and optionally fsync the data.
Definition UvwStMan.h:48
casacore::UvwStMan::deleteManager
void deleteManager() final
The data manager will be deleted (because all its columns are requested to be deleted).
casacore::UvwStMan::dataManagerSpec
Record dataManagerSpec() const final
Return a record containing data manager specifications.
Definition UvwStMan.h:45
casacore::UvwStMan::clone
DataManager * clone() const final
Make a clone of the derived object.
Definition UvwStMan.h:37
casacore::UvwStMan::removeRow64
void removeRow64(rownr_t row_nr) final
Delete a row from all columns.
casacore::UvwStMan::name_
std::string name_
Definition UvwStMan.h:95
casacore::UvwStMan::addColumn
void addColumn(DataManagerColumn *) final
Do the final addition of a column.
casacore::UvwStMan::makeDirArrColumn
DataManagerColumn * makeDirArrColumn(const String &name, int dataType, const String &dataTypeID) final
Create a direct array column.
casacore::UvwStMan::UvwStMan
UvwStMan(const String &, const Record &)
casacore::UvwStMan::file_
UvwFile file_
Definition UvwStMan.h:97
casacore::UvwStMan::addRow64
void addRow64(rownr_t nrrow) final
Add rows to the storage manager.
casacore::UvwStMan::makeIndArrColumn
DataManagerColumn * makeIndArrColumn(const String &, int, const String &) final
Create an indirect array column.
Definition UvwStMan.h:64
casacore::Record
Record()
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