The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
wfl::map_formula_callable Class Reference

#include <callable.hpp>

Inheritance diagram for wfl::map_formula_callable:
Inheritance graph

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_callableadd (const std::string &key, const 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, variantvalues_
 
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_TYPE access_type=FORMULA_READ_ONLY)
 
- Protected Attributes inherited from wfl::formula_callable
TYPE type_
 
std::set
< callable_die_subscriber * > 
dtor_notify
 

Detailed Description

Definition at line 243 of file callable.hpp.

Member Typedef Documentation

Definition at line 267 of file callable.hpp.

Constructor & Destructor Documentation

wfl::map_formula_callable::map_formula_callable ( const_formula_callable_ptr  fallback = nullptr)
inlineexplicit

Definition at line 246 of file callable.hpp.

Member Function Documentation

map_formula_callable& wfl::map_formula_callable::add ( const std::string &  key,
const variant value 
)
inline
const_iterator wfl::map_formula_callable::begin ( ) const
inline

Definition at line 269 of file callable.hpp.

References values_.

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

void wfl::map_formula_callable::clear ( )
inline

Definition at line 265 of file callable.hpp.

References values_.

bool wfl::map_formula_callable::empty ( ) const
inline

Definition at line 263 of file callable.hpp.

References values_.

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

const_iterator wfl::map_formula_callable::end ( ) const
inline

Definition at line 270 of file callable.hpp.

References values_.

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

void wfl::map_formula_callable::get_inputs ( formula_input_vector inputs) const
inlineoverrideprivatevirtual

Reimplemented from wfl::formula_callable.

Definition at line 290 of file callable.hpp.

References wfl::formula_callable::add_input(), fallback_, wfl::FORMULA_READ_WRITE, i, and values_.

variant wfl::map_formula_callable::get_value ( const std::string &  key) const
inlineoverrideprivatevirtual

Implements wfl::formula_callable.

Definition at line 278 of file callable.hpp.

References fallback_, and values_.

void wfl::map_formula_callable::set_fallback ( const_formula_callable_ptr  fallback)
inline

Definition at line 258 of file callable.hpp.

References fallback_.

Referenced by wfl::formula_function_expression::execute().

void wfl::map_formula_callable::set_value ( const std::string &  key,
const variant value 
)
inlineoverrideprivatevirtual

Reimplemented from wfl::formula_callable.

Definition at line 273 of file callable.hpp.

References values_.

Member Data Documentation

const_formula_callable_ptr wfl::map_formula_callable::fallback_
private

Definition at line 302 of file callable.hpp.

Referenced by get_inputs(), get_value(), and set_fallback().

std::map<std::string, variant> wfl::map_formula_callable::values_
private

Definition at line 301 of file callable.hpp.

Referenced by add(), begin(), clear(), empty(), end(), get_inputs(), get_value(), and set_value().


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