summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2005-02-09 21:06:12 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:40:56 -0400
commit003464dccc70e34a9486ca1aff0d536c15cf0a90 (patch)
tree98195defbbba1267b7f7a80dd4c258fcde837940
parentbffa2703fce098b13e67b55d584af82fb191b135 (diff)
downloadfork-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.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/walk.h b/walk.h
index dbc286ce..871a9639 100644
--- a/walk.h
+++ b/walk.h
@@ -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;