28 #ifndef TABLES_EXPRNODESET_H 29 #define TABLES_EXPRNODESET_H 32 #include <casacore/casa/aips.h> 33 #include <casacore/tables/TaQL/ExprNodeRep.h> 34 #include <casacore/tables/TaQL/ExprNodeArray.h> 35 #include <casacore/casa/Containers/Block.h> 44 template<
class T>
class Vector;
127 void show (ostream& os,
uInt indent)
const;
130 virtual void getAggrNodes (vector<TableExprNodeRep*>& aggr);
341 void show (ostream& os,
uInt indent)
const;
344 virtual void getAggrNodes (vector<TableExprNodeRep*>& aggr);
353 void checkEqualDataTypes()
const;
365 Bool isBounded()
const;
374 Bool hasArrays()
const;
452 void combineIntIntervals();
453 void combineDoubleIntervals();
454 void combineDateIntervals();
494 return itsElems.size();
499 return *(itsElems[index]);
513 if (marr.
isNull())
return marr;
526 for (
Int64 i=1; i<n; i++) {
532 if (marr.
isNull())
return marr;
533 if (! marr.
shape().isEqual (iter.array().shape())) {
534 throw TableInvExpr(
"Shapes of nested arrays do not match");
536 iter.array() = marr.
array();
543 }
else if (!
mask.empty()) {
552 for (
Int64 i=0; i<n; i++) {
553 itsElems[i]->fillVector (result, cnt,
id);
A Vector of integers, for indexing into Array<T> objects.
TableExprNodeRep * itsIncr
void getArray(MArray< Bool > &marr, TableExprNodeRep *node, const TableExprId &id) const
Get the array in a templated way.
virtual void getAggrNodes(vector< TableExprNodeRep *> &aggr)
Get the nodes representing an aggregate function.
Bool isNull() const
Is the array null?
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
void matchDate(Bool *match, const MVTime *value, uInt nval, const TableExprId &id) const
Class to handle an Array with an optional mask.
virtual MArray< Bool > hasArrayString(const TableExprId &id, const MArray< String > &value)
void matchBool(Bool *match, const Bool *value, uInt 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...
uInt nelements() const
Get the number of elements.
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
void getArray(MArray< String > &marr, TableExprNodeRep *node, const TableExprId &id) const
Bool isBounded() const
Is the set fully bounded (discrete and no undefined end values)?
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.
void getArray(MArray< MVTime > &marr, TableExprNodeRep *node, const TableExprId &id) const
virtual MArray< MVTime > getArrayDate(const TableExprId &id)
void getArray(MArray< DComplex > &marr, TableExprNodeRep *node, const TableExprId &id) const
Bool isLeftClosed() const
Is the interval left or right closed?
virtual MArray< Bool > hasArrayDComplex(const TableExprId &id, const MArray< DComplex > &value)
TableExprNodeSetElem * evaluate(const TableExprId &id) const
Evaluate the element for the given row and construct a new (constant) element from it...
void show(ostream &os, uInt indent) const
Show the node.
void reference(const MArray< T > &other)
Reference another array.
TableExprNodeRep * start() const
Get the start, end or increment expression.
Abstract base class for a node in a table column expression tree.
void checkTable()
Get the table of a node and check if the children use the same table.
virtual Bool hasDComplex(const TableExprId &id, const DComplex &value)
virtual void adaptSetUnits(const Unit &)
Let a set node convert itself to the given unit.
virtual Bool hasInt(const TableExprId &id, Int64 value)
Iterate an Array cursor through another Array.
const Array< Bool > & mask() const
Get the mask.
virtual void resize()
Make this array a different shape.
virtual MArray< Double > getArrayDouble(const TableExprId &id)
virtual MArray< DComplex > getArrayDComplex(const TableExprId &id)
Class to hold the table expression nodes for an element in a set.
const Array< T > & array() const
Get access to the array.
virtual MArray< Bool > hasArrayDate(const TableExprId &id, const MArray< MVTime > &value)
std::complex< Double > DComplex
void getArray(MArray< Int64 > &marr, TableExprNodeRep *node, const TableExprId &id) const
const TableExprNodeSetElem & operator[](uInt index) const
Get the i-th element.
TableExprNodeSetElem(const TableExprNode &node)
Create the object for a single expression node.
virtual MArray< Bool > hasArrayInt(const TableExprId &id, const MArray< Int64 > &value)
LatticeExprNode nelements(const LatticeExprNode &expr)
1-argument function to get the number of elements in a lattice.
virtual Bool hasDate(const TableExprId &id, const MVTime &value)
virtual Bool hasBool(const TableExprId &id, Bool value)
Does a value occur in an array or set? The default implementation tests if it is in an array...
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...
#define DebugAssert(expr, exception)
Bool isSingle() const
Is a single value given?
bool Bool
Define the standard types used by Casacore.
virtual MArray< Bool > hasArrayDouble(const TableExprId &id, const MArray< Double > &value)
Bool isDiscrete() const
Is it a discrete set element.
Bool isDiscrete() const
Contains the set only discrete elements? Discrete means that no continuous ranges are given...
void setup(Bool isLeftClosed, const TableExprNode *start, const TableExprNode *end, Bool isRightClosed)
Setup the object for a continuous interval.
Bool isRightClosed() const
virtual MArray< Int64 > getArrayInt(const TableExprId &id)
void matchString(Bool *match, const String *value, uInt nval, const TableExprId &id) const
MArray< T > toArray(const TableExprId &id) const
template <class T, class U> class vector;
Bool isSingle() const
Contains the set only single elements? Single means that only single values are given (thus end nor i...
Specify which elements to extract from an n-dimensional array.
TableExprNodeRep * increment() const
virtual Bool hasDouble(const TableExprId &id, Double value)
void matchDComplex(Bool *match, const DComplex *value, uInt nval, const TableExprId &id) const
The identification of a TaQL selection subject.
Base class for all Casacore library errors.
const Double e
e and functions thereof:
const IPosition & shape() const
Get the shape.
void getArray(MArray< Double > &marr, TableExprNodeRep *node, const TableExprId &id) const
TableExprNodeRep * end() const
virtual MArray< Bool > hasArrayBool(const TableExprId &id, const MArray< Bool > &value)
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 void getColumnNodes(vector< TableExprNodeRep *> &cols)
Get the nodes representing a table column.
void getArray(Array< V > &val, int type, const Record &gr, const String &name)
void resize(size_t len, Bool copyValues=False)
TableExprNodeRep * itsEnd
Class to handle date/time type conversions and I/O.
std::vector< TableExprNodeSetElem * > itsElems
virtual Bool hasString(const TableExprId &id, const String &value)
TableExprNodeSetElem & operator=(const TableExprNodeSetElem &)
A copy of a TableExprNodeSetElem cannot be made.
TableExprNodeRep * itsStart
void matchDouble(Bool *match, const Double *value, uInt nval, const TableExprId &id) const
Table error; invalid select expression.
this file contains all the compiler specific defines
void matchInt(Bool *match, const Int64 *value, uInt nval, const TableExprId &id) const
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.