summaryrefslogtreecommitdiff
path: root/valexpr.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-07-26 05:06:06 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-07-26 05:06:06 -0400
commit162d982b0cf1a5ac2e67012a3b8eadae3c1ac59f (patch)
tree1d29680db03ab4f8a82f77630a6e1a9fc10571bb /valexpr.h
parent961b30926b3b9f2b3e9c1a99df3f25fea6b13118 (diff)
downloadfork-ledger-162d982b0cf1a5ac2e67012a3b8eadae3c1ac59f.tar.gz
fork-ledger-162d982b0cf1a5ac2e67012a3b8eadae3c1ac59f.tar.bz2
fork-ledger-162d982b0cf1a5ac2e67012a3b8eadae3c1ac59f.zip
The --verify option is now working properly again. Use "--verify --verbose"
if you wish to see memory usage statistics along with a top-level trace.
Diffstat (limited to 'valexpr.h')
-rw-r--r--valexpr.h28
1 files changed, 17 insertions, 11 deletions
diff --git a/valexpr.h b/valexpr.h
index 7a5eb417..6ff74186 100644
--- a/valexpr.h
+++ b/valexpr.h
@@ -825,6 +825,8 @@ inline ptr_op_t op_t::wrap_functor(const function_t& fobj) {
return temp;
}
+class parser_t;
+
} // namespace expr
//////////////////////////////////////////////////////////////////////
@@ -902,33 +904,37 @@ public:
const expr::ptr_op_t node_to_find,
unsigned long * start_pos,
unsigned long * end_pos);
+
+ static std::auto_ptr<value_expr> amount_expr;
+ static std::auto_ptr<value_expr> total_expr;
+ static std::auto_ptr<expr::parser_t> parser;
+
+ static void initialize();
+ static void shutdown();
};
typedef value_expr::details_t details_t; // jww (2008-07-20): remove
-extern value_expr amount_expr;
-extern value_expr total_expr;
-
inline void compute_amount(value_t& result,
const details_t& details = details_t()) {
- if (amount_expr)
- amount_expr->compute(result, details);
+ if (value_expr::amount_expr.get())
+ value_expr::amount_expr->compute(result, details);
}
inline value_t compute_amount(const details_t& details = details_t()) {
- if (amount_expr)
- return amount_expr->compute(details);
+ if (value_expr::amount_expr.get())
+ return value_expr::amount_expr->compute(details);
}
inline void compute_total(value_t& result,
const details_t& details = details_t()) {
- if (total_expr)
- total_expr->compute(result, details);
+ if (value_expr::total_expr.get())
+ value_expr::total_expr->compute(result, details);
}
inline value_t compute_total(const details_t& details = details_t()) {
- if (total_expr)
- return total_expr->compute(details);
+ if (value_expr::total_expr.get())
+ return value_expr::total_expr->compute(details);
}
//////////////////////////////////////////////////////////////////////