From cf35984971341b8a8688eb02a22bcbc1772991d1 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 19 Jul 2011 23:29:41 -0500 Subject: Use Boost iterator_facade to create new iterators --- src/filters.cc | 40 ---------------------------------------- 1 file changed, 40 deletions(-) (limited to 'src/filters.cc') diff --git a/src/filters.cc b/src/filters.cc index 27227ee9..b7e96366 100644 --- a/src/filters.cc +++ b/src/filters.cc @@ -83,25 +83,6 @@ void post_splitter::operator()(post_t& post) } } -pass_down_posts::pass_down_posts(post_handler_ptr handler, - posts_iterator& iter) - : item_handler(handler) -{ - TRACE_CTOR(pass_down_posts, "post_handler_ptr, posts_iterator"); - - for (post_t * post = iter(); post; post = iter()) { - try { - item_handler::operator()(*post); - } - catch (const std::exception&) { - add_error_context(item_context(*post, _("While handling posting"))); - throw; - } - } - - item_handler::flush(); -} - void truncate_xacts::flush() { if (! posts.size()) @@ -1419,25 +1400,4 @@ void inject_posts::operator()(post_t& post) item_handler::operator()(post); } -pass_down_accounts::pass_down_accounts(acct_handler_ptr handler, - accounts_iterator& iter, - const optional& _pred, - const optional& _context) - : item_handler(handler), pred(_pred), context(_context) -{ - TRACE_CTOR(pass_down_accounts, "acct_handler_ptr, accounts_iterator, ..."); - - for (account_t * account = iter(); account; account = iter()) { - if (! pred) { - item_handler::operator()(*account); - } else { - bind_scope_t bound_scope(*context, *account); - if ((*pred)(bound_scope)) - item_handler::operator()(*account); - } - } - - item_handler::flush(); -} - } // namespace ledger -- cgit v1.2.3