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

#include <pool.h>

Inherits boost::noncopyable.

+ Collaboration diagram for ledger::commodity_pool_t:

Public Types

typedef std::map< std::pair< string, annotation_t >, shared_ptr< annotated_commodity_t > > annotated_commodities_map
 
typedef std::map< string, shared_ptr< commodity_t > > commodities_map
 The commodities collection in commodity_pool_t maintains pointers to all the commodities which have ever been created by the user, whether explicitly by calling the create methods of commodity_pool_t, or implicitly by parsing a commoditized amount.
 

Public Member Functions

commodity_talias (const string &name, commodity_t &referent)
 
 commodity_pool_t ()
 
annotated_commodity_tcreate (commodity_t &comm, const annotation_t &details)
 
commodity_tcreate (const string &symbol)
 
commodity_tcreate (const string &symbol, const annotation_t &details)
 
void exchange (commodity_t &commodity, const amount_t &per_unit_cost, const datetime_t &moment)
 
cost_breakdown_t exchange (const amount_t &amount, const amount_t &cost, const bool is_per_unit=false, const bool add_price=true, const optional< datetime_t > &moment=none, const optional< string > &tag=none)
 
commodity_tfind (const string &name)
 
commodity_tfind (const string &symbol, const annotation_t &details)
 
commodity_tfind_or_create (commodity_t &comm, const annotation_t &details)
 
commodity_tfind_or_create (const string &symbol)
 
commodity_tfind_or_create (const string &symbol, const annotation_t &details)
 
optional< std::pair< commodity_t *, price_point_t > > parse_price_directive (char *line, bool do_not_add_price=false, bool no_date=false)
 
commodity_tparse_price_expression (const std::string &str, const bool add_prices=true, const optional< datetime_t > &moment=none)
 
virtual ~commodity_pool_t ()
 

Public Attributes

annotated_commodities_map annotated_commodities
 
commodities_map commodities
 
commodity_history_t commodity_price_history
 
commodity_tdefault_commodity
 
function< optional< price_point_t >(commodity_t &commodity, const commodity_t *in_terms_ofget_commodity_quote )
 
bool get_quotes
 
bool keep_base
 
commodity_tnull_commodity
 
optional< pathprice_db
 
long quote_leeway
 

Static Public Attributes

static shared_ptr< commodity_pool_tcurrent_pool
 

Detailed Description

Definition at line 60 of file pool.h.

Member Typedef Documentation

◆ annotated_commodities_map

Definition at line 71 of file pool.h.

◆ commodities_map

The commodities collection in commodity_pool_t maintains pointers to all the commodities which have ever been created by the user, whether explicitly by calling the create methods of commodity_pool_t, or implicitly by parsing a commoditized amount.

Definition at line 69 of file pool.h.

Constructor & Destructor Documentation

◆ commodity_pool_t()

ledger::commodity_pool_t::commodity_pool_t ( )
explicit

◆ ~commodity_pool_t()

virtual ledger::commodity_pool_t::~commodity_pool_t ( )
inlinevirtual

Definition at line 91 of file pool.h.

References TRACE_DTOR.

Member Function Documentation

◆ alias()

commodity_t * ledger::commodity_pool_t::alias ( const string & name,
commodity_t & referent )

◆ create() [1/3]

annotated_commodity_t * ledger::commodity_pool_t::create ( commodity_t & comm,
const annotation_t & details )

◆ create() [2/3]

commodity_t * ledger::commodity_pool_t::create ( const string & symbol)

◆ create() [3/3]

commodity_t * ledger::commodity_pool_t::create ( const string & symbol,
const annotation_t & details )

◆ exchange() [1/2]

void ledger::commodity_pool_t::exchange ( commodity_t & commodity,
const amount_t & per_unit_cost,
const datetime_t & moment )

◆ exchange() [2/2]

cost_breakdown_t ledger::commodity_pool_t::exchange ( const amount_t & amount,
const amount_t & cost,
const bool is_per_unit = false,
const bool add_price = true,
const optional< datetime_t > & moment = none,
const optional< string > & tag = none )

◆ find() [1/2]

commodity_t * ledger::commodity_pool_t::find ( const string & name)

◆ find() [2/2]

commodity_t * ledger::commodity_pool_t::find ( const string & symbol,
const annotation_t & details )

◆ find_or_create() [1/3]

commodity_t * ledger::commodity_pool_t::find_or_create ( commodity_t & comm,
const annotation_t & details )

◆ find_or_create() [2/3]

commodity_t * ledger::commodity_pool_t::find_or_create ( const string & symbol)

◆ find_or_create() [3/3]

commodity_t * ledger::commodity_pool_t::find_or_create ( const string & symbol,
const annotation_t & details )

◆ parse_price_directive()

optional< std::pair< commodity_t *, price_point_t > > ledger::commodity_pool_t::parse_price_directive ( char * line,
bool do_not_add_price = false,
bool no_date = false )

◆ parse_price_expression()

commodity_t * ledger::commodity_pool_t::parse_price_expression ( const std::string & str,
const bool add_prices = true,
const optional< datetime_t > & moment = none )

Member Data Documentation

◆ annotated_commodities

annotated_commodities_map ledger::commodity_pool_t::annotated_commodities

Definition at line 74 of file pool.h.

◆ commodities

commodities_map ledger::commodity_pool_t::commodities

Definition at line 73 of file pool.h.

◆ commodity_price_history

commodity_history_t ledger::commodity_pool_t::commodity_price_history

Definition at line 75 of file pool.h.

◆ current_pool

shared_ptr<commodity_pool_t> ledger::commodity_pool_t::current_pool
static

Definition at line 88 of file pool.h.

◆ default_commodity

commodity_t* ledger::commodity_pool_t::default_commodity

Definition at line 77 of file pool.h.

◆ get_commodity_quote

function<optional<price_point_t>(commodity_t& commodity, const commodity_t * in_terms_of) ledger::commodity_pool_t::get_commodity_quote)

Definition at line 86 of file pool.h.

◆ get_quotes

bool ledger::commodity_pool_t::get_quotes

Definition at line 82 of file pool.h.

◆ keep_base

bool ledger::commodity_pool_t::keep_base

Definition at line 79 of file pool.h.

◆ null_commodity

commodity_t* ledger::commodity_pool_t::null_commodity

Definition at line 76 of file pool.h.

◆ price_db

optional<path> ledger::commodity_pool_t::price_db

Definition at line 80 of file pool.h.

◆ quote_leeway

long ledger::commodity_pool_t::quote_leeway

Definition at line 81 of file pool.h.


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