casa
$Rev:20696$
|
Class to hold multiple table expression nodes. More...
#include <ExprNodeSet.h>
Public Member Functions | |
TableExprNodeSet () | |
Construct an empty set. | |
TableExprNodeSet (const IPosition &) | |
Construct from an IPosition . | |
TableExprNodeSet (const Slicer &) | |
Construct from a Slicer . | |
TableExprNodeSet (const Vector< uInt > &rownrs, const TableExprNodeSet &) | |
Construct a set with n*set.nelements() elements where n is the number of rows. | |
TableExprNodeSet (const TableExprNodeSet &) | |
~TableExprNodeSet () | |
void | add (const TableExprNodeSetElem &) |
Add an element to the set. | |
void | show (ostream &os, uInt indent) const |
Show the node. | |
void | checkEqualDataTypes () const |
Check if the data type of the set elements are the same. | |
Bool | isSingle () const |
Contains the set only single elements? Single means that only single values are given (thus no end nor incr). | |
Bool | isDiscrete () const |
Contains the set only discrete elements? Discrete means that no continuous ranges are given, but discrete ranges (using :) are possible. | |
Bool | isBounded () const |
Is the set fully bounded (discrete and no undefined end values)? | |
uInt | nelements () const |
Get the number of elements. | |
const TableExprNodeSetElem & | operator[] (uInt index) const |
Get the i-th element. | |
Bool | hasArrays () const |
Contains the set array values? | |
TableExprNodeRep * | setOrArray () const |
Try to convert the set to an array. | |
TableExprNodeRep * | toArray () const |
Convert the const set to an array. | |
virtual Array< Bool > | getArrayBool (const TableExprId &id) |
Get an array value for this bounded set in the given row. | |
virtual Array< Int64 > | getArrayInt (const TableExprId &id) |
virtual Array< Double > | getArrayDouble (const TableExprId &id) |
virtual Array< DComplex > | getArrayDComplex (const TableExprId &id) |
virtual Array< String > | getArrayString (const TableExprId &id) |
virtual Array< MVTime > | getArrayDate (const TableExprId &id) |
virtual Bool | hasBool (const TableExprId &id, Bool value) |
Does a value occur in the set? | |
virtual Bool | hasInt (const TableExprId &id, Int64 value) |
virtual Bool | hasDouble (const TableExprId &id, Double value) |
virtual Bool | hasDComplex (const TableExprId &id, const DComplex &value) |
virtual Bool | hasString (const TableExprId &id, const String &value) |
virtual Bool | hasDate (const TableExprId &id, const MVTime &value) |
virtual Array< Bool > | hasArrayBool (const TableExprId &id, const Array< Bool > &value) |
virtual Array< Bool > | hasArrayInt (const TableExprId &id, const Array< Int64 > &value) |
virtual Array< Bool > | hasArrayDouble (const TableExprId &id, const Array< Double > &value) |
virtual Array< Bool > | hasArrayDComplex (const TableExprId &id, const Array< DComplex > &value) |
virtual Array< Bool > | hasArrayString (const TableExprId &id, const Array< String > &value) |
virtual Array< Bool > | hasArrayDate (const TableExprId &id, const Array< MVTime > &value) |
virtual void | adaptSetUnits (const Unit &) |
Let a set node convert itself to the given unit. | |
Private Types | |
typedef Bool(TableExprNodeSet::* | FindFuncPtr )(Double value) |
Define the functions to find a double, which depend on open/closed-ness. | |
Private Member Functions | |
TableExprNodeSet & | operator= (const TableExprNodeSet &) |
A copy of a TableExprNodeSet cannot be made. | |
void | deleteElems () |
Delete all set elements in itsElems. | |
Array< Bool > | toArrayBool (const TableExprId &id) const |
Convert a bounded set to an Array. | |
Array< Int64 > | toArrayInt (const TableExprId &id) const |
Array< Double > | toArrayDouble (const TableExprId &id) const |
Array< DComplex > | toArrayDComplex (const TableExprId &id) const |
Array< String > | toArrayString (const TableExprId &id) const |
Array< MVTime > | toArrayDate (const TableExprId &id) const |
void | combineIntIntervals () |
Sort and combine intervals. | |
void | combineDoubleIntervals () |
void | combineDateIntervals () |
Bool | findOpenOpen (Double value) |
Bool | findOpenClosed (Double value) |
Bool | findClosedOpen (Double value) |
Bool | findClosedClosed (Double value) |
void | setFindFunc (Bool isLeftClosed, Bool isRightClosed) |
Private Attributes | |
PtrBlock< TableExprNodeSetElem * > | itsElems |
Bool | itsSingle |
Bool | itsDiscrete |
Bool | itsBounded |
Bool | itsCheckTypes |
Bool | itsAllIntervals |
Block< Double > | itsStart |
Block< Double > | itsEnd |
FindFuncPtr | itsFindFunc |
Class to hold multiple table expression nodes.
Public interface
This class is used to assemble several table expression nodes. It is used for 3 purposes:
The type of all set elements has to be the same. The set consists of TableExprNodeSetElem elements. The add
function has to be used to add an element to the set.
It is possible to construct the object directly from an IPosition object. In that case all elements are single. Furthermore it is possible to construct it directly from a Slicer object. In that case all elements represent a discrete interval.
Definition at line 298 of file ExprNodeSet.h.
typedef Bool(TableExprNodeSet::* casa::TableExprNodeSet::FindFuncPtr)(Double value) [private] |
Define the functions to find a double, which depend on open/closed-ness.
In this way a test on open/closed is done only once.
Definition at line 428 of file ExprNodeSet.h.
Construct an empty set.
casa::TableExprNodeSet::TableExprNodeSet | ( | const IPosition & | ) |
casa::TableExprNodeSet::TableExprNodeSet | ( | const Slicer & | ) |
Construct from a Slicer
.
The number of elements in the set is the dimensionality of the Slicer
. All set elements are discrete intervals. Their start and/or end is undefined if it is was not defined (i.e. Slicer::MimicSource used) in the Slicer
object.
casa::TableExprNodeSet::TableExprNodeSet | ( | const Vector< uInt > & | rownrs, |
const TableExprNodeSet & | |||
) |
Construct a set with n*set.nelements() elements where n is the number of rows.
Element i is constructed by evaluating the input element for row rownr[i].
virtual void casa::TableExprNodeSet::adaptSetUnits | ( | const Unit & | ) | [virtual] |
Let a set node convert itself to the given unit.
Reimplemented from casa::TableExprNodeRep.
void casa::TableExprNodeSet::add | ( | const TableExprNodeSetElem & | ) |
Add an element to the set.
void casa::TableExprNodeSet::checkEqualDataTypes | ( | ) | const |
Check if the data type of the set elements are the same.
If not, an exception is thrown.
void casa::TableExprNodeSet::combineDateIntervals | ( | ) | [private] |
void casa::TableExprNodeSet::combineDoubleIntervals | ( | ) | [private] |
void casa::TableExprNodeSet::combineIntIntervals | ( | ) | [private] |
Sort and combine intervals.
void casa::TableExprNodeSet::deleteElems | ( | ) | [private] |
Delete all set elements in itsElems.
Bool casa::TableExprNodeSet::findClosedClosed | ( | Double | value | ) | [private] |
Bool casa::TableExprNodeSet::findClosedOpen | ( | Double | value | ) | [private] |
Bool casa::TableExprNodeSet::findOpenClosed | ( | Double | value | ) | [private] |
Bool casa::TableExprNodeSet::findOpenOpen | ( | Double | value | ) | [private] |
virtual Array<Bool> casa::TableExprNodeSet::getArrayBool | ( | const TableExprId & | id | ) | [virtual] |
Get an array value for this bounded set in the given row.
Reimplemented from casa::TableExprNodeRep.
virtual Array<MVTime> casa::TableExprNodeSet::getArrayDate | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casa::TableExprNodeRep.
virtual Array<DComplex> casa::TableExprNodeSet::getArrayDComplex | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casa::TableExprNodeRep.
virtual Array<Double> casa::TableExprNodeSet::getArrayDouble | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casa::TableExprNodeRep.
virtual Array<Int64> casa::TableExprNodeSet::getArrayInt | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casa::TableExprNodeRep.
virtual Array<String> casa::TableExprNodeSet::getArrayString | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casa::TableExprNodeRep.
virtual Array<Bool> casa::TableExprNodeSet::hasArrayBool | ( | const TableExprId & | id, |
const Array< Bool > & | value | ||
) | [virtual] |
Reimplemented from casa::TableExprNodeRep.
virtual Array<Bool> casa::TableExprNodeSet::hasArrayDate | ( | const TableExprId & | id, |
const Array< MVTime > & | value | ||
) | [virtual] |
Reimplemented from casa::TableExprNodeRep.
virtual Array<Bool> casa::TableExprNodeSet::hasArrayDComplex | ( | const TableExprId & | id, |
const Array< DComplex > & | value | ||
) | [virtual] |
Reimplemented from casa::TableExprNodeRep.
virtual Array<Bool> casa::TableExprNodeSet::hasArrayDouble | ( | const TableExprId & | id, |
const Array< Double > & | value | ||
) | [virtual] |
Reimplemented from casa::TableExprNodeRep.
virtual Array<Bool> casa::TableExprNodeSet::hasArrayInt | ( | const TableExprId & | id, |
const Array< Int64 > & | value | ||
) | [virtual] |
Reimplemented from casa::TableExprNodeRep.
Bool casa::TableExprNodeSet::hasArrays | ( | ) | const |
Contains the set array values?
virtual Array<Bool> casa::TableExprNodeSet::hasArrayString | ( | const TableExprId & | id, |
const Array< String > & | value | ||
) | [virtual] |
Reimplemented from casa::TableExprNodeRep.
virtual Bool casa::TableExprNodeSet::hasBool | ( | const TableExprId & | id, |
Bool | value | ||
) | [virtual] |
Does a value occur in the set?
Reimplemented from casa::TableExprNodeRep.
virtual Bool casa::TableExprNodeSet::hasDate | ( | const TableExprId & | id, |
const MVTime & | value | ||
) | [virtual] |
Reimplemented from casa::TableExprNodeRep.
virtual Bool casa::TableExprNodeSet::hasDComplex | ( | const TableExprId & | id, |
const DComplex & | value | ||
) | [virtual] |
Reimplemented from casa::TableExprNodeRep.
virtual Bool casa::TableExprNodeSet::hasDouble | ( | const TableExprId & | id, |
Double | value | ||
) | [virtual] |
Reimplemented from casa::TableExprNodeRep.
virtual Bool casa::TableExprNodeSet::hasInt | ( | const TableExprId & | id, |
Int64 | value | ||
) | [virtual] |
Reimplemented from casa::TableExprNodeRep.
virtual Bool casa::TableExprNodeSet::hasString | ( | const TableExprId & | id, |
const String & | value | ||
) | [virtual] |
Reimplemented from casa::TableExprNodeRep.
Bool casa::TableExprNodeSet::isBounded | ( | ) | const [inline] |
Is the set fully bounded (discrete and no undefined end values)?
Definition at line 456 of file ExprNodeSet.h.
References itsBounded.
Bool casa::TableExprNodeSet::isDiscrete | ( | ) | const [inline] |
Contains the set only discrete elements? Discrete means that no continuous ranges are given, but discrete ranges (using :) are possible.
Definition at line 452 of file ExprNodeSet.h.
References itsDiscrete.
Bool casa::TableExprNodeSet::isSingle | ( | ) | const [inline] |
Contains the set only single elements? Single means that only single values are given (thus no end nor incr).
Definition at line 448 of file ExprNodeSet.h.
References itsSingle.
uInt casa::TableExprNodeSet::nelements | ( | ) | const [inline] |
Get the number of elements.
Definition at line 460 of file ExprNodeSet.h.
References itsElems, and casa::PtrBlock< T >::nelements().
TableExprNodeSet& casa::TableExprNodeSet::operator= | ( | const TableExprNodeSet & | ) | [private] |
A copy of a TableExprNodeSet cannot be made.
const TableExprNodeSetElem & casa::TableExprNodeSet::operator[] | ( | uInt | index | ) | const [inline] |
void casa::TableExprNodeSet::setFindFunc | ( | Bool | isLeftClosed, |
Bool | isRightClosed | ||
) | [private] |
Try to convert the set to an array.
If not possible, a copy of the set is returned.
void casa::TableExprNodeSet::show | ( | ostream & | os, |
uInt | indent | ||
) | const [virtual] |
Show the node.
Reimplemented from casa::TableExprNodeRep.
TableExprNodeRep* casa::TableExprNodeSet::toArray | ( | ) | const |
Convert the const set to an array.
Array<Bool> casa::TableExprNodeSet::toArrayBool | ( | const TableExprId & | id | ) | const [private] |
Convert a bounded set to an Array.
Array<MVTime> casa::TableExprNodeSet::toArrayDate | ( | const TableExprId & | id | ) | const [private] |
Array<DComplex> casa::TableExprNodeSet::toArrayDComplex | ( | const TableExprId & | id | ) | const [private] |
Array<Double> casa::TableExprNodeSet::toArrayDouble | ( | const TableExprId & | id | ) | const [private] |
Array<Int64> casa::TableExprNodeSet::toArrayInt | ( | const TableExprId & | id | ) | const [private] |
Array<String> casa::TableExprNodeSet::toArrayString | ( | const TableExprId & | id | ) | const [private] |
Bool casa::TableExprNodeSet::itsAllIntervals [private] |
Definition at line 441 of file ExprNodeSet.h.
Bool casa::TableExprNodeSet::itsBounded [private] |
Definition at line 439 of file ExprNodeSet.h.
Referenced by isBounded().
Bool casa::TableExprNodeSet::itsCheckTypes [private] |
Definition at line 440 of file ExprNodeSet.h.
Bool casa::TableExprNodeSet::itsDiscrete [private] |
Definition at line 438 of file ExprNodeSet.h.
Referenced by isDiscrete().
Block<Double> casa::TableExprNodeSet::itsEnd [private] |
Definition at line 443 of file ExprNodeSet.h.
Definition at line 444 of file ExprNodeSet.h.
Bool casa::TableExprNodeSet::itsSingle [private] |
Definition at line 437 of file ExprNodeSet.h.
Referenced by isSingle().
Block<Double> casa::TableExprNodeSet::itsStart [private] |
Definition at line 442 of file ExprNodeSet.h.