diff options
author | John Wiegley <johnw@newartisans.com> | 2004-08-29 23:32:29 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-08-29 23:32:29 -0400 |
commit | 63367e3aac062a7b55a3ba5c36a6c7fffbb6e2cc (patch) | |
tree | 6af161c7d0a7ca78a26f8b1f1f57426acddf9be9 /valexpr.h | |
parent | 2d62f7b633bdaa39c650bb67425514cf1e66a4dd (diff) | |
download | fork-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.h | 25 |
1 files changed, 7 insertions, 18 deletions
@@ -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)); |