casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes
casa::TableExprNodeBinary Class Reference

Abstract base class for a node having 0, 1, or 2 child nodes. More...

#include <ExprNodeRep.h>

Inheritance diagram for casa::TableExprNodeBinary:
casa::TableExprNodeRep casa::TableExprNodeAND casa::TableExprNodeArray casa::TableExprNodeBitAndInt casa::TableExprNodeBitNegate casa::TableExprNodeBitOrInt casa::TableExprNodeBitXorInt casa::TableExprNodeColumn casa::TableExprNodeConstBool casa::TableExprNodeConstDate casa::TableExprNodeConstDComplex casa::TableExprNodeConstDouble casa::TableExprNodeConstInt casa::TableExprNodeConstRegex casa::TableExprNodeConstString casa::TableExprNodeDivide casa::TableExprNodeEQBool casa::TableExprNodeEQDate casa::TableExprNodeEQDComplex casa::TableExprNodeEQDouble casa::TableExprNodeEQInt casa::TableExprNodeEQRegex casa::TableExprNodeEQString casa::TableExprNodeGEDate casa::TableExprNodeGEDComplex casa::TableExprNodeGEDouble casa::TableExprNodeGEInt casa::TableExprNodeGEString casa::TableExprNodeGTDate casa::TableExprNodeGTDComplex casa::TableExprNodeGTDouble casa::TableExprNodeGTInt casa::TableExprNodeGTString casa::TableExprNodeINDate casa::TableExprNodeINDComplex casa::TableExprNodeINDouble casa::TableExprNodeINInt casa::TableExprNodeINString casa::TableExprNodeMIN casa::TableExprNodeMinus casa::TableExprNodeModulo casa::TableExprNodeNEBool casa::TableExprNodeNEDate casa::TableExprNodeNEDComplex casa::TableExprNodeNEDouble casa::TableExprNodeNEInt casa::TableExprNodeNERegex casa::TableExprNodeNEString casa::TableExprNodeNOT casa::TableExprNodeOR casa::TableExprNodePlus casa::TableExprNodeRandom casa::TableExprNodeRecordField casa::TableExprNodeRowid casa::TableExprNodeRownr casa::TableExprNodeTimes casa::TableExprNodeUnit

List of all members.

Public Member Functions

 TableExprNodeBinary (NodeDataType, ValueType, OperType, const Table &)
 Constructor.
 TableExprNodeBinary (NodeDataType, const TableExprNodeRep &, OperType)
virtual ~TableExprNodeBinary ()
 Destructor.
virtual void show (ostream &, uInt indent) const
 Show the expression tree.
virtual Bool isSingleValue () const
 Does the node result in a single value (for e.g.
virtual void handleUnits ()
 Handle the units of the children and possibly set the parent's unit.
void convertConstChild ()
 When one of the children is a constant, convert its data type to that of the other operand.
const TableExprNodeRepgetLeftChild () const
 Get the child nodes.
const TableExprNodeRepgetRightChild () const

Static Public Member Functions

static NodeDataType getDT (NodeDataType leftDtype, NodeDataType rightDype, OperType operType)
 Check the data types and get the common one.
static TableExprNodeRep getTypes (const TableExprNodeRep &left, const TableExprNodeRep &right, OperType operType)
 Check the data and value types and get the common one.
static TableExprNodeRepfillNode (TableExprNodeBinary *thisNode, TableExprNodeRep *left, TableExprNodeRep *right, Bool convertConstType)
 Link the children to the node and convert the children to constants if needed and possible.

Static Protected Member Functions

static const UnitmakeEqualUnits (TableExprNodeRep *left, TableExprNodeRep *&right)
 
     

Protected Attributes

TableExprNodeReplnode_p
TableExprNodeReprnode_p

Detailed Description

Abstract base class for a node having 0, 1, or 2 child nodes.

Intended use:

Internal

Review Status

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

Prerequisite

Etymology

TableExprNodeBinary is a node in the table expression tree representing a binary node (i.e. having 2 operands).

Synopsis

TableExprNodeBinary is the abstract base class for all nodes in a table expression tree using up to 2 operands. It is used as the base class for the node classes representing operator +, -, etc..

Motivation

This class contains the common functionality for the classes representing a binary (or unary) operator.

Definition at line 502 of file ExprNodeRep.h.


Constructor & Destructor Documentation

Constructor.

Destructor.


Member Function Documentation

When one of the children is a constant, convert its data type to that of the other operand.

This avoids that conversions are done for each get.

Reimplemented from casa::TableExprNodeRep.

static TableExprNodeRep* casa::TableExprNodeBinary::fillNode ( TableExprNodeBinary thisNode,
TableExprNodeRep left,
TableExprNodeRep right,
Bool  convertConstType 
) [static]

Link the children to the node and convert the children to constants if needed and possible.

Also convert the node to constant if possible.

static NodeDataType casa::TableExprNodeBinary::getDT ( NodeDataType  leftDtype,
NodeDataType  rightDype,
OperType  operType 
) [static]

Check the data types and get the common one.

Get the child nodes.

Definition at line 548 of file ExprNodeRep.h.

References lnode_p.

Definition at line 550 of file ExprNodeRep.h.

References rnode_p.

static TableExprNodeRep casa::TableExprNodeBinary::getTypes ( const TableExprNodeRep left,
const TableExprNodeRep right,
OperType  operType 
) [static]

Check the data and value types and get the common one.

virtual void casa::TableExprNodeBinary::handleUnits ( ) [virtual]

Handle the units of the children and possibly set the parent's unit.

The default implementation make the units of the children equal and set the parent unit to that unit if the parent is not a Bool value.

Reimplemented in casa::TableExprNodeModulo, casa::TableExprNodeArrayModulo, casa::TableExprNodeDivide, casa::TableExprNodeArrayDivide, casa::TableExprNodeTimes, casa::TableExprNodeArrayTimes, casa::TableExprNodeMinusDate, casa::TableExprNodeArrayMinusDate, casa::TableExprNodeMinusDouble, casa::TableExprNodeMinusInt, casa::TableExprNodeArrayPlusDate, and casa::TableExprNodePlusDate.

virtual Bool casa::TableExprNodeBinary::isSingleValue ( ) const [virtual]

Does the node result in a single value (for e.g.

GROUPBY)?

Reimplemented from casa::TableExprNodeRep.

static const Unit& casa::TableExprNodeBinary::makeEqualUnits ( TableExprNodeRep left,
TableExprNodeRep *&  right 
) [static, protected]

     

Make the units equal. Replace the right node if needed.

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

Show the expression tree.

Reimplemented from casa::TableExprNodeRep.

Reimplemented in casa::TableExprNodeArrayPart.


Member Data Documentation

Definition at line 560 of file ExprNodeRep.h.

Referenced by getLeftChild().

Definition at line 561 of file ExprNodeRep.h.

Referenced by getRightChild().


The documentation for this class was generated from the following file: