casacore
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::BitFlagsEngine< StoredType > Class Template Reference

Templated virtual column engine to map bit flags to a Bool. More...

#include <BitFlagsEngine.h>

Classes

struct  BoolToFlags
 Functor to convert Bools to flags using a mask. More...
 
struct  FlagsToBool
 Functor to and an array and mask and convert to Bool. More...
 

Public Member Functions

 BitFlagsEngine (const String &virtualColumnName, const String &storedColumnName, StoredType readMask=StoredType(0xffffffff), StoredType writeMask=1)
 Construct an engine to map integer arrays in a column to Bool arrays. More...
 
 BitFlagsEngine (const String &virtualColumnName, const String &storedColumnName, const Array< String > &readMaskKeys, const Array< String > &writeMaskKeys)
 Construct an engine to map integer arrays in a column to Bool arrays. More...
 
 BitFlagsEngine (const Record &spec)
 Construct from a record specification as created by dataManagerSpec(). More...
 
 ~BitFlagsEngine ()
 Destructor is mandatory. More...
 
virtual String dataManagerType () const
 Return the type name of the engine (i.e. More...
 
virtual String dataManagerName () const
 Get the name given to the engine (is the virtual column name). More...
 
virtual Record dataManagerSpec () const
 Record a record containing data manager specifications. More...
 
virtual Record getProperties () const
 Get data manager properties that can be modified. More...
 
virtual void setProperties (const Record &spec)
 Modify data manager properties. More...
 
- Public Member Functions inherited from casacore::BaseMappedArrayEngine< Bool, StoredType >
const StringvirtualName () const
 Get the virtual column name. More...
 
const StringstoredName () const
 Get the stored column name. More...
 
virtual Bool isWritable () const
 The column is writable if the underlying stored column is writable. More...
 
- Public Member Functions inherited from casacore::VirtualColumnEngine
 VirtualColumnEngine ()
 Create the object. More...
 
virtual ~VirtualColumnEngine ()
 
- Public Member Functions inherited from casacore::DataManager
 DataManager ()
 Default constructor. More...
 
virtual ~DataManager ()
 
void dataManagerInfo (Record &info) const
 Add SEQNR and SPEC (the DataManagerSpec subrecord) to the info. More...
 
virtual Bool canReallocateColumns () const
 Tell if the data manager wants to reallocate the data manager column objects. More...
 
virtual DataManagerColumnreallocateColumn (DataManagerColumn *column)
 Reallocate the column object if it is part of this data manager. More...
 
uInt sequenceNr () const
 Get the (unique) sequence nr of this data manager. More...
 
uInt ncolumn () const
 Get the nr of columns in this data manager (can be zero). More...
 
Bool asBigEndian () const
 Have the data to be stored in big or little endian canonical format? More...
 
const TSMOptiontsmOption () const
 Get the TSM option. More...
 
MultiFileBasemultiFile ()
 Get the MultiFile pointer (can be 0). More...
 
String keywordName (const String &keyword) const
 Compose a keyword name from the given keyword appended with the sequence number (e.g. More...
 
String fileName () const
 Compose a unique filename from the table name and sequence number. More...
 
ByteIO::OpenOption fileOption () const
 Get the AipsIO option of the underlying file. More...
 
virtual Bool isRegular () const
 Is this a regular storage manager? It is regular if it allows addition of rows and writing data in them. More...
 
Tabletable () const
 Get the table this object is associated with. More...
 
virtual void reopenRW ()
 Reopen the data manager for read/write access. More...
 
virtual Bool canAddColumn () const
 Does the data manager allow to add columns? (default no) More...
 
virtual Bool canRemoveColumn () const
 Does the data manager allow to delete columns? (default no) More...
 
virtual Bool canRenameColumn () const
 Does the data manager allow to rename columns? (default yes) More...
 
virtual void setMaximumCacheSize (uInt nMiB)
 Set the maximum cache size (in bytes) to be used by a storage manager. More...
 
virtual void showCacheStatistics (std::ostream &) const
 Show the data manager's IO statistics. More...
 
DataManagerColumncreateScalarColumn (const String &columnName, int dataType, const String &dataTypeId)
 Create a column in the data manager on behalf of a table column. More...
 
DataManagerColumncreateDirArrColumn (const String &columnName, int dataType, const String &dataTypeId)
 Create a direct array column. More...
 
DataManagerColumncreateIndArrColumn (const String &columnName, int dataType, const String &dataTypeId)
 Create an indirect array column. More...
 
DataManagergetClone () const
 Has the object already been cloned? More...
 
void setClone (DataManager *clone) const
 Set the pointer to the clone. More...
 
- Public Member Functions inherited from casacore::VirtualArrayColumn< T >
 VirtualArrayColumn ()
 Create a column. More...
 
virtual ~VirtualArrayColumn ()
 
virtual int dataType () const
 Return the data type of the column. More...
 
virtual String dataTypeId () const
 Return the data type Id of the column. More...
 
- Public Member Functions inherited from casacore::VirtualArrayColumnBase
 VirtualArrayColumnBase ()
 Create a column. More...
 
virtual ~VirtualArrayColumnBase ()
 
- Public Member Functions inherited from casacore::DataManagerColumn
 DataManagerColumn ()
 Create a column. More...
 
virtual ~DataManagerColumn ()
 Frees up the storage. More...
 
void setIsFixedShape (Bool isFixedShape)
 Set the isFixedShape flag. More...
 
Bool isFixedShape () const
 Is this a fixed shape column? More...
 
virtual void setMaxLength (uInt maxLength)
 Set the maximum length of the value (can be used for strings). More...
 
void setFixedShapeColumn (const IPosition &shape)
 Set the shape of all (fixed-shaped) arrays in the column. More...
 
virtual void setShapeTiled (rownr_t rownr, const IPosition &shape, const IPosition &tileShape)
 Set the shape and tile shape of an (variable-shaped) array in the given row. More...
 
virtual IPosition tileShape (rownr_t rownr)
 Get the tile shape of the item in the given row. More...
 
ColumnCachecolumnCache ()
 Get access to the ColumnCache object. More...
 
const ColumnCachecolumnCachePtr () const
 
void get (rownr_t rownr, Bool *dataPtr)
 Get the scalar value in the given row. More...
 
void get (rownr_t rownr, uChar *dataPtr)
 
void get (rownr_t rownr, Short *dataPtr)
 
void get (rownr_t rownr, uShort *dataPtr)
 
void get (rownr_t rownr, Int *dataPtr)
 
void get (rownr_t rownr, uInt *dataPtr)
 
void get (rownr_t rownr, Int64 *dataPtr)
 
void get (rownr_t rownr, float *dataPtr)
 
void get (rownr_t rownr, double *dataPtr)
 
void get (rownr_t rownr, Complex *dataPtr)
 
void get (rownr_t rownr, DComplex *dataPtr)
 
void get (rownr_t rownr, String *dataPtr)
 
void get (rownr_t rownr, void *dataPtr)
 This function is the get for all non-standard data types. More...
 
void put (rownr_t rownr, const Bool *dataPtr)
 Put the scalar value into the given row. More...
 
void put (rownr_t rownr, const uChar *dataPtr)
 
void put (rownr_t rownr, const Short *dataPtr)
 
void put (rownr_t rownr, const uShort *dataPtr)
 
void put (rownr_t rownr, const Int *dataPtr)
 
void put (rownr_t rownr, const uInt *dataPtr)
 
void put (rownr_t rownr, const Int64 *dataPtr)
 
void put (rownr_t rownr, const float *dataPtr)
 
void put (rownr_t rownr, const double *dataPtr)
 
void put (rownr_t rownr, const Complex *dataPtr)
 
void put (rownr_t rownr, const DComplex *dataPtr)
 
void put (rownr_t rownr, const String *dataPtr)
 
void put (rownr_t rownr, const void *dataPtr)
 This function is the put for all non-standard data types. More...
 
void throwGet () const
 Throw an "invalid operation" exception for the default implementation of get. More...
 
void throwPut () const
 Throw an "invalid operation" exception for the default implementation of put. More...
 
void setColumnName (const String &colName)
 Set the column name. More...
 
const StringcolumnName () const
 Get rhe column name. More...
 

Static Public Member Functions

static String className ()
 Return the name of the class. More...
 
static void registerClass ()
 Register the class name and the static makeObject "constructor". More...
 
static DataManagermakeObject (const String &dataManagerType, const Record &spec)
 Define the "constructor" to construct this engine when a table is read back. More...
 
- 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. More...
 
static DataManagerCtor getCtor (const String &dataManagerType)
 Get the "constructor" of a data manager (thread-safe). More...
 
static Bool isRegistered (const String &dataManagerType)
 Test if a data manager is registered (thread-safe). More...
 
static DataManagerunknownDataManager (const String &dataManagerType, const Record &spec)
 Serve as default function for theirRegisterMap, which catches all unknown data manager types. More...
 

Private Member Functions

 BitFlagsEngine (const BitFlagsEngine< StoredType > &)
 Copy constructor is only used by clone(). More...
 
BitFlagsEngine< StoredType > & operator= (const BitFlagsEngine< StoredType > &)
 Assignment is not needed and therefore forbidden (so it is made private and not implemented). More...
 
DataManagerclone () const
 Clone the engine object. More...
 
void create64 (rownr_t initialNrrow)
 Initialize the object for a new table. More...
 
void prepare ()
 Preparing consists of setting the writable switch and adding the initial number of rows in case of create. More...
 
void getArray (rownr_t rownr, Array< Bool > &array)
 Get an array in the given row. More...
 
void putArray (rownr_t rownr, const Array< Bool > &array)
 Put an array in the given row. More...
 
void getSlice (rownr_t rownr, const Slicer &slicer, Array< Bool > &array)
 Get a section of the array in the given row. More...
 
void putSlice (rownr_t rownr, const Slicer &slicer, const Array< Bool > &array)
 Put into a section of the array in the given row. More...
 
void getArrayColumn (Array< Bool > &array)
 Get an entire column. More...
 
void putArrayColumn (const Array< Bool > &array)
 Put an entire column. More...
 
virtual void getArrayColumnCells (const RefRows &rownrs, Array< Bool > &data)
 Get some array values in the column. More...
 
virtual void putArrayColumnCells (const RefRows &rownrs, const Array< Bool > &data)
 Put some array values in the column. More...
 
void getColumnSlice (const Slicer &slicer, Array< Bool > &array)
 Get a section of all arrays in the column. More...
 
void putColumnSlice (const Slicer &slicer, const Array< Bool > &array)
 Put a section of all arrays in the column. More...
 
virtual void getColumnSliceCells (const RefRows &rownrs, const Slicer &slicer, Array< Bool > &data)
 Get a section of some arrays in the column. More...
 
virtual void putColumnSliceCells (const RefRows &rownrs, const Slicer &slicer, const Array< Bool > &data)
 Put into a section of some arrays in the column. More...
 
void mapOnGet (Array< Bool > &array, const Array< StoredType > &stored)
 Map bit flags array to Bool array. More...
 
void mapOnPut (const Array< Bool > &array, Array< StoredType > &stored)
 Map Bool array to bit flags array. More...
 

Private Attributes

BFEngineMask itsBFEReadMask
 
BFEngineMask itsBFEWriteMask
 
StoredType itsReadMask
 
StoredType itsWriteMask
 
Bool itsIsNew
 

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. More...
 
- Protected Member Functions inherited from casacore::BaseMappedArrayEngine< Bool, StoredType >
 BaseMappedArrayEngine (const String &virtualColumnName, const String &storedColumnName)
 Construct an engine to convert the virtual column to the stored column. More...
 
 BaseMappedArrayEngine ()
 The default constructor is required for reconstruction of the engine when a table is read back. More...
 
 BaseMappedArrayEngine (const BaseMappedArrayEngine< Bool, StoredType > &)
 Copy constructor is only used by copy constructor of derived classes. More...
 
 ~BaseMappedArrayEngine ()
 Destructor is mandatory. More...
 
void setWritable (Bool isWritable)
 Set if the column is writable or not. More...
 
void setNames (const String &virtualName, const String &storedName)
 Set the virtual and stored column name. More...
 
ArrayColumn< StoredType > & column ()
 Give access to the stored column. More...
 
virtual DataManagerColumnmakeIndArrColumn (const String &columnName, int dataType, const String &dataTypeId)
 Create the column object for the array column in this engine. More...
 
void prepare1 ()
 Do the 2 stages of the prepare (define columns and adding rows). More...
 
void prepare2 ()
 
virtual void addRow64 (rownr_t nrrow)
 Rows are added to the end of the table. More...
 
virtual void addRowInit (rownr_t startRow, rownr_t nrrow)
 
virtual void setShapeColumn (const IPosition &shape)
 Set the shape of the FixedShape arrays in the column. More...
 
virtual void setShape (rownr_t rownr, const IPosition &shape)
 Define the shape of the array in the given row. More...
 
virtual Bool isShapeDefined (rownr_t rownr)
 Test if the (underlying) array is defined in the given row. More...
 
virtual uInt ndim (rownr_t rownr)
 Get the dimensionality of the (underlying) array in the given row. More...
 
virtual IPosition shape (rownr_t rownr)
 Get the shape of the (underlying) array in the given row. More...
 
virtual Bool canChangeShape () const
 The data manager can handle changing the shape of an existing array when the underlying stored column can do it. More...
 
TableColumn makeTableColumn (const String &columnName)
 Make a table column object for the given column. More...
 
void getColumnSlice (const Slicer &slicer, Array< Bool > &array)
 Get a section of all arrays in the column. More...
 
void putColumnSlice (const Slicer &slicer, const Array< Bool > &array)
 Put a section of all arrays in the column. More...
 
virtual IPosition getStoredShape (rownr_t rownr, const IPosition &virtualShape)
 Map the virtual shape to the stored shape. More...
 
virtual Slicer getStoredSlicer (const Slicer &virtualSlicer) const
 Map the slicer for a virtual shape to a stored shape. More...
 
- Protected Member Functions inherited from casacore::DataManager
void decrementNcolumn ()
 Decrement number of columns (in case a column is deleted). More...
 
void setEndian (Bool bigEndian)
 Tell the data manager if big or little endian format is needed. More...
 
void setTsmOption (const TSMOption &tsmOption)
 Tell the data manager which TSM option to use. More...
 
void setMultiFile (MultiFileBase *mfile)
 Tell the data manager that MultiFile can be used. More...
 
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. More...
 
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. More...
 
- Protected Member Functions inherited from casacore::VirtualArrayColumn< T >
virtual void getArray (rownr_t rownr, Array< T > &data)=0
 Get the array value in the given row. More...
 
virtual void putArray (rownr_t rownr, const Array< T > &data)
 Put the array value into the given row. More...
 
virtual void getSlice (rownr_t rownr, const Slicer &slicer, Array< T > &data)
 Get a section of the array in the given row. More...
 
virtual void putSlice (rownr_t rownr, const Slicer &slicer, const Array< T > &data)
 Put into a section of the array in the given row. More...
 
virtual void getArrayColumn (Array< T > &data)
 Get an entire column. More...
 
virtual void putArrayColumn (const Array< T > &data)
 Put an entire column. More...
 
virtual void getArrayColumnCells (const RefRows &rownrs, Array< T > &data)
 Get some array values in the column. More...
 
virtual void putArrayColumnCells (const RefRows &rownrs, const Array< T > &data)
 Put some array values in the column. More...
 
virtual void getColumnSlice (const Slicer &slicer, Array< T > &data)
 Get a section of all arrays in the column. More...
 
virtual void putColumnSlice (const Slicer &slicer, const Array< T > &data)
 Put a section of all arrays in the column. More...
 
virtual void getColumnSliceCells (const RefRows &rownrs, const Slicer &slicer, Array< T > &data)
 Get a section of some arrays in the column. More...
 
virtual void putColumnSliceCells (const RefRows &rownrs, const Slicer &slicer, const Array< T > &data)
 Put into a section of some arrays in the column. More...
 
- Protected Member Functions inherited from casacore::VirtualArrayColumnBase
virtual void getScalarColumnV (ArrayBase &dataPtr)
 The scalar access functions throw an exception. More...
 
virtual void putScalarColumnV (const ArrayBase &dataPtr)
 Put all scalar values in the column. More...
 
virtual void getScalarColumnCellsV (const RefRows &rownrs, ArrayBase &dataPtr)
 Get some scalar values in the column. More...
 
virtual void putScalarColumnCellsV (const RefRows &rownrs, const ArrayBase &dataPtr)
 Put some scalar values in the column. More...
 
- Protected Member Functions inherited from casacore::DataManagerColumn
virtual void getBool (rownr_t rownr, Bool *dataPtr)
 Get the scalar value in the given row. More...
 
virtual void getuChar (rownr_t rownr, uChar *dataPtr)
 
virtual void getShort (rownr_t rownr, Short *dataPtr)
 
virtual void getuShort (rownr_t rownr, uShort *dataPtr)
 
virtual void getInt (rownr_t rownr, Int *dataPtr)
 
virtual void getuInt (rownr_t rownr, uInt *dataPtr)
 
virtual void getInt64 (rownr_t rownr, Int64 *dataPtr)
 
virtual void getfloat (rownr_t rownr, float *dataPtr)
 
virtual void getdouble (rownr_t rownr, double *dataPtr)
 
virtual void getComplex (rownr_t rownr, Complex *dataPtr)
 
virtual void getDComplex (rownr_t rownr, DComplex *dataPtr)
 
virtual void getString (rownr_t rownr, String *dataPtr)
 
virtual void getOther (rownr_t rownr, void *dataPtr)
 This function is the get for all non-standard data types. More...
 
virtual void putBool (rownr_t rownr, const Bool *dataPtr)
 Put the scalar value into the given row. More...
 
virtual void putuChar (rownr_t rownr, const uChar *dataPtr)
 
virtual void putShort (rownr_t rownr, const Short *dataPtr)
 
virtual void putuShort (rownr_t rownr, const uShort *dataPtr)
 
virtual void putInt (rownr_t rownr, const Int *dataPtr)
 
virtual void putuInt (rownr_t rownr, const uInt *dataPtr)
 
virtual void putInt64 (rownr_t rownr, const Int64 *dataPtr)
 
virtual void putfloat (rownr_t rownr, const float *dataPtr)
 
virtual void putdouble (rownr_t rownr, const double *dataPtr)
 
virtual void putComplex (rownr_t rownr, const Complex *dataPtr)
 
virtual void putDComplex (rownr_t rownr, const DComplex *dataPtr)
 
virtual void putString (rownr_t rownr, const String *dataPtr)
 
virtual void putOther (rownr_t rownr, const void *dataPtr)
 This function is the put for all non-standard data types. More...
 
void getScalarColumnBase (ArrayBase &dataPtr)
 The default implementations of get and put functions. More...
 
void putScalarColumnBase (const ArrayBase &dataPtr)
 
void getScalarColumnCellsBase (const RefRows &rownrs, ArrayBase &dataPtr)
 
void putScalarColumnCellsBase (const RefRows &rownrs, const ArrayBase &dataPtr)
 
void getArrayColumnBase (ArrayBase &data)
 
void putArrayColumnBase (const ArrayBase &data)
 
void getArrayColumnCellsBase (const RefRows &rownrs, ArrayBase &data)
 
void putArrayColumnCellsBase (const RefRows &rownrs, const ArrayBase &data)
 
void getSliceBase (rownr_t rownr, const Slicer &slicer, ArrayBase &data)
 
void putSliceBase (rownr_t rownr, const Slicer &slicer, const ArrayBase &data)
 
void getColumnSliceBase (const Slicer &slicer, ArrayBase &data)
 
void putColumnSliceBase (const Slicer &slicer, const ArrayBase &data)
 
void getColumnSliceCellsBase (const RefRows &rownrs, const Slicer &slicer, ArrayBase &data)
 
void putColumnSliceCellsBase (const RefRows &rownrs, const Slicer &slicer, const ArrayBase &data)
 

Detailed Description

template<typename StoredType>
class casacore::BitFlagsEngine< StoredType >

Templated virtual column engine to map bit flags to a Bool.

Intended use:

Public interface

Review Status

Reviewed By:
Gareth Hunt
Date Reviewed:
94Nov17

Prerequisite

Synopsis

BitFlagsEngine is a virtual column engine which maps an integer column containing flag bits to a Bool column. It can be used in a MeasurementSet to have multiple flag categories, yet use all existing software that deals with the Bool FLAG column.

The engine support read as well as write access. For both cases a mask can be defined telling which bits have to be taken into account. For example, when writing to the Bool FLAG column, the data in the bitflags column twill be or-ed with the bits as defined in the writemask. Similary when reading FLAG, only the bits of the readmask are taken into account.

The masks can be defined in two ways:

A mask can be set at construction time, but it can be changed at runtime using the setProperties function. The masks are kept in special keywords (which are different from the keywords defining the flag bits), so it is possible to change a mask by changing those keywords before opening a table. However, that is not recommended.

BitFlagsEngine is known to the table system for data types uChar, Short, and Int.

Motivation

The FLAG_CATEGORY defined the Measurement does not work because adding an extra flag means resizing the entire array which is slow. This class makes it possible to use an integer column to store flags and map it directly to a Bool column.

Example

// Create the table description and 2 columns with indirect arrays in it.
// The Int column will be stored, while the Bool will be used as virtual.
TableDesc tableDesc ("", TableDesc::Scratch);
tableDesc.addColumn (ArrayColumnDesc<Int> ("BitBlags"));
tableDesc.addColumn (ArrayColumnDesc<Bool> ("FLAG"));
// Create a new table using the table description.
SetupNewTable newtab (tableDesc, "tab.data", Table::New);
// Create the engine and bind the FLAG column to it.
BitFlagsEngine<Int> flagsEngine("FLAG", "BitFlags");
newtab.bindColumn ("FLAG", flagsEngine);
// Create the table.
Table table (newtab);
// Store a 3-D array (with dim. 2,3,4) into each row of the column.
// The shape of each array in the column is implicitly set by the put
// function. This will also set the shape of the underlying Int array.
ArrayColumn data (table, "virtualArray");
Array<Bool> someArray(IPosition(4,2,3,4));
someArray = True;
for (rownr_t i=0, i<10; i++) { // table will have 10 rows
data.put (i, someArray)
}
Table & table() const
Get the table this object is associated with.
Definition: DataManager.h:318
friend class SetupNewTable
Definition: DataManager.h:222
@ New
create table
Definition: Table.h:176
void addRow(rownr_t nrrow=1, Bool initialize=False)
Add one or more rows at the end of the table.
Definition: Table.h:1203
const Bool True
Definition: aipstype.h:43
uInt64 rownr_t
Define the type of a row number in a table.
Definition: aipsxtype.h:46

The underlying integer array will be stored according to the writemask which defaults to 1.

Template Type Argument Requirements (StoredType)

Definition at line 170 of file BitFlagsEngine.h.

Constructor & Destructor Documentation

◆ BitFlagsEngine() [1/4]

template<typename StoredType >
casacore::BitFlagsEngine< StoredType >::BitFlagsEngine ( const String virtualColumnName,
const String storedColumnName,
StoredType  readMask = StoredType(0xffffffff),
StoredType  writeMask = 1 
)

Construct an engine to map integer arrays in a column to Bool arrays.

StoredColumnName is the name of the column where the integer data will be put and must have data type StoredType. The virtual column using this engine must have data type Bool.
A mask can be given that specifies which bits to use in the mapping from StoredType to Bool. Similarly a mask can be given defining which bits to set when mapping from Bool to StoredType.

◆ BitFlagsEngine() [2/4]

template<typename StoredType >
casacore::BitFlagsEngine< StoredType >::BitFlagsEngine ( const String virtualColumnName,
const String storedColumnName,
const Array< String > &  readMaskKeys,
const Array< String > &  writeMaskKeys 
)

Construct an engine to map integer arrays in a column to Bool arrays.

StoredColumnName is the name of the column where the scaled data will be put and must have data type StoredType. The virtual column using this engine must have data type Bool.
A mask can be given that specifies which bits to use in the mapping from StoredType to Bool. Similarly a mask can be given defining which bits to set when mapping from Bool to StoredType. The masks are given using the values of keywords in the stored column. Each keyword should be an integer defining one or more bits and can be seen as a symbolic name. The keyword values are or-ed to form the mask. The keywords are stored in a subrecord of keyword FLAGSETS.

◆ BitFlagsEngine() [3/4]

template<typename StoredType >
casacore::BitFlagsEngine< StoredType >::BitFlagsEngine ( const Record spec)

Construct from a record specification as created by dataManagerSpec().

◆ ~BitFlagsEngine()

template<typename StoredType >
casacore::BitFlagsEngine< StoredType >::~BitFlagsEngine ( )

Destructor is mandatory.

◆ BitFlagsEngine() [4/4]

template<typename StoredType >
casacore::BitFlagsEngine< StoredType >::BitFlagsEngine ( const BitFlagsEngine< StoredType > &  )
private

Copy constructor is only used by clone().

(so it is made private).

Member Function Documentation

◆ className()

template<typename StoredType >
static String casacore::BitFlagsEngine< StoredType >::className ( )
static

Return the name of the class.

This includes the names of the template arguments.

◆ clone()

template<typename StoredType >
DataManager* casacore::BitFlagsEngine< StoredType >::clone ( ) const
privatevirtual

Clone the engine object.

Implements casacore::DataManager.

◆ create64()

template<typename StoredType >
void casacore::BitFlagsEngine< StoredType >::create64 ( rownr_t  initialNrrow)
privatevirtual

Initialize the object for a new table.

It defines the keywords containing the engine parameters.

Reimplemented from casacore::BaseMappedArrayEngine< Bool, StoredType >.

◆ dataManagerName()

template<typename StoredType >
virtual String casacore::BitFlagsEngine< StoredType >::dataManagerName ( ) const
virtual

Get the name given to the engine (is the virtual column name).

Reimplemented from casacore::DataManager.

◆ dataManagerSpec()

template<typename StoredType >
virtual Record casacore::BitFlagsEngine< StoredType >::dataManagerSpec ( ) const
virtual

Record a record containing data manager specifications.

Reimplemented from casacore::DataManager.

◆ dataManagerType()

template<typename StoredType >
virtual String casacore::BitFlagsEngine< StoredType >::dataManagerType ( ) const
virtual

Return the type name of the engine (i.e.

its class name).

Implements casacore::DataManager.

◆ getArray()

template<typename StoredType >
void casacore::BitFlagsEngine< StoredType >::getArray ( rownr_t  rownr,
Array< Bool > &  array 
)
privatevirtual

Get an array in the given row.

This will scale and offset from the underlying array.

Reimplemented from casacore::BaseMappedArrayEngine< Bool, StoredType >.

◆ getArrayColumn()

template<typename StoredType >
void casacore::BitFlagsEngine< StoredType >::getArrayColumn ( Array< Bool > &  array)
privatevirtual

Get an entire column.

This will scale and offset from the underlying array.

Reimplemented from casacore::BaseMappedArrayEngine< Bool, StoredType >.

◆ getArrayColumnCells()

template<typename StoredType >
virtual void casacore::BitFlagsEngine< StoredType >::getArrayColumnCells ( const RefRows rownrs,
Array< Bool > &  data 
)
privatevirtual

Get some array values in the column.

This will scale and offset from the underlying array.

Reimplemented from casacore::BaseMappedArrayEngine< Bool, StoredType >.

◆ getColumnSlice()

template<typename StoredType >
void casacore::BitFlagsEngine< StoredType >::getColumnSlice ( const Slicer slicer,
Array< Bool > &  array 
)
private

Get a section of all arrays in the column.

This will scale and offset from the underlying array.

◆ getColumnSliceCells()

template<typename StoredType >
virtual void casacore::BitFlagsEngine< StoredType >::getColumnSliceCells ( const RefRows rownrs,
const Slicer slicer,
Array< Bool > &  data 
)
privatevirtual

Get a section of some arrays in the column.

This will scale and offset from the underlying array.

Reimplemented from casacore::BaseMappedArrayEngine< Bool, StoredType >.

◆ getProperties()

template<typename StoredType >
virtual Record casacore::BitFlagsEngine< StoredType >::getProperties ( ) const
virtual

Get data manager properties that can be modified.

These are ReadMask, WriteMask, ReadMaskKeys, and WriteMaskKeys. It is a subset of the data manager specification.

Reimplemented from casacore::DataManager.

◆ getSlice()

template<typename StoredType >
void casacore::BitFlagsEngine< StoredType >::getSlice ( rownr_t  rownr,
const Slicer slicer,
Array< Bool > &  array 
)
privatevirtual

Get a section of the array in the given row.

This will scale and offset from the underlying array.

Reimplemented from casacore::BaseMappedArrayEngine< Bool, StoredType >.

◆ makeObject()

template<typename StoredType >
static DataManager* casacore::BitFlagsEngine< StoredType >::makeObject ( const String dataManagerType,
const Record spec 
)
static

Define the "constructor" to construct this engine when a table is read back.

This "constructor" has to be registered by the user of the engine. If the engine is commonly used, its registration can be added to the registerAllCtor function in DataManReg.cc. That function gets automatically invoked by the table system.

◆ mapOnGet()

template<typename StoredType >
void casacore::BitFlagsEngine< StoredType >::mapOnGet ( Array< Bool > &  array,
const Array< StoredType > &  stored 
)
privatevirtual

Map bit flags array to Bool array.

This is meant when reading an array from the stored column.

Reimplemented from casacore::BaseMappedArrayEngine< Bool, StoredType >.

◆ mapOnPut()

template<typename StoredType >
void casacore::BitFlagsEngine< StoredType >::mapOnPut ( const Array< Bool > &  array,
Array< StoredType > &  stored 
)
privatevirtual

Map Bool array to bit flags array.

This is meant when writing an array into the stored column.

Reimplemented from casacore::BaseMappedArrayEngine< Bool, StoredType >.

◆ operator=()

template<typename StoredType >
BitFlagsEngine<StoredType>& casacore::BitFlagsEngine< StoredType >::operator= ( const BitFlagsEngine< StoredType > &  )
private

Assignment is not needed and therefore forbidden (so it is made private and not implemented).

◆ prepare()

template<typename StoredType >
void casacore::BitFlagsEngine< StoredType >::prepare ( )
privatevirtual

Preparing consists of setting the writable switch and adding the initial number of rows in case of create.

Furthermore it reads the keywords containing the engine parameters.

Reimplemented from casacore::BaseMappedArrayEngine< Bool, StoredType >.

◆ putArray()

template<typename StoredType >
void casacore::BitFlagsEngine< StoredType >::putArray ( rownr_t  rownr,
const Array< Bool > &  array 
)
privatevirtual

Put an array in the given row.

This will scale and offset to the underlying array.

Reimplemented from casacore::BaseMappedArrayEngine< Bool, StoredType >.

◆ putArrayColumn()

template<typename StoredType >
void casacore::BitFlagsEngine< StoredType >::putArrayColumn ( const Array< Bool > &  array)
privatevirtual

Put an entire column.

This will scale and offset to the underlying array.

Reimplemented from casacore::BaseMappedArrayEngine< Bool, StoredType >.

◆ putArrayColumnCells()

template<typename StoredType >
virtual void casacore::BitFlagsEngine< StoredType >::putArrayColumnCells ( const RefRows rownrs,
const Array< Bool > &  data 
)
privatevirtual

Put some array values in the column.

This will scale and offset to the underlying array.

Reimplemented from casacore::BaseMappedArrayEngine< Bool, StoredType >.

◆ putColumnSlice()

template<typename StoredType >
void casacore::BitFlagsEngine< StoredType >::putColumnSlice ( const Slicer slicer,
const Array< Bool > &  array 
)
private

Put a section of all arrays in the column.

This will scale and offset to the underlying array.

◆ putColumnSliceCells()

template<typename StoredType >
virtual void casacore::BitFlagsEngine< StoredType >::putColumnSliceCells ( const RefRows rownrs,
const Slicer slicer,
const Array< Bool > &  data 
)
privatevirtual

Put into a section of some arrays in the column.

This will scale and offset to the underlying array.

Reimplemented from casacore::BaseMappedArrayEngine< Bool, StoredType >.

◆ putSlice()

template<typename StoredType >
void casacore::BitFlagsEngine< StoredType >::putSlice ( rownr_t  rownr,
const Slicer slicer,
const Array< Bool > &  array 
)
privatevirtual

Put into a section of the array in the given row.

This will scale and offset to the underlying array.

Reimplemented from casacore::BaseMappedArrayEngine< Bool, StoredType >.

◆ registerClass()

template<typename StoredType >
static void casacore::BitFlagsEngine< StoredType >::registerClass ( )
static

Register the class name and the static makeObject "constructor".

This will make the engine known to the table system. The automatically invoked registration function in DataManReg.cc contains BitFlagsEngine<Int>. Any other instantiation of this class must be registered "manually" (or added to DataManReg.cc).

◆ setProperties()

template<typename StoredType >
virtual void casacore::BitFlagsEngine< StoredType >::setProperties ( const Record spec)
virtual

Modify data manager properties.

These are ReadMask, WriteMask, ReadMaskKeys, and/or WriteMaskKeys. Mask keys should be given as an array of strings giving the keyword names defining mask bits (similar to the constructor). Mask keys are only used if not empty.

Reimplemented from casacore::DataManager.

Member Data Documentation

◆ itsBFEReadMask

template<typename StoredType >
BFEngineMask casacore::BitFlagsEngine< StoredType >::itsBFEReadMask
private

Definition at line 367 of file BitFlagsEngine.h.

◆ itsBFEWriteMask

template<typename StoredType >
BFEngineMask casacore::BitFlagsEngine< StoredType >::itsBFEWriteMask
private

Definition at line 368 of file BitFlagsEngine.h.

◆ itsIsNew

template<typename StoredType >
Bool casacore::BitFlagsEngine< StoredType >::itsIsNew
private

Definition at line 371 of file BitFlagsEngine.h.

◆ itsReadMask

template<typename StoredType >
StoredType casacore::BitFlagsEngine< StoredType >::itsReadMask
private

Definition at line 369 of file BitFlagsEngine.h.

◆ itsWriteMask

template<typename StoredType >
StoredType casacore::BitFlagsEngine< StoredType >::itsWriteMask
private

Definition at line 370 of file BitFlagsEngine.h.


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