#include <callable.hpp>
Public Types | |
typedef std::map< std::string, variant >::const_iterator | const_iterator |
Public Member Functions | |
map_formula_callable (const_formula_callable_ptr fallback=nullptr) | |
map_formula_callable & | add (const std::string &key, const variant &value) |
map_formula_callable & | add (const std::string &key, variant &&value) |
void | set_fallback (const_formula_callable_ptr fallback) |
bool | empty () const |
void | clear () |
const_iterator | begin () const |
const_iterator | end () const |
Public Member Functions inherited from wfl::formula_callable | |
formula_callable (bool has_self=true) | |
virtual | ~formula_callable () |
formula_callable_ptr | fake_ptr () |
const_formula_callable_ptr | fake_ptr () const |
variant | query_value (const std::string &key) const |
void | mutate_value (const std::string &key, const variant &value) |
formula_input_vector | inputs () const |
bool | equals (const formula_callable &other) const |
bool | less (const formula_callable &other) const |
bool | has_key (const std::string &key) const |
void | serialize (std::string &str) const |
void | subscribe_dtor (callable_die_subscriber *d) const |
void | unsubscribe_dtor (callable_die_subscriber *d) const |
Private Member Functions | |
void | set_value (const std::string &key, const variant &value) override |
variant | get_value (const std::string &key) const override |
void | get_inputs (formula_input_vector &inputs) const override |
Private Attributes | |
std::map< std::string, variant > | values_ |
const_formula_callable_ptr | fallback_ |
Additional Inherited Members | |
Protected Types inherited from wfl::formula_callable | |
enum | TYPE { FORMULA_C , TERRAIN_C , LOCATION_C , UNIT_TYPE_C , UNIT_C , ATTACK_TYPE_C , MOVE_PARTIAL_C , MOVE_C , ATTACK_C , MOVE_MAP_C } |
Protected Member Functions inherited from wfl::formula_callable | |
virtual int | do_compare (const formula_callable *callable) const |
virtual void | serialize_to_string (std::string &) const |
Static Protected Member Functions inherited from wfl::formula_callable | |
template<typename T , typename K > | |
static variant | convert_map (const std::map< T, K > &input_map) |
template<typename T > | |
static variant | convert_set (const std::set< T > &input_set) |
template<typename T > | |
static variant | convert_vector (const std::vector< T > &input_vector) |
static void | add_input (formula_input_vector &inputs, const std::string &key, formula_access access_type=formula_access::read_only) |
Protected Attributes inherited from wfl::formula_callable | |
TYPE | type_ |
std::set< callable_die_subscriber * > | dtor_notify |
Definition at line 244 of file callable.hpp.
typedef std::map<std::string,variant>::const_iterator wfl::map_formula_callable::const_iterator |
Definition at line 274 of file callable.hpp.
|
inlineexplicit |
Definition at line 247 of file callable.hpp.
|
inline |
Definition at line 253 of file callable.hpp.
References values_.
Referenced by attack_type::add_formula_context(), BOOST_AUTO_TEST_CASE(), wfl::builtins::DEFINE_WFL_FUNCTION(), wfl::candidate_action_with_filters::do_filtering(), ai::stage_unit_formulas::do_play_stage(), gui2::image_shape::draw(), gui2::text_shape::draw(), wfl::move_candidate_action::evaluate(), wfl::attack_candidate_action::evaluate(), wfl::formula_function_expression::execute(), wfl::safe_call_callable::execute_self(), gui2::rich_label::get_image_size(), gui2::get_screen_size_variables(), gui2::window::layout(), terrain_filter::match_internal(), ai::formula_ai::on_create(), gui2::window::set_variable(), gui2::canvas::set_variable(), gui2::rich_label::setup_text_renderer(), wfl::move_candidate_action::update_callable_map(), wfl::attack_candidate_action::update_callable_map(), gui2::combobox::update_offsets(), gui2::multiline_text::update_offsets(), gui2::text_box::update_offsets(), and gui2::canvas::update_size_variables().
|
inline |
Definition at line 259 of file callable.hpp.
References values_.
|
inline |
Definition at line 276 of file callable.hpp.
References values_.
Referenced by ai::formula_ai::to_config().
|
inline |
Definition at line 272 of file callable.hpp.
References values_.
|
inline |
Definition at line 270 of file callable.hpp.
References values_.
Referenced by ai::formula_ai::to_config().
|
inline |
Definition at line 277 of file callable.hpp.
References values_.
Referenced by ai::formula_ai::to_config().
|
inlineoverrideprivatevirtual |
Reimplemented from wfl::formula_callable.
Definition at line 297 of file callable.hpp.
References wfl::formula_callable::add_input(), fallback_, i, wfl::formula_callable::inputs(), wfl::read_write, and values_.
|
inlineoverrideprivatevirtual |
Implements wfl::formula_callable.
Definition at line 285 of file callable.hpp.
|
inline |
Definition at line 265 of file callable.hpp.
References fallback_.
Referenced by wfl::formula_function_expression::execute().
|
inlineoverrideprivatevirtual |
Reimplemented from wfl::formula_callable.
Definition at line 280 of file callable.hpp.
References values_.
|
private |
Definition at line 309 of file callable.hpp.
Referenced by get_inputs(), get_value(), and set_fallback().
|
private |
Definition at line 308 of file callable.hpp.
Referenced by add(), begin(), clear(), empty(), end(), get_inputs(), get_value(), and set_value().