Class to hold the table expression nodes for an element in a set. More...
#include <ExprNodeSet.h>
Public Member Functions | |
TableExprNodeSetElem (const TableExprNode &node) | |
Create the object for a single expression node. | |
TableExprNodeSetElem (const TableExprNode *start, const TableExprNode *end, const TableExprNode *incr, Bool isEndExcl=False) | |
Create the object for a discrete interval. | |
TableExprNodeSetElem (Bool isLeftClosed, const TableExprNode &start, const TableExprNode &end, Bool isRightClosed) | |
Create the object for a continuous bounded interval. | |
TableExprNodeSetElem (Bool isLeftClosed, const TableExprNode &start) | |
Create the object for a continuous left-bounded interval. | |
TableExprNodeSetElem (const TableExprNode &end, Bool isRightClosed) | |
Create the object for a continuous right-bounded interval. | |
TableExprNodeSetElem (const TableExprNodeSetElem &) | |
Copy constructor (copy semantics). | |
~TableExprNodeSetElem () | |
void | show (ostream &os, uInt indent) const |
Show the node. | |
virtual void | getAggrNodes (vector< TableExprNodeRep * > &aggr) |
Get the nodes representing an aggregate function. | |
virtual void | getColumnNodes (vector< TableExprNodeRep * > &cols) |
Get the nodes representing a table column. | |
Bool | isDiscrete () const |
Is it a discrete set element. | |
Bool | isSingle () const |
Is a single value given? | |
Bool | isLeftClosed () const |
Is the interval left or right closed? | |
Bool | isRightClosed () const |
TableExprNodeRep * | start () const |
Get the start, end or increment expression. | |
TableExprNodeRep * | end () const |
TableExprNodeRep * | 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 is given by argument cnt which gets incremented with the number of values appended. | |
void | fillVector (Vector< Int64 > &vec, Int64 &cnt, const TableExprId &id) const |
void | fillVector (Vector< Double > &vec, Int64 &cnt, const TableExprId &id) const |
void | fillVector (Vector< DComplex > &vec, Int64 &cnt, const TableExprId &id) const |
void | fillVector (Vector< String > &vec, Int64 &cnt, const TableExprId &id) const |
void | fillVector (Vector< MVTime > &vec, Int64 &cnt, const TableExprId &id) const |
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 this set element. | |
void | matchInt (Bool *match, const Int64 *value, uInt nval, const TableExprId &id) const |
void | matchDouble (Bool *match, const Double *value, uInt nval, const TableExprId &id) const |
void | matchDComplex (Bool *match, const DComplex *value, uInt nval, const TableExprId &id) const |
void | matchString (Bool *match, const String *value, uInt nval, const TableExprId &id) const |
void | matchDate (Bool *match, const MVTime *value, uInt nval, const TableExprId &id) const |
TableExprNodeSetElem * | evaluate (const TableExprId &id) const |
Evaluate the element for the given row and construct a new (constant) element from it. | |
void | checkTable () |
Get the table of a node and check if the children use the same table. | |
virtual void | adaptSetUnits (const Unit &) |
Let a set node convert itself to the given unit. | |
Private Member Functions | |
TableExprNodeSetElem & | operator= (const TableExprNodeSetElem &) |
A copy of a TableExprNodeSetElem cannot be made. | |
TableExprNodeSetElem (const TableExprNodeSetElem &that, TableExprNodeRep *start, TableExprNodeRep *end, TableExprNodeRep *incr) | |
Construct an element from the given parts and take over their pointers. | |
void | setup (Bool isLeftClosed, const TableExprNode *start, const TableExprNode *end, Bool isRightClosed) |
Setup the object for a continuous interval. | |
Private Attributes | |
TableExprNodeRep * | itsStart |
TableExprNodeRep * | itsEnd |
TableExprNodeRep * | itsIncr |
Bool | itsEndExcl |
Bool | itsLeftClosed |
Bool | itsRightClosed |
Bool | itsDiscrete |
Bool | itsSingle |
Class to hold the table expression nodes for an element in a set.
Public interface
This class is used to assemble the table expression nodes representing an element in a set. A set element can be of 3 types:
Note the difference between a discrete and a continuous interval. E.g. the discrete interval 2,6 consists of the five values 2,3,4,5,6. The continuous interval 2,6 consists of all values between them.
Further note that a bounded discrete interval is automatically converted to a vector, which makes it possible to apply array functions to it.
Definition at line 93 of file ExprNodeSet.h.
casacore::TableExprNodeSetElem::TableExprNodeSetElem | ( | const TableExprNode & | node | ) | [explicit] |
Create the object for a single expression node.
casacore::TableExprNodeSetElem::TableExprNodeSetElem | ( | const TableExprNode * | start, | |
const TableExprNode * | end, | |||
const TableExprNode * | incr, | |||
Bool | isEndExcl = False | |||
) |
Create the object for a discrete interval.
Each of the start, end, and incr pointers can be zero meaning that they are not given (see the synopsis for an explanation). Optionally the end is inclusive (C++ and Glish style) or exclusive (Python style).
casacore::TableExprNodeSetElem::TableExprNodeSetElem | ( | Bool | isLeftClosed, | |
const TableExprNode & | start, | |||
const TableExprNode & | end, | |||
Bool | isRightClosed | |||
) |
Create the object for a continuous bounded interval.
It can be open or closed on either side.
casacore::TableExprNodeSetElem::TableExprNodeSetElem | ( | Bool | isLeftClosed, | |
const TableExprNode & | start | |||
) |
Create the object for a continuous left-bounded interval.
casacore::TableExprNodeSetElem::TableExprNodeSetElem | ( | const TableExprNode & | end, | |
Bool | isRightClosed | |||
) |
Create the object for a continuous right-bounded interval.
casacore::TableExprNodeSetElem::TableExprNodeSetElem | ( | const TableExprNodeSetElem & | ) |
Copy constructor (copy semantics).
casacore::TableExprNodeSetElem::~TableExprNodeSetElem | ( | ) |
casacore::TableExprNodeSetElem::TableExprNodeSetElem | ( | const TableExprNodeSetElem & | that, | |
TableExprNodeRep * | start, | |||
TableExprNodeRep * | end, | |||
TableExprNodeRep * | incr | |||
) | [private] |
Construct an element from the given parts and take over their pointers.
It is used by evaluate to construct an element in a rather cheap way.
virtual void casacore::TableExprNodeSetElem::adaptSetUnits | ( | const Unit & | ) | [virtual] |
Let a set node convert itself to the given unit.
Reimplemented from casacore::TableExprNodeRep.
void casacore::TableExprNodeSetElem::checkTable | ( | ) |
Get the table of a node and check if the children use the same table.
TableExprNodeRep * casacore::TableExprNodeSetElem::end | ( | ) | const [inline] |
Definition at line 252 of file ExprNodeSet.h.
References itsEnd.
TableExprNodeSetElem* casacore::TableExprNodeSetElem::evaluate | ( | const TableExprId & | id | ) | const |
Evaluate the element for the given row and construct a new (constant) element from it.
This is used by the system to implement a set in a GIVING clause.
void casacore::TableExprNodeSetElem::fillVector | ( | Vector< MVTime > & | vec, | |
Int64 & | cnt, | |||
const TableExprId & | id | |||
) | const |
void casacore::TableExprNodeSetElem::fillVector | ( | Vector< String > & | vec, | |
Int64 & | cnt, | |||
const TableExprId & | id | |||
) | const |
void casacore::TableExprNodeSetElem::fillVector | ( | Vector< DComplex > & | vec, | |
Int64 & | cnt, | |||
const TableExprId & | id | |||
) | const |
void casacore::TableExprNodeSetElem::fillVector | ( | Vector< Double > & | vec, | |
Int64 & | cnt, | |||
const TableExprId & | id | |||
) | const |
void casacore::TableExprNodeSetElem::fillVector | ( | Vector< Int64 > & | vec, | |
Int64 & | cnt, | |||
const TableExprId & | id | |||
) | const |
void casacore::TableExprNodeSetElem::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 is given by argument cnt
which gets incremented with the number of values appended.
This is used by the system to convert a set to a vector.
virtual void casacore::TableExprNodeSetElem::getAggrNodes | ( | vector< TableExprNodeRep * > & | aggr | ) | [virtual] |
Get the nodes representing an aggregate function.
virtual void casacore::TableExprNodeSetElem::getColumnNodes | ( | vector< TableExprNodeRep * > & | cols | ) | [virtual] |
Get the nodes representing a table column.
TableExprNodeRep * casacore::TableExprNodeSetElem::increment | ( | ) | const [inline] |
Definition at line 256 of file ExprNodeSet.h.
References itsIncr.
Bool casacore::TableExprNodeSetElem::isDiscrete | ( | ) | const [inline] |
Bool casacore::TableExprNodeSetElem::isLeftClosed | ( | ) | const [inline] |
Is the interval left or right closed?
Definition at line 240 of file ExprNodeSet.h.
References itsLeftClosed.
Bool casacore::TableExprNodeSetElem::isRightClosed | ( | ) | const [inline] |
Definition at line 244 of file ExprNodeSet.h.
References itsRightClosed.
Bool casacore::TableExprNodeSetElem::isSingle | ( | ) | const [inline] |
void casacore::TableExprNodeSetElem::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 this set element.
This is used by the system to implement the IN operator.
Note that it does NOT set match values to False; it is assumed they are initialized that way.
void casacore::TableExprNodeSetElem::matchDate | ( | Bool * | match, | |
const MVTime * | value, | |||
uInt | nval, | |||
const TableExprId & | id | |||
) | const |
void casacore::TableExprNodeSetElem::matchDComplex | ( | Bool * | match, | |
const DComplex * | value, | |||
uInt | nval, | |||
const TableExprId & | id | |||
) | const |
void casacore::TableExprNodeSetElem::matchDouble | ( | Bool * | match, | |
const Double * | value, | |||
uInt | nval, | |||
const TableExprId & | id | |||
) | const |
void casacore::TableExprNodeSetElem::matchInt | ( | Bool * | match, | |
const Int64 * | value, | |||
uInt | nval, | |||
const TableExprId & | id | |||
) | const |
void casacore::TableExprNodeSetElem::matchString | ( | Bool * | match, | |
const String * | value, | |||
uInt | nval, | |||
const TableExprId & | id | |||
) | const |
TableExprNodeSetElem& casacore::TableExprNodeSetElem::operator= | ( | const TableExprNodeSetElem & | ) | [private] |
A copy of a TableExprNodeSetElem cannot be made.
Reimplemented from casacore::TableExprNodeRep.
void casacore::TableExprNodeSetElem::setup | ( | Bool | isLeftClosed, | |
const TableExprNode * | start, | |||
const TableExprNode * | end, | |||
Bool | isRightClosed | |||
) | [private] |
Setup the object for a continuous interval.
void casacore::TableExprNodeSetElem::show | ( | ostream & | os, | |
uInt | indent | |||
) | const [virtual] |
Show the node.
Reimplemented from casacore::TableExprNodeRep.
TableExprNodeRep * casacore::TableExprNodeSetElem::start | ( | ) | const [inline] |
Get the start, end or increment expression.
Note that the pointer returned can be zero indicating that that value was not given.
Definition at line 248 of file ExprNodeSet.h.
References itsStart.
Definition at line 226 of file ExprNodeSet.h.
Referenced by isDiscrete().
Definition at line 221 of file ExprNodeSet.h.
Referenced by end().
Definition at line 223 of file ExprNodeSet.h.
Definition at line 222 of file ExprNodeSet.h.
Referenced by increment().
Definition at line 224 of file ExprNodeSet.h.
Referenced by isLeftClosed().
Definition at line 225 of file ExprNodeSet.h.
Referenced by isRightClosed().
Definition at line 227 of file ExprNodeSet.h.
Referenced by isSingle().
Definition at line 220 of file ExprNodeSet.h.
Referenced by start().