summaryrefslogtreecommitdiff
path: root/src/compare.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2017-01-04 12:02:15 -0800
committerJohn Wiegley <johnw@newartisans.com>2017-01-04 12:02:15 -0800
commitf27d7776ca8fb29c5a523c859d64f3c570ce8985 (patch)
tree9ae01f8c316bc3a3e6f9709192f17bf388adc89c /src/compare.h
parent0e1c6115b37cc2ddde2d981dfd0e329be626316c (diff)
downloadfork-ledger-f27d7776ca8fb29c5a523c859d64f3c570ce8985.tar.gz
fork-ledger-f27d7776ca8fb29c5a523c859d64f3c570ce8985.tar.bz2
fork-ledger-f27d7776ca8fb29c5a523c859d64f3c570ce8985.zip
Item sorting should have access to the report scope
Diffstat (limited to 'src/compare.h')
-rw-r--r--src/compare.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/compare.h b/src/compare.h
index baee6075..8f9a69f6 100644
--- a/src/compare.h
+++ b/src/compare.h
@@ -48,6 +48,7 @@ namespace ledger {
class post_t;
class account_t;
+class report_t;
void push_sort_value(std::list<sort_value_t>& sort_values,
expr_t::ptr_op_t node, scope_t& scope);
@@ -56,23 +57,24 @@ template <typename T>
class compare_items
{
expr_t sort_order;
+ report_t& report;
compare_items();
public:
- compare_items(const compare_items& other) : sort_order(other.sort_order) {
- TRACE_CTOR(compare_items, "copy");
+ compare_items(const expr_t& _sort_order, report_t& _report) :
+ sort_order(_sort_order), report(_report) {
+ TRACE_CTOR(compare_items, "const value_expr&, report_t&");
}
- compare_items(const expr_t& _sort_order) : sort_order(_sort_order) {
- TRACE_CTOR(compare_items, "const value_expr&");
+ compare_items(const compare_items& other) :
+ sort_order(other.sort_order), report(other.report) {
+ TRACE_CTOR(compare_items, "copy");
}
~compare_items() throw() {
TRACE_DTOR(compare_items);
}
- void find_sort_values(std::list<sort_value_t>& sort_values, scope_t& scope) {
- push_sort_value(sort_values, sort_order.get_op(), scope);
- }
+ void find_sort_values(std::list<sort_value_t>& sort_values, scope_t& scope);
bool operator()(T * left, T * right);
};