Abstract base class for a node having 0, 1, or 2 child nodes. More...
#include <ExprNodeRep.h>
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 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. | |
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 TableExprNodeRep * | getLeftChild () const |
Get the child nodes. | |
const TableExprNodeRep * | getRightChild () 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 TableExprNodeRep * | fillNode (TableExprNodeBinary *thisNode, TableExprNodeRep *left, TableExprNodeRep *right, Bool convertConstType, Bool adaptDataType=True) |
Link the children to the node and convert the children to constants if needed and possible. | |
Static Protected Member Functions | |
static const Unit & | makeEqualUnits (TableExprNodeRep *left, TableExprNodeRep *&right) |
Make the units equal. | |
Protected Attributes | |
TableExprNodeRep * | lnode_p |
TableExprNodeRep * | rnode_p |
Abstract base class for a node having 0, 1, or 2 child nodes.
Internal
TableExprNodeBinary is a node in the table expression tree representing a binary node (i.e. having 2 operands).
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.\.
This class contains the common functionality for the classes representing a binary (or unary) operator.
Definition at line 553 of file ExprNodeRep.h.
casacore::TableExprNodeBinary::TableExprNodeBinary | ( | NodeDataType | , | |
ValueType | , | |||
OperType | , | |||
const Table & | ||||
) |
Constructor.
casacore::TableExprNodeBinary::TableExprNodeBinary | ( | NodeDataType | , | |
const TableExprNodeRep & | , | |||
OperType | ||||
) |
virtual casacore::TableExprNodeBinary::~TableExprNodeBinary | ( | ) | [virtual] |
Destructor.
void casacore::TableExprNodeBinary::convertConstChild | ( | ) | [virtual] |
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 casacore::TableExprNodeRep.
Reimplemented in casacore::TableExprNodeINInt.
static TableExprNodeRep* casacore::TableExprNodeBinary::fillNode | ( | TableExprNodeBinary * | thisNode, | |
TableExprNodeRep * | left, | |||
TableExprNodeRep * | right, | |||
Bool | convertConstType, | |||
Bool | adaptDataType = True | |||
) | [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. The operand data types can be adapted as needed.
virtual void casacore::TableExprNodeBinary::getAggrNodes | ( | vector< TableExprNodeRep * > & | aggr | ) | [virtual] |
Get the nodes representing an aggregate function.
Reimplemented in casacore::TableExprAggrNodeArray, casacore::TableExprFuncNodeArray, and casacore::TableExprUDFNodeArray.
virtual void casacore::TableExprNodeBinary::getColumnNodes | ( | vector< TableExprNodeRep * > & | cols | ) | [virtual] |
Get the nodes representing a table column.
Reimplemented in casacore::TableExprNodeColumn, casacore::TableExprFuncNodeArray, casacore::TableExprNodeArrayColumn, and casacore::TableExprUDFNodeArray.
static NodeDataType casacore::TableExprNodeBinary::getDT | ( | NodeDataType | leftDtype, | |
NodeDataType | rightDype, | |||
OperType | operType | |||
) | [static] |
Check the data types and get the common one.
const TableExprNodeRep* casacore::TableExprNodeBinary::getLeftChild | ( | ) | const [inline] |
const TableExprNodeRep* casacore::TableExprNodeBinary::getRightChild | ( | ) | const [inline] |
Definition at line 606 of file ExprNodeRep.h.
References rnode_p.
static TableExprNodeRep casacore::TableExprNodeBinary::getTypes | ( | const TableExprNodeRep & | left, | |
const TableExprNodeRep & | right, | |||
OperType | operType | |||
) | [static] |
Check the data and value types and get the common one.
virtual void casacore::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 casacore::TableExprNodePlusDate, casacore::TableExprNodeMinusInt, casacore::TableExprNodeMinusDouble, casacore::TableExprNodeMinusDate, casacore::TableExprNodeTimes, casacore::TableExprNodeDivide, casacore::TableExprNodeModulo, casacore::TableExprNodeArrayPlusDate, casacore::TableExprNodeArrayMinusDate, casacore::TableExprNodeArrayTimes, casacore::TableExprNodeArrayDivide, and casacore::TableExprNodeArrayModulo.
static const Unit& casacore::TableExprNodeBinary::makeEqualUnits | ( | TableExprNodeRep * | left, | |
TableExprNodeRep *& | right | |||
) | [static, protected] |
Make the units equal.
Replace the right node if needed.
virtual void casacore::TableExprNodeBinary::show | ( | ostream & | , | |
uInt | indent | |||
) | const [virtual] |
Show the expression tree.
Reimplemented from casacore::TableExprNodeRep.
Reimplemented in casacore::TableExprNodeArrayPart.
TableExprNodeRep* casacore::TableExprNodeBinary::lnode_p [protected] |
Definition at line 616 of file ExprNodeRep.h.
Referenced by getLeftChild().
TableExprNodeRep* casacore::TableExprNodeBinary::rnode_p [protected] |
Definition at line 617 of file ExprNodeRep.h.
Referenced by getRightChild().