28 #ifndef TABLES_BITFLAGSENGINE_H
29 #define TABLES_BITFLAGSENGINE_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/tables/DataMan/BaseMappedArrayEngine.h>
190 const String& storedColumnName,
191 StoredType readMask=StoredType(0xffffffff),
192 StoredType writeMask=1);
206 const String& storedColumnName,
377 #ifndef CASACORE_NO_AUTO_TEMPLATES
378 #include <casacore/tables/DataMan/BitFlagsEngine.tcc>
BFEngineMask(const Array< String > &keys, uInt defaultMask)
Form the mask from the given keywords defining the bits.
BFEngineMask(uInt mask=0xffffffff)
Form the mask as given.
void toRecord(RecordInterface &spec, const String &prefix) const
Store the info in a Record.
uInt getMask() const
Get the mask.
Array< String > itsMaskKeys
void makeMask(const TableColumn &column)
Make the mask from the given keywords defining the bits.
const Array< String > & getKeys() const
Get the mask keywords.
void fromRecord(const RecordInterface &spec, const TableColumn &column, const String &prefix)
Form the read mask from the specification.
Templated virtual column engine to map bit flags to a Bool.
void mapOnGet(Array< Bool > &array, const Array< StoredType > &stored)
Map bit flags array to Bool array.
virtual void getArrayColumnCells(const RefRows &rownrs, Array< Bool > &data)
Get some array values in the column.
BitFlagsEngine(const BitFlagsEngine< StoredType > &)
Copy constructor is only used by clone().
void putArrayColumn(const Array< Bool > &array)
Put an entire column.
void putArray(rownr_t rownr, const Array< Bool > &array)
Put an array in the given row.
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.
virtual Record getProperties() const
Get data manager properties that can be modified.
void putColumnSlice(const Slicer &slicer, const Array< Bool > &array)
Put a section of all arrays in the column.
void getColumnSlice(const Slicer &slicer, Array< Bool > &array)
Get a section of all arrays in the column.
BitFlagsEngine< StoredType > & operator=(const BitFlagsEngine< StoredType > &)
Assignment is not needed and therefore forbidden (so it is made private and not implemented).
void mapOnPut(const Array< Bool > &array, Array< StoredType > &stored)
Map Bool array to bit flags array.
static void registerClass()
Register the class name and the static makeObject "constructor".
virtual String dataManagerName() const
Get the name given to the engine (is the virtual column name).
void create64(rownr_t initialNrrow)
Initialize the object for a new table.
void getSlice(rownr_t rownr, const Slicer &slicer, Array< Bool > &array)
Get a section of the array in the given row.
void getArray(rownr_t rownr, Array< Bool > &array)
Get an array in the given row.
virtual void putArrayColumnCells(const RefRows &rownrs, const Array< Bool > &data)
Put some array values in the column.
BFEngineMask itsBFEReadMask
void putSlice(rownr_t rownr, const Slicer &slicer, const Array< Bool > &array)
Put into a section of the array in the given row.
~BitFlagsEngine()
Destructor is mandatory.
virtual void setProperties(const Record &spec)
Modify data manager properties.
virtual void putColumnSliceCells(const RefRows &rownrs, const Slicer &slicer, const Array< Bool > &data)
Put into a section of some arrays in the column.
BitFlagsEngine(const Record &spec)
Construct from a record specification as created by dataManagerSpec().
DataManager * clone() const
Clone the engine object.
BFEngineMask itsBFEWriteMask
virtual Record dataManagerSpec() const
Record a record containing data manager specifications.
virtual void getColumnSliceCells(const RefRows &rownrs, const Slicer &slicer, Array< Bool > &data)
Get a section of some arrays in the column.
static String className()
Return the name of the class.
void getArrayColumn(Array< Bool > &array)
Get an entire column.
virtual String dataManagerType() const
Return the type name of the engine (i.e.
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.
void prepare()
Preparing consists of setting the writable switch and adding the initial number of rows in case of cr...
static DataManager * makeObject(const String &dataManagerType, const Record &spec)
Define the "constructor" to construct this engine when a table is read back.
Abstract base class for a data manager.
String: the storage and methods of handling collections of characters.
this file contains all the compiler specific defines
TableExprNode array(const TableExprNode &values, const TableExprNodeSet &shape)
Create an array of the given shape and fill it with the values.
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
bool Bool
Define the standard types used by Casacore.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
uInt64 rownr_t
Define the type of a row number in a table.
Functor to convert Bools to flags using a mask.
StoredType operator()(Bool flag, StoredType value) const
BoolToFlags(StoredType writeMask)
Functor to and an array and mask and convert to Bool.
FlagsToBool(StoredType readMask)
Bool operator()(StoredType value) const