diff options
author | John Wiegley <johnw@newartisans.com> | 2012-03-11 03:55:25 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-03-11 03:55:25 -0500 |
commit | 363670d35bf451ff8ce636c071da73a0d93c514a (patch) | |
tree | 153899e85596849bcbe96c820d5d55bbc61f1d8b /src/commodity.h | |
parent | 2303aa993cf41ad5bde8f8f5722bd265c11e3aa7 (diff) | |
download | fork-ledger-363670d35bf451ff8ce636c071da73a0d93c514a.tar.gz fork-ledger-363670d35bf451ff8ce636c071da73a0d93c514a.tar.bz2 fork-ledger-363670d35bf451ff8ce636c071da73a0d93c514a.zip |
Tighten up argument passing related to fn_market()
Diffstat (limited to 'src/commodity.h')
-rw-r--r-- | src/commodity.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/commodity.h b/src/commodity.h index 1358966e..bd1aedb9 100644 --- a/src/commodity.h +++ b/src/commodity.h @@ -117,12 +117,12 @@ protected: optional<amount_t> larger; optional<expr_t> value_expr; - typedef tuple<optional<datetime_t>, - optional<datetime_t>, commodity_t *> memoized_price_entry; + typedef tuple<datetime_t, datetime_t, + const commodity_t *> memoized_price_entry; typedef std::map<memoized_price_entry, optional<price_point_t> > memoized_price_map; - static const std::size_t max_price_map_size = 16; + static const std::size_t max_price_map_size = 8; mutable memoized_price_map price_map; public: @@ -272,22 +272,22 @@ public: void remove_price(const datetime_t& date, commodity_t& commodity); void map_prices(function<void(datetime_t, const amount_t&)> fn, - const optional<datetime_t>& moment = none, - const optional<datetime_t>& _oldest = none); + const datetime_t& moment = datetime_t(), + const datetime_t& _oldest = datetime_t()); optional<price_point_t> - find_price_from_expr(expr_t& expr, const optional<commodity_t&>& commodity, + find_price_from_expr(expr_t& expr, const commodity_t * commodity, const datetime_t& moment) const; optional<price_point_t> - virtual find_price(const optional<commodity_t&>& commodity = none, - const optional<datetime_t>& moment = none, - const optional<datetime_t>& oldest = none) const; + virtual find_price(const commodity_t * commodity = NULL, + const datetime_t& moment = datetime_t(), + const datetime_t& oldest = datetime_t()) const; optional<price_point_t> check_for_updated_price(const optional<price_point_t>& point, - const optional<datetime_t>& moment, - const optional<commodity_t&>& in_terms_of); + const datetime_t& moment, + const commodity_t * in_terms_of); commodity_t& nail_down(const expr_t& expr); |