28 #ifndef TABLES_BITFLAGSENGINE_H
29 #define TABLES_BITFLAGSENGINE_H
190 const String& storedColumnName,
191 StoredType readMask=StoredType(0xffffffff),
192 StoredType writeMask=1);
206 const String& storedColumnName,
340 {
return (value &
itsMask) != 0; }
347 struct BoolToFlags :
public std::binary_function<Bool,StoredType,StoredType>
351 {
return (flag ? value&
itsMask : value); }
377 #ifndef CASACORE_NO_AUTO_TEMPLATES
378 #include <casacore/tables/DataMan/BitFlagsEngine.tcc>
379 #endif //# CASACORE_NO_AUTO_TEMPLATES
DataManager * clone() const
Clone the engine object.
Non-templated Helper class to handle the mask.
virtual Record getProperties() const
Get data manager properties that can be modified.
static DataManager * makeObject(const String &dataManagerType, const Record &spec)
Define the "constructor" to construct this engine when a table is read back.
Templated virtual column engine to map bit flags to a Bool.
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
TableExprNode array(const TableExprNode &values, const TableExprNodeSet &shape)
Create an array of the given shape and fill it with the values.
Templated virtual column engine for a table array of any type.
StoredType operator()(Bool flag, StoredType value) const
FlagsToBool(StoredType readMask)
Array< String > itsMaskKeys
void mapOnGet(Array< Bool > &array, const Array< StoredType > &stored)
Map bit flags array to Bool array.
virtual String dataManagerType() const
Return the type name of the engine (i.e.
static String className()
Return the name of the class.
void getArrayColumn(Array< Bool > &array)
Get an entire column.
BitFlagsEngine< StoredType > & operator=(const BitFlagsEngine< StoredType > &)
Assignment is not needed and therefore forbidden (so it is made private and not implemented).
Functor to convert Bools to flags using a mask.
void toRecord(RecordInterface &spec, const String &prefix) const
Store the info in a Record.
Bool operator()(StoredType value) const
virtual void setProperties(const Record &spec)
Modify data manager properties.
virtual String dataManagerName() const
Get the name given to the engine (is the virtual column name).
void makeMask(const TableColumn &column)
Make the mask from the given keywords defining the bits.
void fromRecord(const RecordInterface &spec, const TableColumn &column, const String &prefix)
Form the read mask from the specification.
void putSlice(rownr_t rownr, const Slicer &slicer, const Array< Bool > &array)
Put into a section of the array in the given row.
Class holding the row numbers in a RefTable.
BFEngineMask itsBFEReadMask
BoolToFlags(StoredType writeMask)
void prepare()
Preparing consists of setting the writable switch and adding the initial number of rows in case of cr...
A hierarchical collection of named fields of various types.
bool Bool
Define the standard types used by Casacore.
BFEngineMask(uInt mask=0xffffffff)
Form the mask as given.
Read/write access to a table column.
A templated N-D Array class with zero origin. Array<T, Alloc> is a templated, N-dimensional, Array class. The origin is zero, but by default indices are zero-based. This Array class is the base class for the Vector, Matrix, and Cube subclasses.
virtual void getColumnSliceCells(const RefRows &rownrs, const Slicer &slicer, Array< Bool > &data)
Get a section of some arrays in the column.
void putColumnSlice(const Slicer &slicer, const Array< Bool > &array)
Put a section of all arrays in the column.
void getArray(rownr_t rownr, Array< Bool > &array)
Get an array in the given row.
void putArray(rownr_t rownr, const Array< Bool > &array)
Put an array in the given row.
Specify which elements to extract from an n-dimensional array.
~BitFlagsEngine()
Destructor is mandatory.
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.
void putArrayColumn(const Array< Bool > &array)
Put an entire column.
uInt64 rownr_t
Define the type of a row number in a table.
uInt getMask() const
Get the mask.
Abstract base class for a data manager.
void mapOnPut(const Array< Bool > &array, Array< StoredType > &stored)
Map Bool array to bit flags array.
virtual void getArrayColumnCells(const RefRows &rownrs, Array< Bool > &data)
Get some array values in the column.
String: the storage and methods of handling collections of characters.
void create64(rownr_t initialNrrow)
Initialize the object for a new table.
Abstract base class for Record classes.
Functor to and an array and mask and convert to Bool.
static void registerClass()
Register the class name and the static makeObject "constructor".
virtual void putColumnSliceCells(const RefRows &rownrs, const Slicer &slicer, const Array< Bool > &data)
Put into a section of some arrays in the column.
virtual Record dataManagerSpec() const
Record a record containing data manager specifications.
const Array< String > & getKeys() const
Get the mask keywords.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
virtual void putArrayColumnCells(const RefRows &rownrs, const Array< Bool > &data)
Put some array values in the column.
BFEngineMask itsBFEWriteMask
void getColumnSlice(const Slicer &slicer, Array< Bool > &array)
Get a section of all arrays in the column.
void getSlice(rownr_t rownr, const Slicer &slicer, Array< Bool > &array)
Get a section of the array in the given row.