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

#include <post.h>

Inheritance diagram for ledger::post_t:
Collaboration diagram for ledger::post_t:

Classes

struct  compare_by_date_and_sequence
struct  xdata_t

Public Types

typedef uint_least16_t flags_t
enum  state_t { UNCLEARED = 0 , CLEARED , PENDING }
typedef std::map< string, tag_data_t, std::function< bool(string, string)> > string_map
typedef std::pair< optional< value_t >, bool > tag_data_t

Public Member Functions

std::size_t account_id () const
void add_flags (const flags_t arg)
void add_to_value (value_t &value, const optional< expr_t & > &expr=none) const
virtual void append_note (const char *p, scope_t &scope, bool overwrite_existing=true)
virtual optional< date_taux_date () const
void clear_flags ()
void clear_xdata ()
virtual void copy_details (const item_t &item)
virtual date_t date () const
virtual void define (const symbol_t::kind_t, const string &, expr_t::ptr_op_t)
virtual string description ()
void drop_flags (const flags_t arg)
flags_t flags () const
virtual optional< value_tget_tag (const mask_t &tag_mask, const optional< mask_t > &value_mask=none, bool inherit=true) const
virtual optional< value_tget_tag (const string &tag, bool inherit=true) const
virtual bool has_date () const
bool has_flags (const flags_t arg) const
virtual bool has_tag (const mask_t &tag_mask, const optional< mask_t > &value_mask=none, bool inherit=true) const
virtual bool has_tag (const string &tag, bool inherit=true) const
bool has_xdata () const
string id () const
virtual expr_t::ptr_op_t lookup (const symbol_t::kind_t kind, const string &name)
bool must_balance () const
virtual bool operator!= (const item_t &xact)
virtual bool operator== (const item_t &xact)
virtual void parse_tags (const char *p, scope_t &scope, bool overwrite_existing=true)
string payee () const
string payee_from_tag () const
 post_t (account_t *_account, const amount_t &_amount, flags_t _flags=0x00, const optional< string > &_note=none)
 post_t (account_t *_account=NULL, flags_t _flags=0x00)
 post_t (const post_t &post)
virtual date_t primary_date () const
account_treported_account ()
const account_treported_account () const
amount_t resolve_expr (scope_t &scope, expr_t &expr)
std::size_t seq () const
void set_flags (const flags_t arg)
void set_payee (const string &payee)
void set_reported_account (account_t *account)
void set_state (state_t new_state)
virtual string_map::iterator set_tag (const string &tag, const optional< value_t > &value=none, const bool overwrite_existing=true)
virtual state_t state () const
virtual value_t::type_t type_context () const
virtual bool type_required () const
bool valid () const
virtual date_t value_date () const
std::size_t xact_id () const
xdata_txdata ()
const xdata_txdata () const
virtual ~post_t ()

Public Attributes

optional< date_t_date
optional< date_t_date_aux
state_t _state
account_taccount
amount_t amount
optional< expr_tamount_expr
optional< amount_tassigned_amount
optional< datetime_tcheckin
optional< datetime_tcheckout
optional< amount_tcost
optional< amount_tgiven_cost
optional< string_mapmetadata
optional< stringnote
optional< position_tpos
xact_txact
optional< xdata_txdata_

Static Public Attributes

static scope_tdefault_scope
static empty_scope_tempty_scope
static bool use_aux_date

Protected Attributes

flags_t _flags

Friends

class xact_t

Detailed Description

Definition at line 51 of file post.h.

Member Typedef Documentation

◆ flags_t

typedef uint_least16_t ledger::flags::supports_flags< uint_least16_t, uint_least16_t >::flags_t
inherited

Definition at line 50 of file flags.h.

◆ string_map

typedef std::map<string, tag_data_t, std::function<bool(string, string)> > ledger::item_t::string_map
inherited

Definition at line 95 of file item.h.

◆ tag_data_t

typedef std::pair<optional<value_t>, bool> ledger::item_t::tag_data_t
inherited

Definition at line 93 of file item.h.

Member Enumeration Documentation

◆ state_t

enum ledger::item_t::state_t
inherited
Enumerator
UNCLEARED 
CLEARED 
PENDING 

Definition at line 91 of file item.h.

Constructor & Destructor Documentation

◆ post_t() [1/3]

ledger::post_t::post_t ( account_t * _account = NULL,
flags_t _flags = 0x00 )
inline

Definition at line 82 of file post.h.

References ledger::flags::supports_flags< uint_least16_t >::_flags, account, ITEM_NORMAL, ledger::item_t::item_t(), post_t(), TRACE_CTOR, and xact.

Referenced by copy_details(), ledger::post_t::compare_by_date_and_sequence::operator()(), post_t(), post_t(), post_t(), reported_account(), xdata(), and ~post_t().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ post_t() [2/3]

ledger::post_t::post_t ( account_t * _account,
const amount_t & _amount,
flags_t _flags = 0x00,
const optional< string > & _note = none )
inline

Definition at line 88 of file post.h.

References ledger::flags::supports_flags< uint_least16_t >::_flags, account, amount, ITEM_NORMAL, ledger::item_t::item_t(), post_t(), TRACE_CTOR, and xact.

Here is the call graph for this function:

◆ post_t() [3/3]

ledger::post_t::post_t ( const post_t & post)
inline

Definition at line 96 of file post.h.

References account, amount, assigned_amount, checkin, checkout, copy_details(), cost, ledger::item_t::item_t(), post_t(), TRACE_CTOR, xact, and xdata_.

Here is the call graph for this function:

◆ ~post_t()

virtual ledger::post_t::~post_t ( )
inlinevirtual

Definition at line 110 of file post.h.

References post_t(), and TRACE_DTOR.

Here is the call graph for this function:

Member Function Documentation

◆ account_id()

std::size_t ledger::post_t::account_id ( ) const

◆ add_flags()

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

Definition at line 87 of file flags.h.

◆ add_to_value()

void ledger::post_t::add_to_value ( value_t & value,
const optional< expr_t & > & expr = none ) const

◆ append_note()

virtual void ledger::item_t::append_note ( const char * p,
scope_t & scope,
bool overwrite_existing = true )
virtualinherited

References ledger::scope_t::scope_t().

Here is the call graph for this function:

◆ aux_date()

virtual optional< date_t > ledger::post_t::aux_date ( ) const
virtual

Reimplemented from ledger::item_t.

◆ clear_flags()

void ledger::flags::supports_flags< uint_least16_t, uint_least16_t >::clear_flags ( )
inlineinherited

Definition at line 84 of file flags.h.

◆ clear_xdata()

void ledger::post_t::clear_xdata ( )
inline

Definition at line 220 of file post.h.

References xdata_.

◆ copy_details()

virtual void ledger::post_t::copy_details ( const item_t & item)
inlinevirtual

Reimplemented from ledger::item_t.

Definition at line 159 of file post.h.

References ledger::item_t::copy_details(), ledger::item_t::item_t(), post_t(), and xdata_.

Referenced by post_t().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ date()

virtual date_t ledger::post_t::date ( ) const
virtual

Reimplemented from ledger::item_t.

Referenced by ledger::day_of_week_posts::operator()().

Here is the caller graph for this function:

◆ define()

virtual void ledger::item_t::define ( const symbol_t::kind_t ,
const string & ,
expr_t::ptr_op_t  )
virtualinherited

Reimplemented from ledger::scope_t.

◆ description()

virtual string ledger::post_t::description ( )
inlinevirtual

Implements ledger::scope_t.

Definition at line 114 of file post.h.

References ledger::item_t::pos.

◆ drop_flags()

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

Definition at line 90 of file flags.h.

◆ flags()

flags_t ledger::flags::supports_flags< uint_least16_t, uint_least16_t >::flags ( ) const
inlineinherited

Definition at line 74 of file flags.h.

◆ get_tag() [1/2]

virtual optional< value_t > ledger::post_t::get_tag ( const mask_t & tag_mask,
const optional< mask_t > & value_mask = none,
bool inherit = true ) const
virtual

Reimplemented from ledger::item_t.

◆ get_tag() [2/2]

virtual optional< value_t > ledger::post_t::get_tag ( const string & tag,
bool inherit = true ) const
virtual

Reimplemented from ledger::item_t.

◆ has_date()

virtual bool ledger::item_t::has_date ( ) const
inlinevirtualinherited

Definition at line 176 of file item.h.

References _date.

◆ has_flags()

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

Definition at line 77 of file flags.h.

Referenced by ledger::post_t::must_balance().

Here is the caller graph for this function:

◆ has_tag() [1/2]

virtual bool ledger::post_t::has_tag ( const mask_t & tag_mask,
const optional< mask_t > & value_mask = none,
bool inherit = true ) const
virtual

Reimplemented from ledger::item_t.

◆ has_tag() [2/2]

virtual bool ledger::post_t::has_tag ( const string & tag,
bool inherit = true ) const
virtual

Reimplemented from ledger::item_t.

◆ has_xdata()

bool ledger::post_t::has_xdata ( ) const
inline

Definition at line 217 of file post.h.

References xdata_.

◆ id()

string ledger::item_t::id ( ) const
inlineinherited

Definition at line 137 of file item.h.

References get_tag(), and seq().

Here is the call graph for this function:

◆ lookup()

virtual expr_t::ptr_op_t ledger::post_t::lookup ( const symbol_t::kind_t kind,
const string & name )
virtual

Reimplemented from ledger::item_t.

◆ must_balance()

bool ledger::post_t::must_balance ( ) const
inline

Definition at line 147 of file post.h.

References ledger::flags::supports_flags< uint_least16_t >::has_flags(), POST_IS_TIMELOG, POST_MUST_BALANCE, and POST_VIRTUAL.

Here is the call graph for this function:

◆ operator!=()

virtual bool ledger::item_t::operator!= ( const item_t & xact)
inlinevirtualinherited

Definition at line 133 of file item.h.

References item_t().

Here is the call graph for this function:

◆ operator==()

virtual bool ledger::item_t::operator== ( const item_t & xact)
inlinevirtualinherited

Definition at line 130 of file item.h.

References item_t().

Here is the call graph for this function:

◆ parse_tags()

virtual void ledger::item_t::parse_tags ( const char * p,
scope_t & scope,
bool overwrite_existing = true )
virtualinherited

Reimplemented in ledger::auto_xact_t.

References ledger::scope_t::scope_t().

Here is the call graph for this function:

◆ payee()

string ledger::post_t::payee ( ) const

Referenced by set_payee().

Here is the caller graph for this function:

◆ payee_from_tag()

string ledger::post_t::payee_from_tag ( ) const

◆ primary_date()

virtual date_t ledger::post_t::primary_date ( ) const
virtual

Reimplemented from ledger::item_t.

Referenced by ledger::post_t::compare_by_date_and_sequence::operator()().

Here is the caller graph for this function:

◆ reported_account() [1/2]

account_t * ledger::post_t::reported_account ( )
inline

Definition at line 237 of file post.h.

References account, assert, and xdata_.

Referenced by reported_account().

Here is the caller graph for this function:

◆ reported_account() [2/2]

const account_t * ledger::post_t::reported_account ( ) const
inline

Definition at line 245 of file post.h.

References post_t(), and reported_account().

Here is the call graph for this function:

◆ resolve_expr()

amount_t ledger::post_t::resolve_expr ( scope_t & scope,
expr_t & expr )

◆ seq()

std::size_t ledger::item_t::seq ( ) const
inlineinherited

Definition at line 146 of file item.h.

References pos.

Referenced by id().

Here is the caller graph for this function:

◆ set_flags()

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

Definition at line 81 of file flags.h.

Referenced by ledger::item_t::copy_details().

Here is the caller graph for this function:

◆ set_payee()

void ledger::post_t::set_payee ( const string & payee)
inline

Definition at line 143 of file post.h.

References payee().

Here is the call graph for this function:

◆ set_reported_account()

void ledger::post_t::set_reported_account ( account_t * account)

References account.

◆ set_state()

void ledger::item_t::set_state ( state_t new_state)
inlineinherited

Definition at line 195 of file item.h.

References _state.

Referenced by copy_details().

Here is the caller graph for this function:

◆ set_tag()

virtual string_map::iterator ledger::item_t::set_tag ( const string & tag,
const optional< value_t > & value = none,
const bool overwrite_existing = true )
virtualinherited

◆ state()

virtual state_t ledger::item_t::state ( ) const
inlinevirtualinherited

Definition at line 198 of file item.h.

References _state.

Referenced by copy_details().

Here is the caller graph for this function:

◆ type_context()

virtual value_t::type_t ledger::scope_t::type_context ( ) const
inlinevirtualinherited

Reimplemented in ledger::context_scope_t.

Definition at line 109 of file scope.h.

References ledger::value_t::VOID.

◆ type_required()

virtual bool ledger::scope_t::type_required ( ) const
inlinevirtualinherited

Reimplemented in ledger::context_scope_t.

Definition at line 112 of file scope.h.

◆ valid()

bool ledger::post_t::valid ( ) const

◆ value_date()

virtual date_t ledger::post_t::value_date ( ) const
virtual

◆ xact_id()

std::size_t ledger::post_t::xact_id ( ) const

◆ xdata() [1/2]

xdata_t & ledger::post_t::xdata ( )
inline

Definition at line 223 of file post.h.

References xdata_.

Referenced by ledger::filter_posts::operator()(), ledger::related_posts::operator()(), and xdata().

Here is the caller graph for this function:

◆ xdata() [2/2]

const xdata_t & ledger::post_t::xdata ( ) const
inline

Definition at line 228 of file post.h.

References post_t(), and xdata().

Here is the call graph for this function:

◆ xact_t

friend class xact_t
friend

Definition at line 249 of file post.h.

References xact_t.

Referenced by xact_t.

Member Data Documentation

◆ _date

optional<date_t> ledger::item_t::_date
inherited

Definition at line 98 of file item.h.

Referenced by copy_details(), date(), has_date(), and primary_date().

◆ _date_aux

optional<date_t> ledger::item_t::_date_aux
inherited

Definition at line 99 of file item.h.

Referenced by aux_date(), and copy_details().

◆ _flags

flags_t ledger::flags::supports_flags< uint_least16_t, uint_least16_t >::_flags
protectedinherited

Definition at line 53 of file flags.h.

Referenced by ledger::item_t::item_t(), ledger::post_t::post_t(), and ledger::post_t::post_t().

◆ _state

state_t ledger::item_t::_state
inherited

Definition at line 97 of file item.h.

Referenced by item_t(), set_state(), and state().

◆ account

account_t* ledger::post_t::account

Definition at line 66 of file post.h.

Referenced by post_t(), post_t(), post_t(), reported_account(), and set_reported_account().

◆ amount

amount_t ledger::post_t::amount

Definition at line 68 of file post.h.

Referenced by post_t(), and post_t().

◆ amount_expr

optional<expr_t> ledger::post_t::amount_expr

Definition at line 69 of file post.h.

◆ assigned_amount

optional<amount_t> ledger::post_t::assigned_amount

Definition at line 72 of file post.h.

Referenced by post_t().

◆ checkin

optional<datetime_t> ledger::post_t::checkin

Definition at line 73 of file post.h.

Referenced by post_t().

◆ checkout

optional<datetime_t> ledger::post_t::checkout

Definition at line 74 of file post.h.

Referenced by post_t().

◆ cost

optional<amount_t> ledger::post_t::cost

Definition at line 70 of file post.h.

Referenced by post_t().

◆ default_scope

scope_t* ledger::scope_t::default_scope
staticinherited

◆ empty_scope

empty_scope_t* ledger::scope_t::empty_scope
staticinherited

Definition at line 93 of file scope.h.

◆ given_cost

optional<amount_t> ledger::post_t::given_cost

Definition at line 71 of file post.h.

◆ metadata

optional<string_map> ledger::item_t::metadata
inherited

Definition at line 102 of file item.h.

Referenced by copy_details().

◆ note

optional<string> ledger::item_t::note
inherited

Definition at line 100 of file item.h.

Referenced by copy_details(), and item_t().

◆ pos

◆ use_aux_date

bool ledger::item_t::use_aux_date
staticinherited

Definition at line 174 of file item.h.

Referenced by date().

◆ xact

xact_t* ledger::post_t::xact

Definition at line 65 of file post.h.

Referenced by ledger::sort_xacts::operator()(), post_t(), post_t(), and post_t().

◆ xdata_

optional<xdata_t> ledger::post_t::xdata_
mutable

Definition at line 215 of file post.h.

Referenced by clear_xdata(), copy_details(), has_xdata(), post_t(), reported_account(), and xdata().


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