From 5db1e1165b05ae56e0348a4634144072dfcace1f Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 6 Aug 2004 21:38:27 -0400 Subject: improvements to transaction formatting --- valexpr.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'valexpr.h') diff --git a/valexpr.h b/valexpr.h index d2521998..aadbb03f 100644 --- a/valexpr.h +++ b/valexpr.h @@ -136,6 +136,25 @@ inline node_t * find_node(node_t * node, node_t::kind_t type) { return result; } +template +class item_predicate +{ + const node_t * predicate; + + public: + item_predicate(const node_t * _predicate) : predicate(_predicate) {} + + bool operator()(const T * item) const { + if (predicate) { + balance_t result; + predicate->compute(result, details_t(item)); + return result; + } else { + return true; + } + } +}; + } // namespace report #endif // _REPORT_H -- cgit v1.2.3