casa
$Rev:20696$
|
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. | |
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, uInt &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, uInt &cnt, const TableExprId &id) const |
void | fillVector (Vector< Double > &vec, uInt &cnt, const TableExprId &id) const |
void | fillVector (Vector< DComplex > &vec, uInt &cnt, const TableExprId &id) const |
void | fillVector (Vector< String > &vec, uInt &cnt, const TableExprId &id) const |
void | fillVector (Vector< MVTime > &vec, uInt &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 92 of file ExprNodeSet.h.
casa::TableExprNodeSetElem::TableExprNodeSetElem | ( | const TableExprNode & | node | ) | [explicit] |
Create the object for a single expression node.
casa::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).
casa::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.
casa::TableExprNodeSetElem::TableExprNodeSetElem | ( | Bool | isLeftClosed, |
const TableExprNode & | start | ||
) |
Create the object for a continuous left-bounded interval.
casa::TableExprNodeSetElem::TableExprNodeSetElem | ( | const TableExprNode & | end, |
Bool | isRightClosed | ||
) |
Create the object for a continuous right-bounded interval.
Copy constructor (copy semantics).
casa::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 casa::TableExprNodeSetElem::adaptSetUnits | ( | const Unit & | ) | [virtual] |
Let a set node convert itself to the given unit.
Reimplemented from casa::TableExprNodeRep.
Get the table of a node and check if the children use the same table.
TableExprNodeRep * casa::TableExprNodeSetElem::end | ( | ) | const [inline] |
Definition at line 245 of file ExprNodeSet.h.
References itsEnd.
TableExprNodeSetElem* casa::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 casa::TableExprNodeSetElem::fillVector | ( | Vector< Bool > & | vec, |
uInt & | 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.
void casa::TableExprNodeSetElem::fillVector | ( | Vector< Int64 > & | vec, |
uInt & | cnt, | ||
const TableExprId & | id | ||
) | const |
void casa::TableExprNodeSetElem::fillVector | ( | Vector< Double > & | vec, |
uInt & | cnt, | ||
const TableExprId & | id | ||
) | const |
void casa::TableExprNodeSetElem::fillVector | ( | Vector< DComplex > & | vec, |
uInt & | cnt, | ||
const TableExprId & | id | ||
) | const |
void casa::TableExprNodeSetElem::fillVector | ( | Vector< String > & | vec, |
uInt & | cnt, | ||
const TableExprId & | id | ||
) | const |
void casa::TableExprNodeSetElem::fillVector | ( | Vector< MVTime > & | vec, |
uInt & | cnt, | ||
const TableExprId & | id | ||
) | const |
TableExprNodeRep * casa::TableExprNodeSetElem::increment | ( | ) | const [inline] |
Definition at line 249 of file ExprNodeSet.h.
References itsIncr.
Bool casa::TableExprNodeSetElem::isDiscrete | ( | ) | const [inline] |
Bool casa::TableExprNodeSetElem::isLeftClosed | ( | ) | const [inline] |
Is the interval left or right closed?
Definition at line 233 of file ExprNodeSet.h.
References itsLeftClosed.
Bool casa::TableExprNodeSetElem::isRightClosed | ( | ) | const [inline] |
Definition at line 237 of file ExprNodeSet.h.
References itsRightClosed.
Bool casa::TableExprNodeSetElem::isSingle | ( | ) | const [inline] |
void casa::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 casa::TableExprNodeSetElem::matchDate | ( | Bool * | match, |
const MVTime * | value, | ||
uInt | nval, | ||
const TableExprId & | id | ||
) | const |
void casa::TableExprNodeSetElem::matchDComplex | ( | Bool * | match, |
const DComplex * | value, | ||
uInt | nval, | ||
const TableExprId & | id | ||
) | const |
void casa::TableExprNodeSetElem::matchDouble | ( | Bool * | match, |
const Double * | value, | ||
uInt | nval, | ||
const TableExprId & | id | ||
) | const |
void casa::TableExprNodeSetElem::matchInt | ( | Bool * | match, |
const Int64 * | value, | ||
uInt | nval, | ||
const TableExprId & | id | ||
) | const |
void casa::TableExprNodeSetElem::matchString | ( | Bool * | match, |
const String * | value, | ||
uInt | nval, | ||
const TableExprId & | id | ||
) | const |
TableExprNodeSetElem& casa::TableExprNodeSetElem::operator= | ( | const TableExprNodeSetElem & | ) | [private] |
A copy of a TableExprNodeSetElem cannot be made.
void casa::TableExprNodeSetElem::setup | ( | Bool | isLeftClosed, |
const TableExprNode * | start, | ||
const TableExprNode * | end, | ||
Bool | isRightClosed | ||
) | [private] |
Setup the object for a continuous interval.
void casa::TableExprNodeSetElem::show | ( | ostream & | os, |
uInt | indent | ||
) | const [virtual] |
Show the node.
Reimplemented from casa::TableExprNodeRep.
TableExprNodeRep * casa::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 241 of file ExprNodeSet.h.
References itsStart.
Bool casa::TableExprNodeSetElem::itsDiscrete [private] |
Definition at line 219 of file ExprNodeSet.h.
Referenced by isDiscrete().
Definition at line 214 of file ExprNodeSet.h.
Referenced by end().
Bool casa::TableExprNodeSetElem::itsEndExcl [private] |
Definition at line 216 of file ExprNodeSet.h.
Definition at line 215 of file ExprNodeSet.h.
Referenced by increment().
Definition at line 217 of file ExprNodeSet.h.
Referenced by isLeftClosed().
Definition at line 218 of file ExprNodeSet.h.
Referenced by isRightClosed().
Bool casa::TableExprNodeSetElem::itsSingle [private] |
Definition at line 220 of file ExprNodeSet.h.
Referenced by isSingle().
Definition at line 213 of file ExprNodeSet.h.
Referenced by start().