casacore::TableExprNodeSetElem Class Reference

Class to hold the table expression nodes for an element in a set. More...

#include <ExprNodeSet.h>

Inheritance diagram for casacore::TableExprNodeSetElem:
casacore::TableExprNodeRep

List of all members.

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
TableExprNodeRepstart () const
 Get the start, end or increment expression.
TableExprNodeRepend () const
TableExprNodeRepincrement () 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
TableExprNodeSetElemevaluate (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

TableExprNodeSetElemoperator= (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

TableExprNodeRepitsStart
TableExprNodeRepitsEnd
TableExprNodeRepitsIncr
Bool itsEndExcl
Bool itsLeftClosed
Bool itsRightClosed
Bool itsDiscrete
Bool itsSingle

Detailed Description

Class to hold the table expression nodes for an element in a set.

Intended use:

Public interface

Review Status

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

Prerequisite

Synopsis

This class is used to assemble the table expression nodes representing an element in a set. A set element can be of 3 types:

  1. A single discrete value, which can be of any type. It can be used for 3 purposes:
    - A function argument.
    - A single index in an array indexing operation.
    - A single value in a set (used with the IN operator). This is in fact a bounded discrete interval (see below).
  2. A discrete interval consisting of start, end and increment. Each of those has to be an int scalar. Increment defaults to 1. It can be used for 2 purposes:
    - A slice in an array indexing operation. In that case start defaults to the beginning of the dimension and end defaults to the end.
    - A discrete interval in a set. Start has to be given. When end is not given, the result is an unbounded discrete interval. For a discrete interval, the type of start and end can also be a datetime scalar.
  3. A continuous interval, which can only be used in a set. It consists of a start and/or an end scalar value of type int, double, datetime, or string. The interval can be open or closed on one or both sides.

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

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]

Is it a discrete set element.

Definition at line 232 of file ExprNodeSet.h.

References itsDiscrete.

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]

Is a single value given?

Definition at line 236 of file ExprNodeSet.h.

References itsSingle.

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.


Member Data Documentation

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().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1