casacore
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
casacore::StokesIStMan Class Referencefinal

The Stokes I storage manager behaves like a full set of (4) polarizations but only stores the Stokes I value on disk. More...

#include <StokesIStMan.h>

Public Member Functions

 StokesIStMan (const casacore::String &name, const casacore::Record &spec)
 This constructor is called by Casacore when it needs to create a StokesIStMan.
 
 StokesIStMan (const StokesIStMan &source)
 Copy constructor that initializes a storage manager with similar specs.
 
 ~StokesIStMan () noexcept
 
StokesIStManoperator= (const StokesIStMan &source)=delete
 This StokesIStMan takes the settings of the source (but not the columns and/or data).
 
casacore::DataManagerclone () const final
 Make a clone of the derived object.
 
casacore::String dataManagerType () const final
 Return the type name of the data manager (in fact its class name).
 
casacore::Record dataManagerSpec () const final
 Return a record containing data manager specifications.
 
casacore::Bool canAddRow () const final
 Does the data manager allow to add rows? (default no)
 
casacore::Bool canRemoveRow () const final
 Does the data manager allow to delete rows? (default no)
 
casacore::Bool canAddColumn () const final
 Does the data manager allow to add columns? (default no)
 
casacore::Bool canRemoveColumn () const final
 Does the data manager allow to delete columns? (default no)
 
- Public Member Functions inherited from casacore::DataManager
 DataManager ()
 Default constructor.
 
virtual ~DataManager ()
 
 DataManager (const DataManager &)=delete
 The copy constructor cannot be used for this base class.
 
DataManageroperator= (const DataManager &)=delete
 Assignment cannot be used for this base class.
 
virtual String dataManagerName () const
 Return the name of the data manager.
 
void dataManagerInfo (Record &info) const
 Add SEQNR and SPEC (the DataManagerSpec subrecord) to the info.
 
virtual Record getProperties () const
 Get data manager properties that can be modified.
 
virtual void setProperties (const Record &spec)
 Modify data manager properties given in record fields.
 
virtual Bool isStorageManager () const
 Is the data manager a storage manager? The default is yes.
 
virtual Bool canReallocateColumns () const
 Tell if the data manager wants to reallocate the data manager column objects.
 
virtual DataManagerColumnreallocateColumn (DataManagerColumn *column)
 Reallocate the column object if it is part of this data manager.
 
uInt sequenceNr () const
 Get the (unique) sequence nr of this data manager.
 
uInt ncolumn () const
 Get the nr of columns in this data manager (can be zero).
 
Bool asBigEndian () const
 Have the data to be stored in big or little endian canonical format?
 
const TSMOptiontsmOption () const
 Get the TSM option.
 
std::shared_ptr< MultiFileBasemultiFile ()
 Get the MultiFile pointer (can be 0).
 
String keywordName (const String &keyword) const
 Compose a keyword name from the given keyword appended with the sequence number (e.g.
 
String fileName () const
 Compose a unique filename from the table name and sequence number.
 
ByteIO::OpenOption fileOption () const
 Get the AipsIO option of the underlying file.
 
virtual Bool isRegular () const
 Is this a regular storage manager? It is regular if it allows addition of rows and writing data in them.
 
Tabletable () const
 Get the table this object is associated with.
 
virtual Bool canRenameColumn () const
 Does the data manager allow to rename columns? (default yes)
 
virtual void setMaximumCacheSize (uInt nMiB)
 Set the maximum cache size (in bytes) to be used by a storage manager.
 
virtual void showCacheStatistics (std::ostream &) const
 Show the data manager's IO statistics.
 
DataManagerColumncreateScalarColumn (const String &columnName, int dataType, const String &dataTypeId)
 Create a column in the data manager on behalf of a table column.
 
DataManagerColumncreateDirArrColumn (const String &columnName, int dataType, const String &dataTypeId)
 Create a direct array column.
 
DataManagerColumncreateIndArrColumn (const String &columnName, int dataType, const String &dataTypeId)
 Create an indirect array column.
 
DataManagergetClone () const
 Has the object already been cloned?
 
void setClone (DataManager *clone) const
 Set the pointer to the clone.
 

Static Public Member Functions

static casacore::DataManagermakeObject (const casacore::String &name, const casacore::Record &spec)
 Create an object with given name and spec.
 
static void registerClass ()
 This function makes the StokesIStMan known to Casacore.
 
- Static Public Member Functions inherited from casacore::DataManager
static void registerCtor (const String &type, DataManagerCtor func)
 Register a mapping of a data manager type to its static construction function.
 
static DataManagerCtor getCtor (const String &dataManagerType)
 Get the "constructor" of a data manager (thread-safe).
 
static Bool isRegistered (const String &dataManagerType)
 Test if a data manager is registered (thread-safe).
 
static DataManagerunknownDataManager (const String &dataManagerType, const Record &spec)
 Serve as default function for theirRegisterMap, which catches all unknown data manager types.
 

Private Member Functions

uint64_t CalculateAndUpdateStride ()
 
casacore::Bool flush (casacore::AipsIO &, casacore::Bool doFsync) final
 Flush and optionally fsync the data.
 
void create64 (casacore::rownr_t nRow) final
 Let the storage manager create files as needed for a new table.
 
casacore::rownr_t open64 (casacore::rownr_t nRow, casacore::AipsIO &) final
 Open the storage manager file for an existing table.
 
casacore::DataManagerColumnmakeScalarColumn (const casacore::String &name, int dataType, const casacore::String &dataTypeID) final
 Create a column in the storage manager on behalf of a table column.
 
casacore::DataManagerColumnmakeDirArrColumn (const casacore::String &name, int dataType, const casacore::String &dataTypeID) final
 Create a direct array column.
 
casacore::DataManagerColumnmakeIndArrColumn (const casacore::String &name, int dataType, const casacore::String &dataTypeID) final
 Create an indirect array column.
 
casacore::rownr_t resync64 (casacore::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).
 
void prepare () final
 Prepare the columns, let the data manager initialize itself further.
 
void reopenRW () final
 Reopen the storage manager files for read/write.
 
void addRow64 (casacore::rownr_t nrrow) final
 Add rows to the storage manager.
 
void removeRow64 (casacore::rownr_t row_nr) final
 Delete a row from all columns.
 
void addColumn (casacore::DataManagerColumn *) final
 Do the final addition of a column.
 
void removeColumn (casacore::DataManagerColumn *) final
 Remove a column from the data file.
 

Private Attributes

std::string name_
 
std::vector< std::unique_ptr< StokesIStManColumn > > columns_
 The item-type needs to be a pointer, because casacore::StManColumn does not have move construct/assignment.
 
BufferedColumnarFile file_
 

Static Private Attributes

static constexpr size_t kHeaderSize
 
static constexpr const char kMagicHeaderTag [8]
 

Friends

class StokesIStManColumn
 

Additional Inherited Members

- Static Public Attributes inherited from casacore::DataManager
static rownr_t MAXROWNR32
 Define the highest row number that can be represented as signed 32-bit.
 
- Protected Member Functions inherited from casacore::DataManager
void decrementNcolumn ()
 Decrement number of columns (in case a column is deleted).
 
void setEndian (Bool bigEndian)
 Tell the data manager if big or little endian format is needed.
 
void setTsmOption (const TSMOption &tsmOption)
 Tell the data manager which TSM option to use.
 
void setMultiFile (const std::shared_ptr< MultiFileBase > &mfile)
 Tell the data manager that MultiFile can be used.
 
virtual Bool hasMultiFileSupport () const
 Does the data manager support use of MultiFile? A derived class has to return True if it can use the MultiFile.
 
void throwDataTypeOther (const String &columnName, int dataType) const
 Throw an exception in case data type is TpOther, because the storage managers (and maybe other data managers) do not support such columns.
 

Detailed Description

The Stokes I storage manager behaves like a full set of (4) polarizations but only stores the Stokes I value on disk.

Definition at line 26 of file StokesIStMan.h.

Constructor & Destructor Documentation

◆ StokesIStMan() [1/2]

casacore::StokesIStMan::StokesIStMan ( const casacore::String name,
const casacore::Record spec 
)

This constructor is called by Casacore when it needs to create a StokesIStMan.

When Casacore loads an StokesIStMan for an existing MS, the "spec" parameter will be empty, thus the class should initialize its properties by reading them from the file. The spec is used to make a new storage manager with specs similar to another one.

Parameters
nameName of this storage manager.
specSpecs to initialize this class with.

◆ StokesIStMan() [2/2]

casacore::StokesIStMan::StokesIStMan ( const StokesIStMan source)

Copy constructor that initializes a storage manager with similar specs.

The columns are not copied: the new manager will be empty.

◆ ~StokesIStMan()

casacore::StokesIStMan::~StokesIStMan ( )
noexcept

Member Function Documentation

◆ addColumn()

void casacore::StokesIStMan::addColumn ( casacore::DataManagerColumn )
finalprivatevirtual

Do the final addition of a column.

Reimplemented from casacore::DataManager.

◆ addRow64()

void casacore::StokesIStMan::addRow64 ( casacore::rownr_t  nrrow)
finalprivatevirtual

Add rows to the storage manager.

Reimplemented from casacore::DataManager.

◆ CalculateAndUpdateStride()

uint64_t casacore::StokesIStMan::CalculateAndUpdateStride ( )
private

◆ canAddColumn()

casacore::Bool casacore::StokesIStMan::canAddColumn ( ) const
inlinefinalvirtual

Does the data manager allow to add columns? (default no)

Reimplemented from casacore::DataManager.

Definition at line 75 of file StokesIStMan.h.

◆ canAddRow()

casacore::Bool casacore::StokesIStMan::canAddRow ( ) const
inlinefinalvirtual

Does the data manager allow to add rows? (default no)

Reimplemented from casacore::DataManager.

Definition at line 71 of file StokesIStMan.h.

◆ canRemoveColumn()

casacore::Bool casacore::StokesIStMan::canRemoveColumn ( ) const
inlinefinalvirtual

Does the data manager allow to delete columns? (default no)

Reimplemented from casacore::DataManager.

Definition at line 77 of file StokesIStMan.h.

◆ canRemoveRow()

casacore::Bool casacore::StokesIStMan::canRemoveRow ( ) const
inlinefinalvirtual

Does the data manager allow to delete rows? (default no)

Reimplemented from casacore::DataManager.

Definition at line 73 of file StokesIStMan.h.

◆ clone()

casacore::DataManager * casacore::StokesIStMan::clone ( ) const
inlinefinalvirtual

Make a clone of the derived object.

Implements casacore::DataManager.

Definition at line 53 of file StokesIStMan.h.

◆ create64()

void casacore::StokesIStMan::create64 ( casacore::rownr_t  nRow)
finalprivatevirtual

Let the storage manager create files as needed for a new table.

This allows a column with an indirect array to create its file.

Reimplemented from casacore::DataManager.

◆ dataManagerSpec()

casacore::Record casacore::StokesIStMan::dataManagerSpec ( ) const
finalvirtual

Return a record containing data manager specifications.

The default implementation returns an empty record.

Reimplemented from casacore::DataManager.

◆ dataManagerType()

casacore::String casacore::StokesIStMan::dataManagerType ( ) const
inlinefinalvirtual

Return the type name of the data manager (in fact its class name).

It has to be a unique name, thus if the class is templated the template parameter has to be part of the name. This is used by the open/flush mechanism to be able to reconstruct the correct data manager.

Implements casacore::DataManager.

Definition at line 67 of file StokesIStMan.h.

◆ deleteManager()

void casacore::StokesIStMan::deleteManager ( )
finalprivatevirtual

The data manager will be deleted (because all its columns are requested to be deleted).

So clean up the things needed (e.g. delete files).

Implements casacore::DataManager.

◆ flush()

casacore::Bool casacore::StokesIStMan::flush ( casacore::AipsIO ios,
casacore::Bool  fsync 
)
inlinefinalprivatevirtual

Flush and optionally fsync the data.

The AipsIO stream represents the main table file and can be used by virtual column engines to store SMALL amounts of data. It returns a True status if it had to flush (i.e. if data have changed).

Implements casacore::DataManager.

Definition at line 90 of file StokesIStMan.h.

◆ makeDirArrColumn()

casacore::DataManagerColumn * casacore::StokesIStMan::makeDirArrColumn ( const casacore::String name,
int  dataType,
const casacore::String dataTypeID 
)
finalprivatevirtual

Create a direct array column.

Implements casacore::DataManager.

◆ makeIndArrColumn()

casacore::DataManagerColumn * casacore::StokesIStMan::makeIndArrColumn ( const casacore::String name,
int  dataType,
const casacore::String dataTypeID 
)
finalprivatevirtual

Create an indirect array column.

Implements casacore::DataManager.

◆ makeObject()

static casacore::DataManager * casacore::StokesIStMan::makeObject ( const casacore::String name,
const casacore::Record spec 
)
inlinestatic

Create an object with given name and spec.

This methods gets registered in the DataManager "constructor" map. The caller has to delete the object. New class will be initialized via StokesIStMan(const casacore::String& name, const casacore::Record& spec).

Returns
A StokesIStMan with given specs.

Definition at line 62 of file StokesIStMan.h.

◆ makeScalarColumn()

casacore::DataManagerColumn * casacore::StokesIStMan::makeScalarColumn ( const casacore::String name,
int  dataType,
const casacore::String dataTypeID 
)
finalprivatevirtual

Create a column in the storage manager on behalf of a table column.

The caller will NOT delete the newly created object. Create a scalar column.

Implements casacore::DataManager.

◆ open64()

casacore::rownr_t casacore::StokesIStMan::open64 ( casacore::rownr_t  nRow,
casacore::AipsIO  
)
finalprivatevirtual

Open the storage manager file for an existing table.

Return the number of rows in the data file.

Reimplemented from casacore::DataManager.

◆ operator=()

StokesIStMan & casacore::StokesIStMan::operator= ( const StokesIStMan source)
delete

This StokesIStMan takes the settings of the source (but not the columns and/or data).

◆ prepare()

void casacore::StokesIStMan::prepare ( )
finalprivatevirtual

Prepare the columns, let the data manager initialize itself further.

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.

Reimplemented from casacore::DataManager.

◆ registerClass()

static void casacore::StokesIStMan::registerClass ( )
static

This function makes the StokesIStMan known to Casacore.

◆ removeColumn()

void casacore::StokesIStMan::removeColumn ( casacore::DataManagerColumn )
finalprivatevirtual

Remove a column from the data file.

Reimplemented from casacore::DataManager.

◆ removeRow64()

void casacore::StokesIStMan::removeRow64 ( casacore::rownr_t  row_nr)
finalprivatevirtual

Delete a row from all columns.

Reimplemented from casacore::DataManager.

◆ reopenRW()

void casacore::StokesIStMan::reopenRW ( )
finalprivatevirtual

Reopen the storage manager files for read/write.

Reimplemented from casacore::DataManager.

◆ resync64()

casacore::rownr_t casacore::StokesIStMan::resync64 ( casacore::rownr_t  nrrow)
finalprivatevirtual

Resync the data by rereading cached data from the file.

This is called when a lock is acquired on the file and it appears that data in this data manager has been changed by another process.
The data manager returns 0 or the number of rows it thinks there are. This is particularly useful for data managers like LofarStMan whose data are written outside the table system, thus for which no rows have been added.
The default implementation calls the uInt version of resync and resync1.

Reimplemented from casacore::DataManager.

Friends And Related Symbol Documentation

◆ StokesIStManColumn

friend class StokesIStManColumn
friend

Definition at line 86 of file StokesIStMan.h.

Member Data Documentation

◆ columns_

std::vector<std::unique_ptr<StokesIStManColumn> > casacore::StokesIStMan::columns_
private

The item-type needs to be a pointer, because casacore::StManColumn does not have move construct/assignment.

Definition at line 148 of file StokesIStMan.h.

◆ file_

BufferedColumnarFile casacore::StokesIStMan::file_
private

Definition at line 149 of file StokesIStMan.h.

◆ kHeaderSize

constexpr size_t casacore::StokesIStMan::kHeaderSize
staticconstexprprivate

Definition at line 150 of file StokesIStMan.h.

◆ kMagicHeaderTag

constexpr const char casacore::StokesIStMan::kMagicHeaderTag[8]
staticconstexprprivate

Definition at line 151 of file StokesIStMan.h.

◆ name_

std::string casacore::StokesIStMan::name_
private

Definition at line 145 of file StokesIStMan.h.


The documentation for this class was generated from the following file: