summaryrefslogtreecommitdiff
path: root/valexpr.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-29 23:32:29 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-29 23:32:29 -0400
commit63367e3aac062a7b55a3ba5c36a6c7fffbb6e2cc (patch)
tree6af161c7d0a7ca78a26f8b1f1f57426acddf9be9 /valexpr.h
parent2d62f7b633bdaa39c650bb67425514cf1e66a4dd (diff)
downloadfork-ledger-63367e3aac062a7b55a3ba5c36a6c7fffbb6e2cc.tar.gz
fork-ledger-63367e3aac062a7b55a3ba5c36a6c7fffbb6e2cc.tar.bz2
fork-ledger-63367e3aac062a7b55a3ba5c36a6c7fffbb6e2cc.zip
the amount/balance/value logic is now a library, completely separate from ledger
Diffstat (limited to 'valexpr.h')
-rw-r--r--valexpr.h25
1 files changed, 7 insertions, 18 deletions
diff --git a/valexpr.h b/valexpr.h
index f841cf95..91de7ed7 100644
--- a/valexpr.h
+++ b/valexpr.h
@@ -29,23 +29,12 @@ struct details_t
const transaction_t * xact;
const account_t * account;
- details_t(const entry_t * _entry)
- : entry(_entry), xact(NULL), account(NULL) {
- DEBUG_PRINT("ledger.memory.ctors", "ctor details_t");
- }
- details_t(const transaction_t * _xact)
- : entry(_xact->entry), xact(_xact), account(_xact->account) {
- DEBUG_PRINT("ledger.memory.ctors", "ctor details_t");
- }
- details_t(const account_t * _account)
- : entry(NULL), xact(NULL), account(_account) {
- DEBUG_PRINT("ledger.memory.ctors", "ctor details_t");
- }
-#ifdef DEBUG_ENABLED
- ~details_t() {
- DEBUG_PRINT("ledger.memory.dtors", "dtor details_t");
- }
-#endif
+ details_t(const entry_t& _entry)
+ : entry(&_entry), xact(NULL), account(NULL) {}
+ details_t(const transaction_t& _xact)
+ : entry(_xact.entry), xact(&_xact), account(_xact.account) {}
+ details_t(const account_t& _account)
+ : entry(NULL), xact(NULL), account(&_account) {}
};
struct value_expr_t
@@ -190,7 +179,7 @@ class item_predicate
delete predicate;
}
- bool operator()(const T * item) const {
+ bool operator()(const T& item) const {
if (predicate) {
value_t result;
predicate->compute(result, details_t(item));