54class commodity_pool_t;
74 public equality_comparable1<commodity_t, noncopyable>
83#define COMMODITY_STYLE_DEFAULTS 0x000
84#define COMMODITY_STYLE_SUFFIXED 0x001
85#define COMMODITY_STYLE_SEPARATED 0x002
86#define COMMODITY_STYLE_DECIMAL_COMMA 0x004
87#define COMMODITY_STYLE_THOUSANDS 0x008
88#define COMMODITY_NOMARKET 0x010
89#define COMMODITY_BUILTIN 0x020
90#define COMMODITY_WALKED 0x040
91#define COMMODITY_KNOWN 0x080
92#define COMMODITY_PRIMARY 0x100
93#define COMMODITY_SAW_ANNOTATED 0x200
94#define COMMODITY_SAW_ANN_PRICE_FLOAT 0x400
95#define COMMODITY_SAW_ANN_PRICE_FIXATED 0x800
96#define COMMODITY_STYLE_TIME_COLON 0x1000
97#define COMMODITY_STYLE_NO_MIGRATE 0x2000
155 return comm == *
this;
156 return base.get() ==
comm.base.get();
192 return base->graph_index;
213 return base->precision;
220 return base->smaller;
234 return base->value_expr;
237 base->value_expr = expr;
286 comm.print(out,
false,
true);
296 return (
lhs->symbol().compare(
rhs->symbol()) < 0);
#define TRACE_CTOR(cls, args)
#define DECLARE_EXCEPTION(name, kind)
#define COMMODITY_STYLE_DECIMAL_COMMA
#define COMMODITY_STYLE_DEFAULTS
void put_commodity(property_tree::ptree &pt, const commodity_t &comm, bool commodity_details=false)
std::ostream & operator<<(std::ostream &out, const account_t &account)
boost::posix_time::ptime datetime_t
Encapsulate infinite-precision commoditized amounts.
optional< amount_t > price() const
uint_least16_t precision_t
The amount's decimal precision.
bool operator==(const price_point_t &other) const
price_point_t(datetime_t _when, amount_t _price)
optional< price_point_t > check_for_updated_price(const optional< price_point_t > &point, const datetime_t &moment, const commodity_t *in_terms_of)
static bool time_colon_by_default
virtual optional< price_point_t > find_price(const commodity_t *commodity=NULL, const datetime_t &moment=datetime_t(), const datetime_t &oldest=datetime_t()) const
void set_note(const optional< string > &arg=none)
void set_value_expr(const optional< expr_t > &expr=none)
amount_t::precision_t precision() const
shared_ptr< base_t > base
virtual void print(std::ostream &out, bool elide_quotes=false, bool print_annotations=false) const
void remove_price(const datetime_t &date, commodity_t &commodity)
void set_smaller(const optional< amount_t > &arg=none)
virtual optional< expr_t > value_expr() const
commodity_t & nail_down(const expr_t &expr)
optional< string > note() const
virtual commodity_t & referent()
void set_precision(amount_t::precision_t arg)
optional< amount_t > smaller() const
virtual const commodity_t & referent() const
optional< amount_t > larger() const
string base_symbol() const
optional< string > qualified_symbol
bool operator==(const string &name) const
static string parse_symbol(std::istream &in)
void set_larger(const optional< amount_t > &arg=none)
static bool symbol_needs_quotes(const string &symbol)
void set_graph_index(const optional< std::size_t > &arg=none)
commodity_t(commodity_pool_t *_parent, const shared_ptr< base_t > &_base)
static bool decimal_comma_by_default
void add_price(const datetime_t &date, const amount_t &price, const bool reflexive=true)
static void parse_symbol(char *&p, string &symbol)
void set_name(const optional< string > &arg=none)
virtual void write_annotations(std::ostream &, bool) const
commodity_pool_t * parent_
static void parse_symbol(std::istream &in, string &symbol)
optional< std::size_t > graph_index() const
optional< string > name() const
optional< price_point_t > find_price_from_expr(expr_t &expr, const commodity_t *commodity, const datetime_t &moment) const
commodity_pool_t & pool() const
virtual bool operator==(const commodity_t &comm) const
void map_prices(function< void(datetime_t, const amount_t &)> fn, const datetime_t &moment=datetime_t(), const datetime_t &_oldest=datetime_t(), bool bidirectionally=false)
bool has_annotation() const
virtual commodity_t & strip_annotations(const keep_details_t &)
std::map< memoized_price_entry, optional< price_point_t > > memoized_price_map
optional< std::size_t > graph_index
tuple< datetime_t, datetime_t, const commodity_t * > memoized_price_entry
static const std::size_t max_price_map_size
memoized_price_map price_map
base_t(const string &_symbol)
amount_t::precision_t precision
optional< amount_t > larger
optional< expr_t > value_expr
optional< amount_t > smaller
int operator()(const amount_t *left, const amount_t *right) const
bool operator()(const commodity_t *lhs, const commodity_t *rhs) const