#include <commodity.h>
Classes | |
class | base_t |
struct | compare_by_commodity |
Public Types | |
typedef uint_least16_t | flags_t |
Public Member Functions | |
void | add_flags (const flags_t arg) |
void | add_price (const datetime_t &date, const amount_t &price, const bool reflexive=true) |
string | base_symbol () const |
optional< price_point_t > | check_for_updated_price (const optional< price_point_t > &point, const datetime_t &moment, const commodity_t *in_terms_of) |
void | clear_flags () |
void | drop_flags (const flags_t arg) |
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 |
optional< price_point_t > | find_price_from_expr (expr_t &expr, const commodity_t *commodity, const datetime_t &moment) const |
flags_t | flags () const |
optional< std::size_t > | graph_index () const |
bool | has_annotation () const |
bool | has_flags (const flags_t arg) const |
optional< amount_t > | larger () 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) |
commodity_t & | nail_down (const expr_t &expr) |
optional< string > | name () const |
optional< string > | note () const |
operator bool () const | |
virtual bool | operator== (const commodity_t &comm) const |
bool | operator== (const string &name) const |
commodity_pool_t & | pool () const |
amount_t::precision_t | precision () const |
virtual void | print (std::ostream &out, bool elide_quotes=false, bool print_annotations=false) const |
virtual commodity_t & | referent () |
virtual const commodity_t & | referent () const |
void | remove_price (const datetime_t &date, commodity_t &commodity) |
void | set_flags (const flags_t arg) |
void | set_graph_index (const optional< std::size_t > &arg=none) |
void | set_larger (const optional< amount_t > &arg=none) |
void | set_name (const optional< string > &arg=none) |
void | set_note (const optional< string > &arg=none) |
void | set_precision (amount_t::precision_t arg) |
void | set_smaller (const optional< amount_t > &arg=none) |
void | set_value_expr (const optional< expr_t > &expr=none) |
optional< amount_t > | smaller () const |
virtual commodity_t & | strip_annotations (const keep_details_t &) |
string | symbol () const |
bool | valid () const |
virtual optional< expr_t > | value_expr () const |
virtual void | write_annotations (std::ostream &, bool) const |
virtual | ~commodity_t () |
Static Public Member Functions | |
static void | parse_symbol (char *&p, string &symbol) |
static string | parse_symbol (std::istream &in) |
static void | parse_symbol (std::istream &in, string &symbol) |
static bool | symbol_needs_quotes (const string &symbol) |
Static Public Attributes | |
static bool | decimal_comma_by_default |
static bool | time_colon_by_default |
Protected Member Functions | |
commodity_t (commodity_pool_t *_parent, const shared_ptr< base_t > &_base) |
Protected Attributes | |
supports_flags< uint_least16_t > & | _flags |
bool | annotated |
shared_ptr< base_t > | base |
commodity_pool_t * | parent_ |
optional< string > | qualified_symbol |
Friends | |
class | annotated_commodity_t |
class | commodity_pool_t |
Definition at line 72 of file commodity.h.
|
inherited |
|
inlineexplicitprotected |
Definition at line 136 of file commodity.h.
References annotated, base, commodity_pool_t, commodity_t(), ledger::flags::delegates_flags< uint_least16_t >::delegates_flags(), parent_, and TRACE_CTOR.
Referenced by ledger::annotated_commodity_t::annotated_commodity_t(), ledger::commodity_t::base_t::base_t(), check_for_updated_price(), commodity_t(), ledger::annotated_commodity_t::find_price(), find_price(), find_price_from_expr(), nail_down(), ledger::annotated_commodity_t::operator==(), ledger::annotated_commodity_t::operator==(), operator==(), ledger::annotated_commodity_t::referent(), ledger::annotated_commodity_t::referent(), referent(), referent(), remove_price(), ledger::annotated_commodity_t::strip_annotations(), strip_annotations(), and ~commodity_t().
|
inlinevirtual |
Definition at line 147 of file commodity.h.
References commodity_t(), and TRACE_DTOR.
|
inlineinherited |
void ledger::commodity_t::add_price | ( | const datetime_t & | date, |
const amount_t & | price, | ||
const bool | reflexive = true ) |
|
inline |
Definition at line 184 of file commodity.h.
References base.
Referenced by operator==(), and symbol().
optional< price_point_t > ledger::commodity_t::check_for_updated_price | ( | const optional< price_point_t > & | point, |
const datetime_t & | moment, | ||
const commodity_t * | in_terms_of ) |
|
inlineinherited |
|
inlineinherited |
|
virtual |
Reimplemented in ledger::annotated_commodity_t.
References commodity_t().
optional< price_point_t > ledger::commodity_t::find_price_from_expr | ( | expr_t & | expr, |
const commodity_t * | commodity, | ||
const datetime_t & | moment ) const |
|
inlineinherited |
|
inline |
Definition at line 191 of file commodity.h.
References base.
|
inline |
Definition at line 171 of file commodity.h.
References annotated.
|
inlineinherited |
|
inline |
Definition at line 226 of file commodity.h.
References base.
void ledger::commodity_t::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 ) |
commodity_t & ledger::commodity_t::nail_down | ( | const expr_t & | expr | ) |
|
inline |
Definition at line 198 of file commodity.h.
References base.
Referenced by operator==().
|
inline |
Definition at line 205 of file commodity.h.
References base.
ledger::commodity_t::operator bool | ( | ) | const |
|
inlinevirtual |
Reimplemented in ledger::annotated_commodity_t.
Definition at line 153 of file commodity.h.
References annotated, base, and commodity_t().
|
inline |
Definition at line 158 of file commodity.h.
References base_symbol(), and name().
|
static |
|
inlinestatic |
Definition at line 270 of file commodity.h.
References parse_symbol().
|
static |
References symbol().
Referenced by parse_symbol().
|
inline |
Definition at line 180 of file commodity.h.
References commodity_pool_t, and parent_.
|
inline |
Definition at line 212 of file commodity.h.
References base.
|
virtual |
Reimplemented in ledger::annotated_commodity_t.
Referenced by ledger::operator<<(), and ledger::annotated_commodity_t::print().
|
inlinevirtual |
Reimplemented in ledger::annotated_commodity_t.
Definition at line 164 of file commodity.h.
References commodity_t().
|
inlinevirtual |
Reimplemented in ledger::annotated_commodity_t.
Definition at line 167 of file commodity.h.
References commodity_t().
void ledger::commodity_t::remove_price | ( | const datetime_t & | date, |
commodity_t & | commodity ) |
|
inlineinherited |
|
inline |
Definition at line 194 of file commodity.h.
References base.
|
inline |
Definition at line 229 of file commodity.h.
References base.
|
inline |
Definition at line 201 of file commodity.h.
References base.
|
inline |
Definition at line 208 of file commodity.h.
References base.
|
inline |
Definition at line 215 of file commodity.h.
References base.
|
inline |
Definition at line 222 of file commodity.h.
References base.
|
inline |
Definition at line 236 of file commodity.h.
References base.
|
inline |
Definition at line 219 of file commodity.h.
References base.
|
inlinevirtual |
Reimplemented in ledger::annotated_commodity_t.
Definition at line 175 of file commodity.h.
References commodity_t().
|
inline |
Definition at line 187 of file commodity.h.
References base_symbol(), and qualified_symbol.
Referenced by ledger::commodity_compare::operator()(), parse_symbol(), parse_symbol(), and symbol_needs_quotes().
|
static |
bool ledger::commodity_t::valid | ( | ) | const |
|
inlinevirtual |
Reimplemented in ledger::annotated_commodity_t.
Definition at line 233 of file commodity.h.
References base.
Referenced by ledger::annotated_commodity_t::value_expr().
|
inlinevirtual |
Reimplemented in ledger::annotated_commodity_t.
Definition at line 178 of file commodity.h.
|
friend |
Definition at line 78 of file commodity.h.
References annotated_commodity_t.
Referenced by annotated_commodity_t.
|
friend |
Definition at line 77 of file commodity.h.
References commodity_pool_t.
Referenced by commodity_pool_t, commodity_t(), and pool().
|
protectedinherited |
|
protected |
Definition at line 134 of file commodity.h.
Referenced by ledger::annotated_commodity_t::annotated_commodity_t(), commodity_t(), has_annotation(), and operator==().
|
protected |
Definition at line 130 of file commodity.h.
Referenced by ledger::annotated_commodity_t::annotated_commodity_t(), base_symbol(), commodity_t(), graph_index(), larger(), name(), note(), operator==(), precision(), set_graph_index(), set_larger(), set_name(), set_note(), set_precision(), set_smaller(), set_value_expr(), smaller(), and value_expr().
|
static |
Definition at line 144 of file commodity.h.
Referenced by ledger::commodity_t::base_t::base_t().
|
protected |
Definition at line 132 of file commodity.h.
Referenced by ledger::annotated_commodity_t::annotated_commodity_t(), commodity_t(), and pool().
|
protected |
Definition at line 133 of file commodity.h.
Referenced by ledger::annotated_commodity_t::annotated_commodity_t(), and symbol().
|
static |
Definition at line 145 of file commodity.h.