[casacore] r21576 committed - Fixed comments and little UDF bug

0 views
Skip to first unread message

casa...@googlecode.com

unread,
Mar 18, 2015, 5:03:55 AM3/18/15
to casacor...@googlegroups.com
Revision: 21576
Author: gervandiepen
Date: Wed Mar 18 09:03:37 2015 UTC
Log: Fixed comments and little UDF bug
https://code.google.com/p/casacore/source/detail?r=21576

Modified:
/branches/nov14/tables/TaQL/ExprGroup.cc
/branches/nov14/tables/TaQL/ExprUDFNode.h
/branches/nov14/tables/TaQL/UDFBase.h

=======================================
--- /branches/nov14/tables/TaQL/ExprGroup.cc Wed Dec 10 08:06:42 2014 UTC
+++ /branches/nov14/tables/TaQL/ExprGroup.cc Wed Mar 18 09:03:37 2015 UTC
@@ -30,6 +30,7 @@
#include <casacore/tables/TaQL/ExprNode.h>
#include <casacore/tables/TaQL/ExprAggrNode.h>
#include <casacore/tables/TaQL/ExprAggrNodeArray.h>
+#include <casacore/tables/TaQL/ExprUDFNode.h>
#include <casacore/tables/Tables/TableError.h>
#include <casacore/casa/Utilities/Sort.h>
#include <limits>
@@ -162,8 +163,9 @@


TableExprGroupFuncBase::TableExprGroupFuncBase (TableExprNodeRep* node)
- : itsNode (node),
- itsSeqnr (0)
+ : itsNode (node),
+ itsOperand (0),
+ itsSeqnr (0)
{
if (node) {
TableExprAggrNode* snode = dynamic_cast<TableExprAggrNode*>(node);
@@ -171,8 +173,12 @@
itsOperand = snode->operand();
} else {
TableExprAggrNodeArray* anode =
dynamic_cast<TableExprAggrNodeArray*>(node);
- AlwaysAssert (anode, AipsError);
- itsOperand = anode->operand();
+ if (anode) {
+ itsOperand = anode->operand();
+ } else {
+ TableExprUDFNode* unode = dynamic_cast<TableExprUDFNode*>(node);
+ AlwaysAssert (unode && unode->isAggregate(), AipsError);
+ }
}
}
}
=======================================
--- /branches/nov14/tables/TaQL/ExprUDFNode.h Wed Jan 7 09:08:57 2015 UTC
+++ /branches/nov14/tables/TaQL/ExprUDFNode.h Wed Mar 18 09:03:37 2015 UTC
@@ -82,6 +82,10 @@

// Destructor
virtual ~TableExprUDFNode();
+
+ // Is the UDF an aggregate function?
+ Bool isAggregate() const
+ { return itsUDF->isAggregate(); }

// Get the nodes representing an aggregate function.
virtual void getAggrNodes (vector<TableExprNodeRep*>& aggr);
@@ -89,7 +93,8 @@
// Get the nodes representing a table column.
virtual void getColumnNodes (vector<TableExprNodeRep*>& cols);

- // UDFs do not need a TableExprGroupFuncBase, so null is returned.
+ // UDFs do not need a TableExprGroupFuncBase,
+ // so TableExprGroupNull is returned.
CountedPtr<TableExprGroupFuncBase> makeGroupAggrFunc();

// Functions to get the desired result of a function
=======================================
--- /branches/nov14/tables/TaQL/UDFBase.h Wed Feb 18 14:42:54 2015 UTC
+++ /branches/nov14/tables/TaQL/UDFBase.h Wed Mar 18 09:03:37 2015 UTC
@@ -124,7 +124,7 @@
// objects in an aggregation group can be retrieved.
// <srcblock>
// const TableExprIdAggr& aid = TableExprIdAggr::cast (id);
- // const vector<TableExprId>& ids =
aid.result().ids(id.groupnr());
+ // const vector<TableExprId>& ids = aid.result().ids(id.rownr());
// </srcblock>
// </td>
// </tr>
Reply all
Reply to author
Forward
0 new messages