Loading...
Searching...
No Matches
ledger::annotated_commodity_t Class Reference

#include <annotate.h>

+ Inheritance diagram for ledger::annotated_commodity_t:
+ Collaboration diagram for ledger::annotated_commodity_t:

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_tcheck_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_tfind_price (const commodity_t *commodity=NULL, const datetime_t &moment=datetime_t(), const datetime_t &oldest=datetime_t()) const
 
optional< price_point_tfind_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_tlarger () 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_tnail_down (const expr_t &expr)
 
optional< stringname () const
 
optional< stringnote () const
 
 operator bool () const
 
virtual bool operator== (const annotated_commodity_t &comm) const
 
virtual bool operator== (const commodity_t &comm) const
 
bool operator== (const string &name) const
 
commodity_pool_tpool () const
 
amount_t::precision_t precision () const
 
virtual void print (std::ostream &out, bool elide_quotes=false, bool print_annotations=false) const
 
virtual commodity_treferent ()
 
virtual const commodity_treferent () 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_tsmaller () const
 
virtual commodity_tstrip_annotations (const keep_details_t &what_to_keep)
 
string symbol () const
 
bool valid () const
 
virtual optional< expr_tvalue_expr () const
 
virtual void write_annotations (std::ostream &out, bool no_computed_annotations=false) const
 
virtual ~annotated_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)
 

Public Attributes

annotation_t details
 

Static Public Attributes

static bool decimal_comma_by_default
 
static bool time_colon_by_default
 

Protected Member Functions

 annotated_commodity_t (commodity_t *_ptr, const annotation_t &_details)
 

Protected Attributes

supports_flags< uint_least16_t > & _flags
 
bool annotated
 
shared_ptr< base_tbase
 
commodity_pool_tparent_
 
commodity_tptr
 
optional< stringqualified_symbol
 

Friends

class commodity_pool_t
 

Detailed Description

Definition at line 157 of file annotate.h.

Member Typedef Documentation

◆ flags_t

Definition at line 150 of file flags.h.

Constructor & Destructor Documentation

◆ annotated_commodity_t()

ledger::annotated_commodity_t::annotated_commodity_t ( commodity_t * _ptr,
const annotation_t & _details )
inlineexplicitprotected

◆ ~annotated_commodity_t()

virtual ledger::annotated_commodity_t::~annotated_commodity_t ( )
inlinevirtual

Definition at line 179 of file annotate.h.

References TRACE_DTOR.

Member Function Documentation

◆ add_flags()

void ledger::flags::delegates_flags< uint_least16_t >::add_flags ( const flags_t arg)
inlineinherited

Definition at line 179 of file flags.h.

◆ add_price()

void ledger::commodity_t::add_price ( const datetime_t & date,
const amount_t & price,
const bool reflexive = true )
inherited

◆ base_symbol()

string ledger::commodity_t::base_symbol ( ) const
inlineinherited

Definition at line 184 of file commodity.h.

References ledger::commodity_t::base.

Referenced by ledger::commodity_t::operator==(), and ledger::commodity_t::symbol().

+ Here is the caller graph for this function:

◆ check_for_updated_price()

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 )
inherited

◆ clear_flags()

void ledger::flags::delegates_flags< uint_least16_t >::clear_flags ( )
inlineinherited

Definition at line 176 of file flags.h.

◆ drop_flags()

void ledger::flags::delegates_flags< uint_least16_t >::drop_flags ( const flags_t arg)
inlineinherited

Definition at line 182 of file flags.h.

◆ find_price()

virtual optional< price_point_t > ledger::annotated_commodity_t::find_price ( const commodity_t * commodity = NULL,
const datetime_t & moment = datetime_t(),
const datetime_t & oldest = datetime_t() ) const
virtual

Reimplemented from ledger::commodity_t.

◆ find_price_from_expr()

optional< price_point_t > ledger::commodity_t::find_price_from_expr ( expr_t & expr,
const commodity_t * commodity,
const datetime_t & moment ) const
inherited

◆ flags()

flags_t ledger::flags::delegates_flags< uint_least16_t >::flags ( ) const
inlineinherited

Definition at line 166 of file flags.h.

◆ graph_index()

optional< std::size_t > ledger::commodity_t::graph_index ( ) const
inlineinherited

Definition at line 191 of file commodity.h.

References ledger::commodity_t::base.

◆ has_annotation()

bool ledger::commodity_t::has_annotation ( ) const
inlineinherited

Definition at line 171 of file commodity.h.

References ledger::commodity_t::annotated.

◆ has_flags()

bool ledger::flags::delegates_flags< uint_least16_t >::has_flags ( const flags_t arg) const
inlineinherited

Definition at line 169 of file flags.h.

◆ larger()

optional< amount_t > ledger::commodity_t::larger ( ) const
inlineinherited

Definition at line 226 of file commodity.h.

References ledger::commodity_t::base.

◆ map_prices()

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 )
inherited

◆ nail_down()

commodity_t & ledger::commodity_t::nail_down ( const expr_t & expr)
inherited

◆ name()

optional< string > ledger::commodity_t::name ( ) const
inlineinherited

Definition at line 198 of file commodity.h.

References ledger::commodity_t::base.

Referenced by ledger::commodity_t::operator==().

+ Here is the caller graph for this function:

◆ note()

optional< string > ledger::commodity_t::note ( ) const
inlineinherited

Definition at line 205 of file commodity.h.

References ledger::commodity_t::base.

◆ operator bool()

ledger::commodity_t::operator bool ( ) const
inherited

◆ operator==() [1/3]

virtual bool ledger::annotated_commodity_t::operator== ( const annotated_commodity_t & comm) const
inlinevirtual

Definition at line 184 of file annotate.h.

◆ operator==() [2/3]

virtual bool ledger::annotated_commodity_t::operator== ( const commodity_t & comm) const
virtual

Reimplemented from ledger::commodity_t.

◆ operator==() [3/3]

bool ledger::commodity_t::operator== ( const string & name) const
inlineinherited

Definition at line 158 of file commodity.h.

References ledger::commodity_t::base_symbol(), and ledger::commodity_t::name().

+ Here is the call graph for this function:

◆ parse_symbol() [1/3]

static void ledger::commodity_t::parse_symbol ( char *& p,
string & symbol )
staticinherited

◆ parse_symbol() [2/3]

static string ledger::commodity_t::parse_symbol ( std::istream & in)
inlinestaticinherited

Definition at line 270 of file commodity.h.

References ledger::downcast(), and ledger::commodity_t::parse_symbol().

+ Here is the call graph for this function:

◆ parse_symbol() [3/3]

static void ledger::commodity_t::parse_symbol ( std::istream & in,
string & symbol )
staticinherited

Referenced by ledger::commodity_t::parse_symbol().

+ Here is the caller graph for this function:

◆ pool()

commodity_pool_t & ledger::commodity_t::pool ( ) const
inlineinherited

Definition at line 180 of file commodity.h.

References ledger::commodity_t::parent_.

◆ precision()

amount_t::precision_t ledger::commodity_t::precision ( ) const
inlineinherited

Definition at line 212 of file commodity.h.

References ledger::commodity_t::base.

◆ print()

virtual void ledger::annotated_commodity_t::print ( std::ostream & out,
bool elide_quotes = false,
bool print_annotations = false ) const
inlinevirtual

Reimplemented from ledger::commodity_t.

Definition at line 208 of file annotate.h.

References ledger::commodity_t::print(), and write_annotations().

+ Here is the call graph for this function:

◆ referent() [1/2]

virtual commodity_t & ledger::annotated_commodity_t::referent ( )
inlinevirtual

Reimplemented from ledger::commodity_t.

Definition at line 188 of file annotate.h.

References ptr.

◆ referent() [2/2]

virtual const commodity_t & ledger::annotated_commodity_t::referent ( ) const
inlinevirtual

Reimplemented from ledger::commodity_t.

Definition at line 191 of file annotate.h.

References ptr.

◆ remove_price()

void ledger::commodity_t::remove_price ( const datetime_t & date,
commodity_t & commodity )
inherited

◆ set_flags()

void ledger::flags::delegates_flags< uint_least16_t >::set_flags ( const flags_t arg)
inlineinherited

Definition at line 173 of file flags.h.

◆ set_graph_index()

void ledger::commodity_t::set_graph_index ( const optional< std::size_t > & arg = none)
inlineinherited

Definition at line 194 of file commodity.h.

References ledger::commodity_t::base, and ledger::downcast().

+ Here is the call graph for this function:

◆ set_larger()

void ledger::commodity_t::set_larger ( const optional< amount_t > & arg = none)
inlineinherited

Definition at line 229 of file commodity.h.

References ledger::commodity_t::base, and ledger::downcast().

+ Here is the call graph for this function:

◆ set_name()

void ledger::commodity_t::set_name ( const optional< string > & arg = none)
inlineinherited

Definition at line 201 of file commodity.h.

References ledger::commodity_t::base, and ledger::downcast().

+ Here is the call graph for this function:

◆ set_note()

void ledger::commodity_t::set_note ( const optional< string > & arg = none)
inlineinherited

Definition at line 208 of file commodity.h.

References ledger::commodity_t::base, and ledger::downcast().

+ Here is the call graph for this function:

◆ set_precision()

void ledger::commodity_t::set_precision ( amount_t::precision_t arg)
inlineinherited

Definition at line 215 of file commodity.h.

References ledger::commodity_t::base, and ledger::downcast().

+ Here is the call graph for this function:

◆ set_smaller()

void ledger::commodity_t::set_smaller ( const optional< amount_t > & arg = none)
inlineinherited

Definition at line 222 of file commodity.h.

References ledger::commodity_t::base, and ledger::downcast().

+ Here is the call graph for this function:

◆ set_value_expr()

void ledger::commodity_t::set_value_expr ( const optional< expr_t > & expr = none)
inlineinherited

Definition at line 236 of file commodity.h.

References ledger::commodity_t::base.

◆ smaller()

optional< amount_t > ledger::commodity_t::smaller ( ) const
inlineinherited

Definition at line 219 of file commodity.h.

References ledger::commodity_t::base.

◆ strip_annotations()

virtual commodity_t & ledger::annotated_commodity_t::strip_annotations ( const keep_details_t & what_to_keep)
virtual

Reimplemented from ledger::commodity_t.

◆ symbol()

string ledger::commodity_t::symbol ( ) const
inlineinherited

Definition at line 187 of file commodity.h.

References ledger::commodity_t::base_symbol(), and ledger::commodity_t::qualified_symbol.

+ Here is the call graph for this function:

◆ symbol_needs_quotes()

static bool ledger::commodity_t::symbol_needs_quotes ( const string & symbol)
staticinherited

◆ valid()

bool ledger::commodity_t::valid ( ) const
inherited

◆ value_expr()

virtual optional< expr_t > ledger::annotated_commodity_t::value_expr ( ) const
inlinevirtual

Reimplemented from ledger::commodity_t.

Definition at line 195 of file annotate.h.

References details, ledger::annotation_t::value_expr, and ledger::commodity_t::value_expr().

+ Here is the call graph for this function:

◆ write_annotations()

virtual void ledger::annotated_commodity_t::write_annotations ( std::ostream & out,
bool no_computed_annotations = false ) const
virtual

Reimplemented from ledger::commodity_t.

Referenced by print().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ commodity_pool_t

Definition at line 164 of file annotate.h.

Member Data Documentation

◆ _flags

supports_flags<uint_least16_t >& ledger::flags::delegates_flags< uint_least16_t >::_flags
protectedinherited

Definition at line 153 of file flags.h.

◆ annotated

bool ledger::commodity_t::annotated
protectedinherited

Definition at line 134 of file commodity.h.

Referenced by annotated_commodity_t(), and ledger::commodity_t::has_annotation().

◆ base

◆ decimal_comma_by_default

bool ledger::commodity_t::decimal_comma_by_default
staticinherited

Definition at line 144 of file commodity.h.

◆ details

annotation_t ledger::annotated_commodity_t::details

Definition at line 177 of file annotate.h.

Referenced by value_expr().

◆ parent_

commodity_pool_t* ledger::commodity_t::parent_
protectedinherited

Definition at line 132 of file commodity.h.

Referenced by ledger::commodity_t::pool().

◆ ptr

commodity_t* ledger::annotated_commodity_t::ptr
protected

Definition at line 166 of file annotate.h.

Referenced by referent(), and referent().

◆ qualified_symbol

optional<string> ledger::commodity_t::qualified_symbol
protectedinherited

Definition at line 133 of file commodity.h.

Referenced by annotated_commodity_t(), and ledger::commodity_t::symbol().

◆ time_colon_by_default

bool ledger::commodity_t::time_colon_by_default
staticinherited

Definition at line 145 of file commodity.h.


The documentation for this class was generated from the following file: