diff options
author | John Wiegley <johnw@newartisans.com> | 2005-02-09 21:06:12 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 02:40:56 -0400 |
commit | 003464dccc70e34a9486ca1aff0d536c15cf0a90 (patch) | |
tree | 98195defbbba1267b7f7a80dd4c258fcde837940 | |
parent | bffa2703fce098b13e67b55d584af82fb191b135 (diff) | |
download | fork-ledger-003464dccc70e34a9486ca1aff0d536c15cf0a90.tar.gz fork-ledger-003464dccc70e34a9486ca1aff0d536c15cf0a90.tar.bz2 fork-ledger-003464dccc70e34a9486ca1aff0d536c15cf0a90.zip |
(push_to_transactions_list): Added a new transaction handler, which
simply adds the received transactions to a transctions_list container.
-rw-r--r-- | walk.h | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -154,6 +154,20 @@ class set_account_value : public item_handler<transaction_t> virtual void operator()(transaction_t& xact); }; +class push_to_transactions_list : public item_handler<transaction_t> +{ + public: + transactions_list& xact_list; + + push_to_transactions_list(transactions_list& _xact_list, + item_handler<transaction_t> * handler = NULL) + : item_handler<transaction_t>(handler), xact_list(_xact_list) {} + + virtual void operator()(transaction_t& xact) { + xact_list.push_back(&xact); + } +}; + class sort_transactions : public item_handler<transaction_t> { typedef std::deque<transaction_t *> transactions_deque; |