Loading...
Searching...
No Matches
ledger::item_t Class Referenceabstract

#include <item.h>

+ Inheritance diagram for ledger::item_t:
+ Collaboration diagram for ledger::item_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 >, booltag_data_t
 

Public Member Functions

void add_flags (const flags_t arg)
 
virtual void append_note (const char *p, scope_t &scope, bool overwrite_existing=true)
 
virtual optional< date_taux_date () const
 
void clear_flags ()
 
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 ()=0
 
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
 
string id () const
 
 item_t (const item_t &item)
 
 item_t (flags_t _flags=0x00, const optional< string > &_note=none)
 
virtual expr_t::ptr_op_t lookup (const symbol_t::kind_t kind, const string &name)
 
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)
 
virtual date_t primary_date () const
 
std::size_t seq () const
 
void set_flags (const flags_t arg)
 
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 ~item_t ()
 

Public Attributes

optional< date_t_date
 
optional< date_t_date_aux
 
state_t _state
 
optional< string_mapmetadata
 
optional< stringnote
 
optional< position_tpos
 

Static Public Attributes

static scope_tdefault_scope
 
static empty_scope_tempty_scope
 
static bool use_aux_date
 

Protected Attributes

flags_t _flags
 

Detailed Description

Definition at line 82 of file item.h.

Member Typedef Documentation

◆ flags_t

Definition at line 50 of file flags.h.

◆ string_map

Definition at line 95 of file item.h.

◆ tag_data_t

Definition at line 93 of file item.h.

Member Enumeration Documentation

◆ state_t

Enumerator
UNCLEARED 
CLEARED 
PENDING 

Definition at line 91 of file item.h.

Constructor & Destructor Documentation

◆ item_t() [1/2]

ledger::item_t::item_t ( flags_t _flags = 0x00,
const optional< string > & _note = none )
inline

Definition at line 104 of file item.h.

References TRACE_CTOR.

◆ item_t() [2/2]

ledger::item_t::item_t ( const item_t & item)
inline

Definition at line 109 of file item.h.

References copy_details(), ledger::downcast(), and TRACE_CTOR.

+ Here is the call graph for this function:

◆ ~item_t()

virtual ledger::item_t::~item_t ( )
inlinevirtual

Definition at line 114 of file item.h.

References TRACE_DTOR.

Member Function Documentation

◆ 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.

◆ append_note()

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

◆ aux_date()

virtual optional< date_t > ledger::item_t::aux_date ( ) const
inlinevirtual

Reimplemented in ledger::post_t.

Definition at line 191 of file item.h.

References _date_aux.

Referenced by date().

+ Here is the caller graph for this function:

◆ clear_flags()

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

Definition at line 84 of file flags.h.

◆ copy_details()

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

Reimplemented in ledger::post_t.

Definition at line 118 of file item.h.

References _date, _date_aux, ledger::downcast(), metadata, note, pos, ledger::flags::supports_flags< uint_least16_t >::set_flags(), and set_state().

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

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

◆ date()

virtual date_t ledger::item_t::date ( ) const
inlinevirtual

Reimplemented in ledger::post_t.

Definition at line 180 of file item.h.

References _date, assert, aux_date(), ledger::downcast(), and use_aux_date.

+ Here is the call graph for this function:

◆ define()

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

Reimplemented from ledger::scope_t.

◆ description()

◆ 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::item_t::get_tag ( const mask_t & tag_mask,
const optional< mask_t > & value_mask = none,
bool inherit = true ) const
virtual

Reimplemented in ledger::post_t.

◆ get_tag() [2/2]

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

Reimplemented in ledger::post_t.

Referenced by id().

+ Here is the caller graph for this function:

◆ has_date()

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

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.

◆ has_tag() [1/2]

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

Reimplemented in ledger::post_t.

◆ has_tag() [2/2]

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

Reimplemented in ledger::post_t.

◆ id()

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

Definition at line 137 of file item.h.

References ledger::downcast(), get_tag(), and seq().

+ Here is the call graph for this function:

◆ lookup()

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

Implements ledger::scope_t.

Reimplemented in ledger::post_t, and ledger::xact_t.

◆ operator!=()

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

Definition at line 133 of file item.h.

◆ operator==()

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

Definition at line 130 of file item.h.

◆ parse_tags()

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

Reimplemented in ledger::auto_xact_t.

◆ primary_date()

virtual date_t ledger::item_t::primary_date ( ) const
inlinevirtual

Reimplemented in ledger::post_t.

Definition at line 187 of file item.h.

References _date, and assert.

◆ seq()

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

Definition at line 146 of file item.h.

References ledger::downcast(), and pos.

Referenced by id().

+ Here is the call graph for this function:
+ 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.

◆ set_state()

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

Definition at line 195 of file item.h.

References _state, and ledger::downcast().

Referenced by copy_details().

+ Here is the call graph for this function:
+ 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 )
virtual

◆ state()

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

Definition at line 198 of file item.h.

References _state.

◆ 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::item_t::valid ( ) const

Member Data Documentation

◆ _date

optional<date_t> ledger::item_t::_date

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

Definition at line 99 of file item.h.

Referenced by aux_date(), and copy_details().

◆ _flags

Definition at line 53 of file flags.h.

◆ _state

state_t ledger::item_t::_state

Definition at line 97 of file item.h.

Referenced by set_state(), and state().

◆ 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.

◆ metadata

optional<string_map> ledger::item_t::metadata

Definition at line 102 of file item.h.

Referenced by copy_details().

◆ note

optional<string> ledger::item_t::note

Definition at line 100 of file item.h.

Referenced by copy_details().

◆ pos

◆ use_aux_date

bool ledger::item_t::use_aux_date
static

Definition at line 174 of file item.h.

Referenced by date().


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