Loading...
Searching...
No Matches
ledger::expr_base_t< ResultType > Class Template Referenceabstract

#include <exprbase.h>

+ Inheritance diagram for ledger::expr_base_t< ResultType >:
+ Collaboration diagram for ledger::expr_base_t< ResultType >:

Public Types

typedef function< result_type(call_scope_t &) func_t)
 
typedef ResultType result_type
 

Public Member Functions

result_type calc ()
 
result_type calc (scope_t &scope)
 
virtual void compile (scope_t &scope)
 
virtual string context_to_str () const
 
virtual void dump (std::ostream &) const
 
string dump_to_str () const
 
 expr_base_t (const expr_base_t &other)
 
 expr_base_t (scope_t *_context=NULL)
 
scope_tget_context ()
 
virtual void mark_uncompiled ()
 
virtual operator bool () const throw ()
 
result_type operator() (scope_t &scope)
 
expr_base_toperator= (const expr_base_t &_expr)
 
expr_base_toperator= (const string &_expr)
 
void parse (const string &expr_str, const parse_flags_t &flags=PARSE_DEFAULT)
 
virtual void parse (std::istream &, const parse_flags_t &=PARSE_DEFAULT, const optional< string > &original_string=none)
 
result_type preview (std::ostream &out, scope_t &scope) const
 
string preview_to_str (scope_t &) const
 
virtual void print (std::ostream &) const
 
string print_to_str () const
 
void recompile (scope_t &scope)
 
void set_context (scope_t *scope)
 
void set_text (const string &txt)
 
virtual string text () const throw ()
 
virtual ~expr_base_t ()
 

Protected Member Functions

virtual result_type real_calc (scope_t &scope)=0
 

Protected Attributes

bool compiled
 
scope_tcontext
 
string str
 

Detailed Description

template<typename ResultType>
class ledger::expr_base_t< ResultType >

Definition at line 70 of file exprbase.h.

Member Typedef Documentation

◆ func_t

Definition at line 75 of file exprbase.h.

◆ result_type

Definition at line 73 of file exprbase.h.

Constructor & Destructor Documentation

◆ expr_base_t() [1/2]

template<typename ResultType >
ledger::expr_base_t< ResultType >::expr_base_t ( const expr_base_t< ResultType > & other)
inline

Definition at line 85 of file exprbase.h.

References TRACE_CTOR.

◆ expr_base_t() [2/2]

template<typename ResultType >
ledger::expr_base_t< ResultType >::expr_base_t ( scope_t * _context = NULL)
inline

Definition at line 89 of file exprbase.h.

References TRACE_CTOR.

◆ ~expr_base_t()

Definition at line 94 of file exprbase.h.

References TRACE_DTOR.

Member Function Documentation

◆ calc() [1/2]

Definition at line 180 of file exprbase.h.

References assert, ledger::expr_base_t< ResultType >::calc(), and ledger::expr_base_t< ResultType >::context.

Referenced by ledger::expr_base_t< ResultType >::calc(), ledger::expr_base_t< ResultType >::operator()(), and ledger::expr_base_t< ResultType >::preview().

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

◆ calc() [2/2]

template<typename ResultType >
result_type ledger::expr_base_t< ResultType >::calc ( scope_t & scope)
inline

Definition at line 155 of file exprbase.h.

References ledger::expr_base_t< ResultType >::compile(), ledger::expr_base_t< ResultType >::compiled, DEBUG, ledger::downcast(), ledger::expr_base_t< ResultType >::dump(), ledger::expr_base_t< ResultType >::real_calc(), SHOW_DEBUG, and ledger::expr_base_t< ResultType >::str.

+ Here is the call graph for this function:

◆ compile()

template<typename ResultType >
virtual void ledger::expr_base_t< ResultType >::compile ( scope_t & scope)
inlinevirtual

Reimplemented in ledger::expr_t, and ledger::merged_expr_t.

Definition at line 143 of file exprbase.h.

References ledger::expr_base_t< ResultType >::compiled, and ledger::expr_base_t< ResultType >::context.

Referenced by ledger::expr_base_t< ResultType >::calc(), ledger::expr_base_t< ResultType >::preview(), and ledger::expr_base_t< ResultType >::recompile().

+ Here is the caller graph for this function:

◆ context_to_str()

template<typename ResultType >
virtual string ledger::expr_base_t< ResultType >::context_to_str ( ) const
inlinevirtual

Reimplemented in ledger::expr_t.

Definition at line 192 of file exprbase.h.

References ledger::empty_string.

◆ dump()

template<typename ResultType >
virtual void ledger::expr_base_t< ResultType >::dump ( std::ostream & ) const
inlinevirtual

Reimplemented in ledger::draft_t, ledger::expr_t, and ledger::format_t.

Definition at line 213 of file exprbase.h.

Referenced by ledger::expr_base_t< ResultType >::calc(), ledger::expr_base_t< ResultType >::dump_to_str(), and ledger::expr_base_t< ResultType >::preview().

+ Here is the caller graph for this function:

◆ dump_to_str()

template<typename ResultType >
string ledger::expr_base_t< ResultType >::dump_to_str ( ) const
inline

Definition at line 201 of file exprbase.h.

References ledger::expr_base_t< ResultType >::dump().

+ Here is the call graph for this function:

◆ get_context()

template<typename ResultType >
scope_t * ledger::expr_base_t< ResultType >::get_context ( )
inline

Definition at line 185 of file exprbase.h.

References ledger::expr_base_t< ResultType >::context.

◆ mark_uncompiled()

◆ operator bool()

template<typename ResultType >
virtual ledger::expr_base_t< ResultType >::operator bool ( ) const
throw ( )
inlinevirtual

Reimplemented in ledger::expr_t.

Definition at line 111 of file exprbase.h.

References ledger::expr_base_t< ResultType >::str.

◆ operator()()

Definition at line 151 of file exprbase.h.

References ledger::expr_base_t< ResultType >::calc().

+ Here is the call graph for this function:

◆ operator=() [1/2]

Definition at line 98 of file exprbase.h.

References ledger::expr_base_t< ResultType >::compiled, ledger::expr_base_t< ResultType >::context, ledger::downcast(), and ledger::expr_base_t< ResultType >::str.

+ Here is the call graph for this function:

◆ operator=() [2/2]

Definition at line 106 of file exprbase.h.

References ledger::downcast(), and ledger::expr_base_t< ResultType >::parse().

+ Here is the call graph for this function:

◆ parse() [1/2]

template<typename ResultType >
void ledger::expr_base_t< ResultType >::parse ( const string & expr_str,
const parse_flags_t & flags = PARSE_DEFAULT )
inline

Definition at line 123 of file exprbase.h.

References ledger::downcast(), and ledger::expr_base_t< ResultType >::parse().

Referenced by ledger::expr_base_t< ResultType >::operator=(), and ledger::expr_base_t< ResultType >::parse().

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

◆ parse() [2/2]

template<typename ResultType >
virtual void ledger::expr_base_t< ResultType >::parse ( std::istream & ,
const parse_flags_t & = PARSE_DEFAULT,
const optional< string > & original_string = none )
inlinevirtual

Reimplemented in ledger::expr_t.

Definition at line 128 of file exprbase.h.

References ledger::downcast(), and ledger::expr_base_t< ResultType >::set_text().

+ Here is the call graph for this function:

◆ preview()

template<typename ResultType >
result_type ledger::expr_base_t< ResultType >::preview ( std::ostream & out,
scope_t & scope ) const
inline

Definition at line 215 of file exprbase.h.

References ledger::expr_base_t< ResultType >::calc(), ledger::expr_base_t< ResultType >::compile(), ledger::downcast(), ledger::expr_base_t< ResultType >::dump(), ledger::expr_base_t< ResultType >::print(), and ledger::expr_base_t< ResultType >::text().

Referenced by ledger::expr_base_t< ResultType >::preview_to_str().

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

◆ preview_to_str()

template<typename ResultType >
string ledger::expr_base_t< ResultType >::preview_to_str ( scope_t & ) const
inline

Definition at line 206 of file exprbase.h.

References ledger::expr_base_t< ResultType >::preview().

+ Here is the call graph for this function:

◆ print()

template<typename ResultType >
virtual void ledger::expr_base_t< ResultType >::print ( std::ostream & ) const
inlinevirtual

Reimplemented in ledger::expr_t.

Definition at line 212 of file exprbase.h.

Referenced by ledger::operator<<(), ledger::expr_base_t< ResultType >::preview(), and ledger::expr_base_t< ResultType >::print_to_str().

+ Here is the caller graph for this function:

◆ print_to_str()

template<typename ResultType >
string ledger::expr_base_t< ResultType >::print_to_str ( ) const
inline

Definition at line 196 of file exprbase.h.

References ledger::expr_base_t< ResultType >::print().

+ Here is the call graph for this function:

◆ real_calc()

template<typename ResultType >
virtual result_type ledger::expr_base_t< ResultType >::real_calc ( scope_t & scope)
protectedpure virtual

Implemented in ledger::draft_t, ledger::expr_t, ledger::format_t, and ledger::predicate_t.

Referenced by ledger::expr_base_t< ResultType >::calc().

+ Here is the caller graph for this function:

◆ recompile()

template<typename ResultType >
void ledger::expr_base_t< ResultType >::recompile ( scope_t & scope)
inline

Definition at line 138 of file exprbase.h.

References ledger::expr_base_t< ResultType >::compile(), and ledger::expr_base_t< ResultType >::compiled.

+ Here is the call graph for this function:

◆ set_context()

template<typename ResultType >
void ledger::expr_base_t< ResultType >::set_context ( scope_t * scope)
inline

Definition at line 188 of file exprbase.h.

References ledger::expr_base_t< ResultType >::context.

◆ set_text()

template<typename ResultType >
void ledger::expr_base_t< ResultType >::set_text ( const string & txt)
inline

Definition at line 118 of file exprbase.h.

References ledger::expr_base_t< ResultType >::compiled, ledger::downcast(), and ledger::expr_base_t< ResultType >::str.

Referenced by ledger::expr_base_t< ResultType >::parse().

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

◆ text()

template<typename ResultType >
virtual string ledger::expr_base_t< ResultType >::text ( ) const
throw ( )
inlinevirtual

Definition at line 115 of file exprbase.h.

References ledger::expr_base_t< ResultType >::str.

Referenced by ledger::expr_base_t< ResultType >::preview().

+ Here is the caller graph for this function:

Member Data Documentation

◆ compiled

◆ context

◆ str


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