summaryrefslogtreecommitdiff
path: root/quotes.h
blob: 8faa601a7e46b390afb0a133a982328ed4b33318 (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
#ifndef _QUOTES_H
#define _QUOTES_H

#include "amount.h"

namespace ledger {

class quotes_by_script : public commodity_t::updater_t
{
  std::string   price_db;
  unsigned long pricing_leeway;
  bool&         cache_dirty;

 public:
  quotes_by_script(std::string   _price_db,
		   unsigned long _pricing_leeway,
		   bool&         _cache_dirty)
    : price_db(_price_db), pricing_leeway(_pricing_leeway),
      cache_dirty(_cache_dirty) {}

  virtual void operator()(commodity_t *     commodity,
			  const std::time_t date,
			  const amount_t&   price,
			  const std::time_t moment);
};

} // namespace ledger

#endif // _QUOTES_H