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

template<typename ResultType>
typedef function<result_type (call_scope_t&)> ledger::expr_base_t< ResultType >::func_t

Definition at line 75 of file exprbase.h.

◆ result_type

template<typename ResultType>
typedef ResultType ledger::expr_base_t< ResultType >::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.

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

◆ ~expr_base_t()

template<typename ResultType>
virtual ledger::expr_base_t< ResultType >::~expr_base_t ( )
inlinevirtual

Definition at line 94 of file exprbase.h.

Member Function Documentation

◆ calc() [1/2]

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

Definition at line 180 of file exprbase.h.

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

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.

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

Referenced by ledger::expr_base_t< value_t >::calc(), ledger::expr_base_t< value_t >::preview(), and ledger::expr_base_t< value_t >::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.

◆ 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< value_t >::calc(), ledger::expr_base_t< value_t >::dump_to_str(), and ledger::expr_base_t< value_t >::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.

◆ get_context()

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

Definition at line 185 of file exprbase.h.

◆ mark_uncompiled()

template<typename ResultType>
virtual void ledger::expr_base_t< ResultType >::mark_uncompiled ( )
inlinevirtual

Reimplemented in ledger::format_t.

Definition at line 134 of file exprbase.h.

Referenced by ledger::format_t::mark_uncompiled().

Here is the caller graph for this function:

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

◆ operator()()

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

Definition at line 151 of file exprbase.h.

◆ operator=() [1/2]

template<typename ResultType>
expr_base_t & ledger::expr_base_t< ResultType >::operator= ( const expr_base_t< ResultType > & _expr)
inline

Definition at line 98 of file exprbase.h.

◆ operator=() [2/2]

template<typename ResultType>
expr_base_t & ledger::expr_base_t< ResultType >::operator= ( const string & _expr)
inline

Definition at line 106 of file exprbase.h.

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

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

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.

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

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

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.

◆ 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< value_t >::preview(), and ledger::expr_base_t< value_t >::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.

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

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

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

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

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.

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

Here is the caller graph for this function:

Member Data Documentation

◆ compiled

template<typename ResultType>
bool ledger::expr_base_t< ResultType >::compiled
protected

Definition at line 80 of file exprbase.h.

Referenced by ledger::expr_base_t< value_t >::operator=().

◆ context

template<typename ResultType>
scope_t* ledger::expr_base_t< ResultType >::context
protected

Definition at line 78 of file exprbase.h.

Referenced by ledger::expr_base_t< value_t >::operator=().

◆ str

template<typename ResultType>
string ledger::expr_base_t< ResultType >::str
protected

Definition at line 79 of file exprbase.h.

Referenced by ledger::expr_base_t< value_t >::operator=().


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