The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
game_logic::formula Class Reference

#include <formula.hpp>

Public Member Functions

variant evaluate (const formula_callable &variables, formula_debugger *fdb=nullptr) const
 
variant evaluate (formula_debugger *fdb=nullptr) const
 
 formula (const std::string &str, function_symbol_table *symbols=nullptr)
 
 formula (const formula_tokenizer::token *i1, const formula_tokenizer::token *i2, function_symbol_table *symbols=nullptr)
 
 ~formula ()
 
const std::stringstr () const
 

Static Public Member Functions

static variant evaluate (const const_formula_ptr &f, const formula_callable &variables, formula_debugger *fdb=nullptr, variant default_res=variant(0))
 
static formula_ptr create_optional_formula (const std::string &str, function_symbol_table *symbols=nullptr)
 

Static Public Attributes

static const char *const id_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_"
 

Private Member Functions

variant execute (const formula_callable &variables, formula_debugger *fdb=nullptr) const
 
variant execute (formula_debugger *fdb) const
 
 formula ()
 

Private Attributes

expression_ptr expr_
 
std::string str_
 
function_symbol_tablesymbols_
 
bool managing_symbols
 

Friends

class formula_debugger
 

Detailed Description

Definition at line 29 of file formula.hpp.

Constructor & Destructor Documentation

game_logic::formula::formula ( const std::string str,
function_symbol_table symbols = nullptr 
)
explicit
game_logic::formula::formula ( const formula_tokenizer::token i1,
const formula_tokenizer::token i2,
function_symbol_table symbols = nullptr 
)
explicit

Definition at line 1352 of file formula.cpp.

References expr_, and symbols_.

game_logic::formula::~formula ( )

Definition at line 1203 of file formula.cpp.

References managing_symbols, and symbols_.

game_logic::formula::formula ( )
inlineprivate

Definition at line 69 of file formula.hpp.

Referenced by create_optional_formula().

Member Function Documentation

formula_ptr game_logic::formula::create_optional_formula ( const std::string str,
function_symbol_table symbols = nullptr 
)
static

Definition at line 1210 of file formula.cpp.

References formula().

Referenced by ai::formula_ai::create_optional_formula().

static variant game_logic::formula::evaluate ( const const_formula_ptr f,
const formula_callable variables,
formula_debugger fdb = nullptr,
variant  default_res = variant(0) 
)
inlinestatic
variant game_logic::formula::evaluate ( const formula_callable variables,
formula_debugger fdb = nullptr 
) const
inline

Definition at line 41 of file formula.hpp.

References game_logic::evaluate_formula_callback(), and execute().

variant game_logic::formula::evaluate ( formula_debugger fdb = nullptr) const
inline

Definition at line 50 of file formula.hpp.

References game_logic::evaluate_formula_callback(), and execute().

variant game_logic::formula::execute ( const formula_callable variables,
formula_debugger fdb = nullptr 
) const
private
variant game_logic::formula::execute ( formula_debugger fdb) const
private

Definition at line 1379 of file formula.cpp.

References execute().

const std::string& game_logic::formula::str ( ) const
inline

Definition at line 63 of file formula.hpp.

References str_.

Referenced by game_logic::formula_debugger::evaluate_formula_callback().

Friends And Related Function Documentation

friend class formula_debugger
friend

Definition at line 75 of file formula.hpp.

Member Data Documentation

expression_ptr game_logic::formula::expr_
private

Definition at line 71 of file formula.hpp.

Referenced by execute(), and formula().

const char *const game_logic::formula::id_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_"
static

Definition at line 65 of file formula.hpp.

Referenced by lua_callable::get_inputs(), and config_callable::get_inputs().

bool game_logic::formula::managing_symbols
private

Definition at line 74 of file formula.hpp.

Referenced by ~formula().

std::string game_logic::formula::str_
private

Definition at line 72 of file formula.hpp.

Referenced by str().

function_symbol_table* game_logic::formula::symbols_
private

Definition at line 73 of file formula.hpp.

Referenced by formula(), and ~formula().


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