casa::TableExprNodeSet Class Reference
[Tables]

#include <ExprNodeSet.h>

Inheritance diagram for casa::TableExprNodeSet:

Inheritance graph
[legend]
Collaboration diagram for casa::TableExprNodeSet:

Collaboration graph
[legend]
List of all members.

Detailed Description

Class to hold multiple table expression nodes.

Intended use:

Part of API

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Prerequisite

Synopsis

This class is used to assemble several table expression nodes. It is used for 3 purposes:

  1. To hold the arguments of a function. All set elements must be single.
  2. To hold the variables of an index for an array slice. All set elements must be of type double scalar and they must represent a discrete interval (which includes single).
  3. To hold the elements of a set used with the IN operator. All set elements must be scalars of any type.
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 293 of file ExprNodeSet.h.
typedef Bool(TableExprNodeSet::*) FindFuncPtr (Double value)
 Define the functions to find a double, which depend on open/closed-ness.
Bool findOpenOpen (Double value)
Bool findOpenClosed (Double value)
Bool findClosedOpen (Double value)
Bool findClosedClosed (Double value)
void setFindFunc (Bool isLeftClosed, Bool isRightClosed)

Public Member Functions

 TableExprNodeSet ()
 Construct an empty set.
 TableExprNodeSet (const IPosition &)
 Construct from an IPosition.
 TableExprNodeSet (const Slicer &)
 Construct from a Slicer.
 TableExprNodeSet (uInt n, const TableExprNodeSet &)
 Construct a set with n*set.nelements() elements.
 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 TableExprNodeSetElemoperator[] (uInt index) const
 Get the i-th element.
Bool hasArrays () const
 Contains the set array values?
TableExprNodeRepsetOrArray () const
 Try to convert the set to an array.
TableExprNodeReptoArray () const
 Convert the const set to an array.
virtual void replaceTablePtr (const Table &)
 Replace the BaseTable pointer in this node and all its children.
virtual void adaptSetUnits (const Unit &)
 Let a set node convert itself to the given unit.
virtual Array< BoolgetArrayBool (const TableExprId &id)
 Get an array value for this bounded set in the given row.
virtual Array< DoublegetArrayDouble (const TableExprId &id)
virtual Array< DComplex > getArrayDComplex (const TableExprId &id)
virtual Array< StringgetArrayString (const TableExprId &id)
virtual Array< MVTimegetArrayDate (const TableExprId &id)
virtual Bool hasBool (const TableExprId &id, Bool value)
 Does a value occur in the set?
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< BoolhasArrayBool (const TableExprId &id, const Array< Bool > &value)
virtual Array< BoolhasArrayDouble (const TableExprId &id, const Array< Double > &value)
virtual Array< BoolhasArrayDComplex (const TableExprId &id, const Array< DComplex > &value)
virtual Array< BoolhasArrayString (const TableExprId &id, const Array< String > &value)
virtual Array< BoolhasArrayDate (const TableExprId &id, const Array< MVTime > &value)

Private Member Functions

TableExprNodeSetoperator= (const TableExprNodeSet &)
 A copy of a TableExprNodeSet cannot be made.
void deleteElems ()
 Delete all set elements in itsElems.
Array< BooltoArrayBool (const TableExprId &id) const
 Convert a bounded set to an Array.
Array< DoubletoArrayDouble (const TableExprId &id) const
Array< DComplex > toArrayDComplex (const TableExprId &id) const
Array< StringtoArrayString (const TableExprId &id) const
Array< MVTimetoArrayDate (const TableExprId &id) const
void combineDoubleIntervals ()
 Sort and combine intervals.
void combineDateIntervals ()

Private Attributes

PtrBlock< TableExprNodeSetElem * > itsElems
Bool itsSingle
Bool itsDiscrete
Bool itsBounded
Bool itsCheckTypes
Bool itsAllIntervals
Block< DoubleitsStart
Block< DoubleitsEnd
FindFuncPtr itsFindFunc


Member Typedef Documentation

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 419 of file ExprNodeSet.h.


Constructor & Destructor Documentation

casa::TableExprNodeSet::TableExprNodeSet (  ) 

Construct an empty set.

casa::TableExprNodeSet::TableExprNodeSet ( const IPosition  ) 

Construct from an IPosition.

The number of elements in the set is the number of elements in the IPosition. All set elements are single values.

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 ( uInt  n,
const TableExprNodeSet  
)

Construct a set with n*set.nelements() elements.

Element i is constructed by evaluating the input element for row i.

casa::TableExprNodeSet::TableExprNodeSet ( const TableExprNodeSet  ) 

casa::TableExprNodeSet::~TableExprNodeSet (  ) 


Member Function Documentation

void casa::TableExprNodeSet::add ( const TableExprNodeSetElem  ) 

Add an element to the set.

void casa::TableExprNodeSet::show ( ostream &  os,
uInt  indent 
) const [virtual]

Show the node.

Reimplemented from casa::TableExprNodeRep.

void casa::TableExprNodeSet::checkEqualDataTypes (  )  const

Check if the data type of the set elements are the same.

If not, an exception is thrown.

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 439 of file ExprNodeSet.h.

References itsSingle.

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 443 of file ExprNodeSet.h.

References itsDiscrete.

Bool casa::TableExprNodeSet::isBounded (  )  const [inline]

Is the set fully bounded (discrete and no undefined end values)?

Definition at line 447 of file ExprNodeSet.h.

References itsBounded.

uInt casa::TableExprNodeSet::nelements (  )  const [inline]

Get the number of elements.

Definition at line 451 of file ExprNodeSet.h.

References itsElems.

const TableExprNodeSetElem & casa::TableExprNodeSet::operator[] ( uInt  index  )  const [inline]

Get the i-th element.

Definition at line 456 of file ExprNodeSet.h.

References itsElems.

Bool casa::TableExprNodeSet::hasArrays (  )  const

Contains the set array values?

TableExprNodeRep* casa::TableExprNodeSet::setOrArray (  )  const

Try to convert the set to an array.

If not possible, a copy of the set is returned.

TableExprNodeRep* casa::TableExprNodeSet::toArray (  )  const

Convert the const set to an array.

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<Double> casa::TableExprNodeSet::getArrayDouble ( const TableExprId id  )  [virtual]

Reimplemented from casa::TableExprNodeRep.

virtual Array<DComplex> casa::TableExprNodeSet::getArrayDComplex ( const TableExprId id  )  [virtual]

Reimplemented from casa::TableExprNodeRep.

virtual Array<String> casa::TableExprNodeSet::getArrayString ( const TableExprId id  )  [virtual]

Reimplemented from casa::TableExprNodeRep.

virtual Array<MVTime> casa::TableExprNodeSet::getArrayDate ( const TableExprId id  )  [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::hasDouble ( const TableExprId id,
Double  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::hasString ( const TableExprId id,
const String value 
) [virtual]

Reimplemented from casa::TableExprNodeRep.

virtual Bool casa::TableExprNodeSet::hasDate ( const TableExprId id,
const MVTime value 
) [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::hasArrayDouble ( const TableExprId id,
const Array< Double > &  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::hasArrayString ( const TableExprId id,
const Array< String > &  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 void casa::TableExprNodeSet::replaceTablePtr ( const Table  )  [virtual]

Replace the BaseTable pointer in this node and all its children.

Reimplemented from casa::TableExprNodeRep.

virtual void casa::TableExprNodeSet::adaptSetUnits ( const Unit  )  [virtual]

Let a set node convert itself to the given unit.

Reimplemented from casa::TableExprNodeRep.

TableExprNodeSet& casa::TableExprNodeSet::operator= ( const TableExprNodeSet  )  [private]

A copy of a TableExprNodeSet cannot be made.

void casa::TableExprNodeSet::deleteElems (  )  [private]

Delete all set elements in itsElems.

Array<Bool> casa::TableExprNodeSet::toArrayBool ( const TableExprId id  )  const [private]

Convert a bounded set to an Array.

Array<Double> casa::TableExprNodeSet::toArrayDouble ( const TableExprId id  )  const [private]

Array<DComplex> casa::TableExprNodeSet::toArrayDComplex ( const TableExprId id  )  const [private]

Array<String> casa::TableExprNodeSet::toArrayString ( const TableExprId id  )  const [private]

Array<MVTime> casa::TableExprNodeSet::toArrayDate ( const TableExprId id  )  const [private]

void casa::TableExprNodeSet::combineDoubleIntervals (  )  [private]

Sort and combine intervals.

void casa::TableExprNodeSet::combineDateIntervals (  )  [private]

Bool casa::TableExprNodeSet::findOpenOpen ( Double  value  )  [private]

Bool casa::TableExprNodeSet::findOpenClosed ( Double  value  )  [private]

Bool casa::TableExprNodeSet::findClosedOpen ( Double  value  )  [private]

Bool casa::TableExprNodeSet::findClosedClosed ( Double  value  )  [private]

void casa::TableExprNodeSet::setFindFunc ( Bool  isLeftClosed,
Bool  isRightClosed 
) [private]


Member Data Documentation

PtrBlock<TableExprNodeSetElem*> casa::TableExprNodeSet::itsElems [private]

Definition at line 427 of file ExprNodeSet.h.

Referenced by nelements(), and operator[]().

Bool casa::TableExprNodeSet::itsSingle [private]

Definition at line 428 of file ExprNodeSet.h.

Referenced by isSingle().

Bool casa::TableExprNodeSet::itsDiscrete [private]

Definition at line 429 of file ExprNodeSet.h.

Referenced by isDiscrete().

Bool casa::TableExprNodeSet::itsBounded [private]

Definition at line 430 of file ExprNodeSet.h.

Referenced by isBounded().

Bool casa::TableExprNodeSet::itsCheckTypes [private]

Definition at line 431 of file ExprNodeSet.h.

Bool casa::TableExprNodeSet::itsAllIntervals [private]

Definition at line 432 of file ExprNodeSet.h.

Block<Double> casa::TableExprNodeSet::itsStart [private]

Definition at line 433 of file ExprNodeSet.h.

Block<Double> casa::TableExprNodeSet::itsEnd [private]

Definition at line 434 of file ExprNodeSet.h.

FindFuncPtr casa::TableExprNodeSet::itsFindFunc [private]

Definition at line 435 of file ExprNodeSet.h.


The documentation for this class was generated from the following file:
Generated on Mon Sep 1 22:45:30 2008 for NRAOCASA by  doxygen 1.5.1