diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-05 02:22:17 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-05 02:22:17 -0500 |
commit | 40a430139edd12d9f580f5616571bc3ed8709d73 (patch) | |
tree | 8779adff41b86aaaa4137673823c4d621611bb9d /src/account.h | |
parent | 111881f3cea1266206c7ea6382e44d70ed71f37a (diff) | |
download | fork-ledger-40a430139edd12d9f580f5616571bc3ed8709d73.tar.gz fork-ledger-40a430139edd12d9f580f5616571bc3ed8709d73.tar.bz2 fork-ledger-40a430139edd12d9f580f5616571bc3ed8709d73.zip |
Transactions, etc., are now accessed by iterators
Diffstat (limited to 'src/account.h')
-rw-r--r-- | src/account.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/account.h b/src/account.h index 7d51a08e..3452bba7 100644 --- a/src/account.h +++ b/src/account.h @@ -114,11 +114,31 @@ public: account_t * find_account(const string& name, bool auto_create = true); account_t * find_account_re(const string& regexp); + typedef transform_iterator<function<account_t *(accounts_map::value_type&)>, + accounts_map::iterator> + accounts_map_seconds_iterator; + + accounts_map_seconds_iterator accounts_begin() { + return make_transform_iterator + (accounts.begin(), bind(&accounts_map::value_type::second, _1)); + } + accounts_map_seconds_iterator accounts_end() { + return make_transform_iterator + (accounts.end(), bind(&accounts_map::value_type::second, _1)); + } + void add_post(post_t * post) { posts.push_back(post); } bool remove_post(post_t * post); + posts_list::iterator posts_begin() { + return posts.begin(); + } + posts_list::iterator posts_end() { + return posts.end(); + } + virtual expr_t::ptr_op_t lookup(const symbol_t::kind_t kind, const string& name); |