1 #ifndef DYSCO_STORAGE_MANAGER_H
2 #define DYSCO_STORAGE_MANAGER_H
4 #include <casacore/tables/DataMan/DataManager.h>
6 #include <casacore/casa/Containers/Record.h>
28 #ifndef DOXYGEN_SHOULD_SKIP_THIS
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
41 class DyscoStManColumn;
240 std::lock_guard<std::mutex> lock(
_mutex);
313 unsigned char *dest,
size_t size);
316 const unsigned char *data,
size_t size);
Abstract base class for a data manager.
String: the storage and methods of handling collections of characters.
Base class for columns of the DyscoStMan.
The main class for the Dysco storage manager.
virtual casacore::Bool canRemoveColumn() const final override
Whether columns can be removed.
virtual casacore::rownr_t open64(casacore::rownr_t nRow, casacore::AipsIO &) final override
Open the storage manager file for an existing table.
virtual void deleteManager() final override
The data manager will be deleted (because all its columns are requested to be deleted).
virtual casacore::String dataManagerType() const final override
Type of manager.
virtual casacore::DataManagerColumn * makeDirArrColumn(const casacore::String &name, int dataType, const casacore::String &dataTypeID) final override
Create a direct array column.
static void registerClass()
This function makes the DyscoStMan known to casacore.
std::unique_ptr< std::fstream > _fStream
Normalization _normalization
virtual casacore::String dataManagerName() const final override
Returns the name of this manager as specified during construction.
void writeCompressedData(size_t blockIndex, const DyscoStManColumn *column, const unsigned char *data, size_t size)
static const unsigned short VERSION_MAJOR
virtual casacore::DataManagerColumn * makeIndArrColumn(const casacore::String &name, int dataType, const casacore::String &dataTypeID) final override
Create an indirect array column.
virtual void reopenRW() final override
Reopen the storage manager files for read/write.
void SetGaussianDistribution()
Initialize the storage manager to use a Gaussian distribution for the quantization.
void SetStudentsTDistribution(double nu)
Initialize the storage manager to use a Student T distribution for the quantization (i....
void SetTruncatedGaussianDistribution(double truncationSigma)
Initialize the storage manager to use a Uniform distribution for the quantization (i....
virtual void addRow64(casacore::rownr_t nrrow) final override
Add rows to the storage manager.
void readCompressedData(size_t blockIndex, const DyscoStManColumn *column, unsigned char *dest, size_t size)
virtual void prepare() final override
Prepare the columns, let the data manager initialize itself further.
void SetStaticSeed(bool staticSeed)
double _distributionTruncation
virtual casacore::DataManager * clone() const final override
Polymorphical copy constructor, equal to DyscoStMan(const DyscoStMan&).
size_t nAntennae() const
Number of antennae used in a time block.
virtual casacore::Bool flush(casacore::AipsIO &, casacore::Bool doFsync) final override
Flush and optionally fsync the data.
virtual void addColumn(casacore::DataManagerColumn *) final override
Do the final addition of a column.
virtual void create64(casacore::rownr_t nRow) final override
Let the storage manager create files as needed for a new table.
size_t getFileOffset(size_t blockIndex) const
void setFromSpec(const casacore::Record &spec)
DyscoStMan & operator=(const DyscoStMan &source)=delete
Assignment – new dyscostman takes the settings of the source (but not the columns and/or data).
virtual casacore::Bool canAddColumn() const final override
Whether columns can be added.
void initializeRowsPerBlock(size_t rowsPerBlock, size_t antennaCount, bool writeToHeader)
To be called by a column once it determines rowsPerBlock and antennaCount.
uint64_t nBlocksInFile() const
The number of rows that are actually stored in the file.
static const unsigned short VERSION_MINOR
uint getNRow() const
Get the number of rows in the measurement set.
DyscoDistribution _distribution
void SetUniformDistribution()
Initialize the storage manager to use a Uniform distribution for the quantization (i....
size_t nRowsInBlock() const
Number of rows in one "time-block", i.e.
std::vector< std::unique_ptr< DyscoStManColumn > > _columns
uint64_t getRowIndex(size_t block) const
Calculate first measurement set row index of a given block index.
DyscoStMan(const DyscoStMan &source)
Copy constructor that initializes a storage manager with similar specs.
virtual casacore::Bool canAddRow() const final override
Whether rows can be added.
virtual casacore::Bool canRemoveRow() const final override
Whether rows can be removed.
size_t getRowWithinBlock(uint64_t row) const
Return the offset of the row within the block.
virtual casacore::rownr_t resync64(casacore::rownr_t nRow) final override
void SetNormalization(Normalization normalization)
Set the type of normalization.
size_t getBlockIndex(uint64_t row) const
Return index of block that contains the given measurement set row.
virtual void removeColumn(casacore::DataManagerColumn *) final override
Remove a column from the data file.
virtual casacore::Record dataManagerSpec() const final override
Get manager specifications.
static casacore::DataManager * makeObject(const casacore::String &name, const casacore::Record &spec)
Create an object with given name and spec.
bool areOffsetsInitialized() const
This method returns true when the number of rows per block and the number of antennae per block are k...
DyscoStMan(const casacore::String &name, const casacore::Record &spec)
This constructor is called by Casa when it needs to create a DyscoStMan.
virtual void removeRow64(casacore::rownr_t rowNr) final override
Delete a row from all columns.
DyscoStMan(unsigned dataBitRate, unsigned weightBitRate, const casacore::String &name="DyscoStMan")
Convenience constructor to create a new storage manager with some settings without having to fill a '...
virtual casacore::DataManagerColumn * makeScalarColumn(const casacore::String &name, int dataType, const casacore::String &dataTypeID) final override
Create a column in the storage manager on behalf of a table column.
void register_dyscostman()
this file contains all the compiler specific defines
bool Bool
Define the standard types used by Casacore.
uInt64 rownr_t
Define the type of a row number in a table.
@ TruncatedGaussianDistribution
Define real & complex conjugation for non-complex types and put comparisons into std namespace.
Header file for uvector and its relational and swap functions.