summaryrefslogtreecommitdiff
path: root/src/quotes.h
blob: 5f39f041e61606fcdaec3b5d48cc3d7f7a7db178 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef _QUOTES_H
#define _QUOTES_H

#include "amount.h"

namespace ledger {

class quotes_by_script
{
  path		price_db;
  time_duration pricing_leeway;
  bool&         cache_dirty;

 public:
  quotes_by_script(path		 _price_db,
		   time_duration _pricing_leeway,
		   bool&         _cache_dirty)
    : price_db(_price_db), pricing_leeway(_pricing_leeway),
      cache_dirty(_cache_dirty) {}

  virtual optional<amount_t>
    operator()(commodity_t&		 commodity,
	       const optional<moment_t>& date,
	       const optional<moment_t>& moment,
	       const optional<moment_t>& last);
};

DECLARE_EXCEPTION(download_error);

} // namespace ledger

#endif // _QUOTES_H