52using namespace boost::placeholders;
132 std::vector<post_t *>::iterator
begin() {
133 return posts.begin();
135 std::vector<post_t *>::iterator
end() {
150template <
typename Iterator>
162 catch (
const std::exception&) {
205 std::size_t xacts_seen;
215 completed(
false), xacts_seen(0), last_xact(
NULL) {
237 typedef std::deque<post_t *> posts_deque;
268 posts.push_back(&
post);
291 "post_handler_ptr, const value_expr&, report_t&");
297 "post_handler_ptr, const string&, report_t&");
309 if (last_xact &&
post.xact != last_xact)
314 last_xact =
post.xact;
359 typedef std::map<commodity_t *, std::size_t> commodity_index_map;
363 commodity_index_map comms;
364 std::size_t next_comm_id;
368 int_generator_t integer_gen;
376 integer_range(1, 2000000000L),
377 integer_gen(rnd_gen, integer_range) {
402 bool calc_running_total;
431 typedef std::map<account_t *,value_t> totals_map;
443 bool only_collapse_if_zero;
444 unsigned short collapse_depth;
445 std::list<post_t *> component_posts;
500 component_posts.clear();
527 posts.push_back(&
post);
542 expr_t& display_amount_expr;
543 expr_t& display_total_expr;
576 last_display_total =
value_t();
592 expr_t& display_total_expr;
593 bool changed_values_only;
594 bool historical_prices_only;
595 bool for_accounts_report;
596 bool show_unrealized;
700 "post_handler_ptr, expr_t&, const optional<string>&");
733 bool generate_empty_posts;
734 bool align_intervals;
736 std::deque<post_t *> all_posts;
754 "post_handler_ptr, expr_t&, date_interval_t, bool, bool");
769 DEBUG(
"filters.interval",
"start = " << *
ival.start);
771 DEBUG(
"filters.interval",
"no start");
774 DEBUG(
"filters.interval",
"finish = " << *
ival.finish);
776 DEBUG(
"filters.interval",
"no finish");
784 interval = start_interval;
814 balance_account = equity_account->
find_account(
_(
"Opening Balances"));
833 typedef std::map<string, shared_ptr<subtotal_posts> > payee_subtotals_map;
834 typedef std::pair<string, shared_ptr<subtotal_posts> > payee_subtotals_pair;
837 payee_subtotals_map payee_subtotals;
855 payee_subtotals.clear();
885 "post_handler_ptr, element_t, account_t *, expr_t, scope_t&");
919 days_of_the_week[
post.date().day_of_week()].push_back(&
post);
923 for (
int i = 0;
i < 7;
i++)
924 days_of_the_week[
i].
clear();
966#define BUDGET_NO_BUDGET 0x00
967#define BUDGET_BUDGETED 0x01
968#define BUDGET_UNBUDGETED 0x02
969#define BUDGET_WRAP_VALUES 0x04
997 const std::size_t forecast_years;
1007 "post_handler_ptr, predicate_t, scope_t&, std::size_t");
1024 typedef std::set<xact_t *> tag_injected_set;
1025 typedef std::pair<account_t *, tag_injected_set> tag_mapping_pair;
1026 typedef std::pair<string, tag_mapping_pair> tags_list_pair;
1028 std::list<tags_list_pair> tags_list;
1048template <
typename Iterator>
1083 pred->mark_uncompiled();
#define TRACE_CTOR(cls, args)
#define add_error_context(msg)
#define POST_EXT_RECEIVED
string item_context(const item_t &item, const string &desc)
boost::gregorian::date date_t
shared_ptr< item_handler< post_t > > post_handler_ptr
std::list< post_t * > posts_list
shared_ptr< item_handler< account_t > > acct_handler_ptr
std::list< period_xact_t * > period_xacts_list
account_t * find_account(const string &name, bool auto_create=true)
Encapsulate infinite-precision commoditized amounts.
virtual void operator()(T &item)
shared_ptr< item_handler > handler
virtual void mark_uncompiled()
virtual void print_title(const value_t &val)
void set_preflush_func(custom_flusher_t functor)
post_splitter(post_handler_ptr _post_chain, report_t &_report, expr_t &_group_by_expr)
value_to_posts_map posts_map
void set_postflush_func(custom_flusher_t functor)
post_handler_ptr post_chain
virtual void operator()(post_t &post)
function< void(const value_t &) custom_flusher_t)
std::map< value_t, posts_list > value_to_posts_map
optional< custom_flusher_t > postflush_func
custom_flusher_t preflush_func
virtual void operator()(post_t &)
std::vector< post_t * >::iterator begin()
virtual void operator()(post_t &post)
std::vector< post_t * > posts
std::vector< post_t * >::iterator end()
std::size_t length() const
virtual ~pass_down_posts()
pass_down_posts(post_handler_ptr handler, Iterator &iter)
push_to_posts_list(posts_list &_posts)
virtual void operator()(post_t &post)
virtual ~push_to_posts_list()
virtual void operator()(post_t &post)
virtual ~truncate_xacts()
truncate_xacts(post_handler_ptr handler, int _head_count, int _tail_count)
virtual void post_accumulated_posts()
sort_posts(post_handler_ptr handler, const string &_sort_order, report_t &_report)
sort_posts(post_handler_ptr handler, const expr_t &_sort_order, report_t &_report)
virtual void operator()(post_t &post)
sort_xacts(post_handler_ptr handler, const string &_sort_order, report_t &_report)
virtual void operator()(post_t &post)
sort_xacts(post_handler_ptr handler, const expr_t &_sort_order, report_t &_report)
filter_posts(post_handler_ptr handler, const predicate_t &predicate, scope_t &_context)
virtual void operator()(post_t &post)
virtual ~anonymize_posts()
virtual void operator()(post_t &post)
void render_commodity(amount_t &amt)
anonymize_posts(post_handler_ptr handler)
calc_posts(post_handler_ptr handler, expr_t &_amount_expr, bool _calc_running_total=false)
virtual void operator()(post_t &post)
value_t & find_totals(account_t *account)
collapse_posts(post_handler_ptr handler, report_t &_report, expr_t &_amount_expr, predicate_t _display_predicate, predicate_t _only_predicate, bool _only_collapse_if_zero=false, unsigned short _collapse_depth=0)
virtual ~collapse_posts()
virtual void operator()(post_t &post)
related_posts(post_handler_ptr handler, const bool _also_matching=false)
virtual void operator()(post_t &post)
virtual ~display_filter_posts()
bool output_rounding(post_t &post)
virtual void operator()(post_t &post)
display_filter_posts(post_handler_ptr handler, report_t &_report, bool _show_rounding)
account_t * revalued_account
virtual ~changed_value_posts()
virtual void operator()(post_t &post)
changed_value_posts(post_handler_ptr handler, report_t &_report, bool _for_accounts_report, bool _show_unrealized, display_filter_posts *_display_filter)
void output_intermediate_prices(post_t &post, const date_t ¤t)
void output_revaluation(post_t &post, const date_t ¤t)
std::pair< string, acct_value_t > values_pair
std::map< string, acct_value_t > values_map
subtotal_posts(post_handler_ptr handler, expr_t &_amount_expr, const optional< string > &_date_format=none)
void report_subtotal(const char *spec_fmt=NULL, const optional< date_interval_t > &interval=none)
optional< string > date_format
virtual void operator()(post_t &post)
virtual ~subtotal_posts()
std::deque< post_t * > component_posts
acct_value_t(const acct_value_t &av)
acct_value_t(account_t *a, bool _is_virtual=false, bool _must_balance=false)
acct_value_t(account_t *a, value_t &v, bool _is_virtual=false, bool _must_balance=false)
virtual ~interval_posts()
void report_subtotal(const date_interval_t &ival)
virtual void operator()(post_t &post)
interval_posts(post_handler_ptr _handler, expr_t &amount_expr, const date_interval_t &_interval, bool _exact_periods=false, bool _generate_empty_posts=false, bool _align_intervals=false)
virtual ~posts_as_equity()
posts_as_equity(post_handler_ptr _handler, report_t &_report, expr_t &amount_expr, bool _unround)
virtual void operator()(post_t &post)
virtual ~by_payee_posts()
by_payee_posts(post_handler_ptr handler, expr_t &_amount_expr)
transfer_details(post_handler_ptr handler, element_t _which_element, account_t *_master, const expr_t &_expr, scope_t &_scope)
virtual ~transfer_details()
virtual void operator()(post_t &post)
enum ledger::transfer_details::element_t which_element
virtual ~day_of_week_posts()
virtual void operator()(post_t &post)
day_of_week_posts(post_handler_ptr handler, expr_t &amount_expr)
virtual ~generate_posts()
generate_posts(post_handler_ptr handler)
std::pair< date_interval_t, post_t * > pending_posts_pair
pending_posts_list pending_posts
virtual void add_post(const date_interval_t &period, post_t &post)
void add_period_xacts(period_xacts_list &period_xacts)
std::list< pending_posts_pair > pending_posts_list
void report_budget_items(const date_t &date)
virtual void operator()(post_t &post)
budget_posts(post_handler_ptr handler, date_t _terminus, uint_least8_t _flags=0x01)
virtual void add_post(const date_interval_t &period, post_t &post)
virtual ~forecast_posts()
forecast_posts(post_handler_ptr handler, const predicate_t &predicate, scope_t &_context, const std::size_t _forecast_years)
inject_posts(post_handler_ptr handler, const string &tag_list, account_t *master)
virtual void operator()(post_t &post)
pass_down_accounts(acct_handler_ptr handler, Iterator &iter, const optional< predicate_t > &_pred=none, const optional< scope_t & > &_context=none)
virtual ~pass_down_accounts()
account_t & create_account(const string &name="", account_t *parent=NULL)
Dynamic type representing various numeric types.