casa
$Rev:20696$
|
Unit for scalar values in a table select expression tree. More...
#include <ExprUnitNode.h>
Public Member Functions | |
TableExprNodeUnit (TableExprNodeRep &child, const Unit &unit) | |
Constrcut from the given child node and unit. | |
~TableExprNodeUnit () | |
virtual Double | getUnitFactor () const |
Get the unit factor. | |
virtual Double | getDouble (const TableExprId &id) |
virtual DComplex | getDComplex (const TableExprId &id) |
Static Public Member Functions | |
static Double | set (TableExprNodeRep &parent, const TableExprNodeRep &child, const Unit &unit) |
Calculate the conversion factor and return it. | |
static TableExprNodeRep * | useUnit (TableExprNodeRep *const node, const Unit &unit) |
Create a new node if unit conversion is needed. | |
static void | adaptUnit (TableExprNodeRep *&node, const Unit &unit) |
Use useUnit to see if a conversion is needed. | |
static Unit | adaptUnits (TableExprNodeRep *&node1, TableExprNodeRep *&node2, TableExprNodeRep *&node3) |
Find the unit to be used and adapt the nodes to it. | |
Private Attributes | |
Double | factor_p |
Unit for scalar values in a table select expression tree.
Internal
This class represents a unit in a table select expression tree. It contains a unit conversion factor to convert the child to this unit. The factor is 1 if the child has no unit.
Definition at line 61 of file ExprUnitNode.h.
casa::TableExprNodeUnit::TableExprNodeUnit | ( | TableExprNodeRep & | child, |
const Unit & | unit | ||
) |
Constrcut from the given child node and unit.
static void casa::TableExprNodeUnit::adaptUnit | ( | TableExprNodeRep *& | node, |
const Unit & | unit | ||
) | [static] |
Use useUnit
to see if a conversion is needed.
If so, adapt the reference counts and replace the node.
static Unit casa::TableExprNodeUnit::adaptUnits | ( | TableExprNodeRep *& | node1, |
TableExprNodeRep *& | node2, | ||
TableExprNodeRep *& | node3 | ||
) | [static] |
Find the unit to be used and adapt the nodes to it.
virtual DComplex casa::TableExprNodeUnit::getDComplex | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casa::TableExprNodeRep.
virtual Double casa::TableExprNodeUnit::getDouble | ( | const TableExprId & | id | ) | [virtual] |
Reimplemented from casa::TableExprNodeRep.
virtual Double casa::TableExprNodeUnit::getUnitFactor | ( | ) | const [virtual] |
Get the unit factor.
Reimplemented from casa::TableExprNodeRep.
static Double casa::TableExprNodeUnit::set | ( | TableExprNodeRep & | parent, |
const TableExprNodeRep & | child, | ||
const Unit & | unit | ||
) | [static] |
Calculate the conversion factor and return it.
It is static to be useful for TableExprNodeArrayFunc as well.
static TableExprNodeRep* casa::TableExprNodeUnit::useUnit | ( | TableExprNodeRep *const | node, |
const Unit & | unit | ||
) | [static] |
Create a new node if unit conversion is needed.
Otherwise return the current node.
Double casa::TableExprNodeUnit::factor_p [private] |
Definition at line 95 of file ExprUnitNode.h.