28 #ifndef TABLES_EXPRNODESET_H
29 #define TABLES_EXPRNODESET_H
126 void show (ostream& os,
uInt indent)
const;
129 virtual void getAggrNodes (std::vector<TableExprNodeRep*>& aggr);
132 virtual void getColumnNodes (std::vector<TableExprNodeRep*>& cols);
264 #define castItsElem(i) static_cast<TableExprNodeSetElem*>(itsElems[i].get())
265 #define castSetElem(shptr) static_cast<TableExprNodeSetElem*>(shptr.get())
345 void show (ostream& os,
uInt indent)
const;
348 virtual void getAggrNodes (std::vector<TableExprNodeRep*>& aggr);
351 virtual void getColumnNodes (std::vector<TableExprNodeRep*>& cols);
525 maskShp[maskShp.
size()-1] = 1;
527 if (!
mask.empty()) {
535 for (
Int64 i=1; i<n; i++) {
544 if (! marr.
shape().isEqual (iter.array().shape())) {
545 throw TableInvExpr(
"Shapes of nested arrays do not match");
547 iter.array() = marr.
array();
555 }
else if (!
mask.empty()) {
566 for (
Int64 i=0; i<n; i++) {
A Vector of integers, for indexing into Array<T> objects.
Bool isSingle() const
Is a single value given?
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
Class to handle an Array with an optional mask.
void matchDComplex(Bool *match, const DComplex *value, size_t nval, const TableExprId &id) const
void show(ostream &os, uInt indent) const
Show the node.
virtual void getColumnNodes(std::vector< TableExprNodeRep * > &cols)
Get the nodes representing a table column.
virtual MArray< Double > getArrayDouble(const TableExprId &id)
virtual Bool hasInt(const TableExprId &id, Int64 value)
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
size_t nelements() const
For backward compatibility.
Bool isNull() const
Is the array null?
virtual Bool hasString(const TableExprId &id, const String &value)
void matchInt(Bool *match, const Int64 *value, size_t nval, const TableExprId &id) const
virtual MArray< Bool > getArrayBool(const TableExprId &id)
Get an array value for this node in the given row.
Class to hold multiple table expression nodes.
Handle class for a table column expression tree.
virtual MArray< MVTime > getArrayDate(const TableExprId &id)
virtual MArray< Int64 > getArrayInt(const TableExprId &id)
Bool findClosedOpen(Double value)
Array< T, Alloc > reform(const IPosition &shape) const
It is occasionally useful to have an array which access the same storage appear to have a different s...
void combineDoubleIntervals()
void matchString(Bool *match, const String *value, size_t nval, const TableExprId &id) const
Bool isBounded() const
Is the set fully bounded (discrete and no undefined end values)?
void reference(const MArray< T > &other)
Reference another array.
void matchDouble(Bool *match, const Double *value, size_t nval, const TableExprId &id) const
Abstract base class for a node in a table column expression tree.
virtual MArray< Bool > hasArrayDouble(const TableExprId &id, const MArray< Double > &value)
const TableExprNodeSetElem & operator[](size_t index) const
Get the i-th element.
const TENShPtr & end() const
void checkTable()
Get the table of a node and check if the children use the same table.
void matchBool(Bool *match, const Bool *value, size_t nval, const TableExprId &id) const
Set a flag in the match output array if the corresponding element in the value array is included in t...
virtual void adaptSetUnits(const Unit &)
Let a set node convert itself to the given unit.
Bool(TableExprNodeSet::* FindFuncPtr)(Double value)
Define the functions to find a double, which depend on open/closed-ness.
Bool hasArrays() const
Contains the set array values?
Iterate an Array cursor through another Array.
TableExprNodeSet & operator=(const TableExprNodeSet &)
A copy of a TableExprNodeSet cannot be made.
virtual void next() override
Move the cursor to the next position.
virtual void adaptSetUnits(const Unit &)
Let a set node convert itself to the given unit.
virtual MArray< Bool > hasArrayString(const TableExprId &id, const MArray< String > &value)
virtual MArray< Double > getArrayDouble(const TableExprId &id)
virtual MArray< DComplex > getArrayDComplex(const TableExprId &id)
void getArray(MArray< MVTime > &marr, const TENShPtr &node, const TableExprId &id) const
void checkEqualDataTypes() const
Check if the data type of the set elements are the same.
void combineDateIntervals()
void combineIntIntervals()
Sort and combine intervals.
Bool findOpenOpen(Double value)
virtual Bool hasDComplex(const TableExprId &id, const DComplex &value)
MArray< T > toArray(const TableExprId &id) const
virtual MArray< String > getArrayString(const TableExprId &id)
virtual MArray< DComplex > getArrayDComplex(const TableExprId &id)
virtual Bool hasBool(const TableExprId &id, Bool value)
Does a value occur in the set?
Class to hold the table expression nodes for an element in a set.
TableExprNodeSetElem * evaluate(const TableExprId &id) const
Evaluate the element for the given row and construct a new (constant) element from it...
void setFindFunc(Bool isLeftClosed, Bool isRightClosed)
virtual void getColumnNodes(std::vector< TableExprNodeRep * > &cols)
Get the nodes representing a table column.
std::complex< Double > DComplex
void getArray(MArray< DComplex > &marr, const TENShPtr &node, const TableExprId &id) const
void getArray(MArray< Double > &marr, const TENShPtr &node, const TableExprId &id) const
TableExprNodeSetElem(const TableExprNode &node)
Create the object for a single expression node.
void getArray(MArray< Int64 > &marr, const TENShPtr &node, const TableExprId &id) const
Bool findClosedClosed(Double value)
#define DebugAssert(expr, exception)
TENShPtr setOrArray() const
Try to convert the set to an array.
Bool isRightClosed() const
Bool isDiscrete() const
Is it a discrete set element.
const TENShPtr & start() const
Get the start, end or increment expression.
bool Bool
Define the standard types used by Casacore.
virtual MArray< Bool > hasArrayDComplex(const TableExprId &id, const MArray< DComplex > &value)
std::vector< TENShPtr > itsElems
void setup(Bool isLeftClosed, const TableExprNode *start, const TableExprNode *end, Bool isRightClosed)
Setup the object for a continuous interval.
virtual MArray< Bool > hasArrayInt(const TableExprId &id, const MArray< Int64 > &value)
void getArray(MArray< String > &marr, const TENShPtr &node, const TableExprId &id) const
Bool isDiscrete() const
Contains the set only discrete elements? Discrete means that no continuous ranges are given...
Bool isSingle() const
Contains the set only single elements? Single means that only single values are given (thus end nor i...
virtual MArray< Int64 > getArrayInt(const TableExprId &id)
size_t size() const
Get the number of elements.
void matchDate(Bool *match, const MVTime *value, size_t nval, const TableExprId &id) const
Specify which elements to extract from an n-dimensional array.
void resize(size_t len, bool copyValues=false)
virtual Bool hasDate(const TableExprId &id, const MVTime &value)
void show(ostream &os, uInt indent) const
Show the node.
void getArray(MArray< Bool > &marr, const TENShPtr &node, const TableExprId &id) const
Get the array in a templated way.
const Array< T > & array() const
Get access to the array.
Bool findOpenClosed(Double value)
virtual MArray< Bool > hasArrayBool(const TableExprId &id, const MArray< Bool > &value)
The identification of a TaQL selection subject.
virtual void getAggrNodes(std::vector< TableExprNodeRep * > &aggr)
Get the nodes representing an aggregate function.
Base class for all Casacore library errors.
const Double e
e and functions thereof:
void resize(size_t newSize, bool copy=true)
Old values are copied on resize if copy==true.
const TENShPtr & increment() const
void fillVector(Vector< Bool > &vec, Int64 &cnt, const TableExprId &id) const
Fill a vector with the value(s) from this element by appending them at the end of the vector; the end...
Bool hasMask() const
Is there a mask?
virtual MArray< String > getArrayString(const TableExprId &id)
String: the storage and methods of handling collections of characters.
virtual MArray< Bool > hasArrayDate(const TableExprId &id, const MArray< MVTime > &value)
TENShPtr toConstArray() const
Convert the const set to an array.
Class to handle date/time type conversions and I/O.
Bool isLeftClosed() const
Is the interval left or right closed?
TableExprNodeSetElem & operator=(const TableExprNodeSetElem &)
A copy of a TableExprNodeSetElem cannot be made.
Table error; invalid select expression.
const IPosition & shape() const
Get the shape.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
virtual MArray< Bool > getArrayBool(const TableExprId &id)
Get an array value for this bounded set in the given row.
virtual MArray< MVTime > getArrayDate(const TableExprId &id)
virtual void getAggrNodes(std::vector< TableExprNodeRep * > &aggr)
Get the nodes representing an aggregate function.
virtual Bool hasDouble(const TableExprId &id, Double value)
void add(const TableExprNodeSetElem &, Bool adaptType=False)
Add an element to the set.
const Array< Bool > & mask() const
Get the mask.
TableExprNodeSet()
Construct an empty set.