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.
void putArray(uInt rownr, const Array< Bool > &array)
Put an array in the given row.
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.
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
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.
void getSlice(uInt rownr, const Slicer &slicer, Array< Bool > &array)
Get a section of the array in the given row.
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.
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.
template <class T, class U> class vector;
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.
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.
void putSlice(uInt rownr, const Slicer &slicer, const Array< Bool > &array)
Put into a section of the array in the given row.
void getArray(uInt rownr, Array< Bool > &array)
Get an array in the given row.
void create(uInt initialNrrow)
Initialize the object for a new 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.
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.
#define casacore
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.