The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Namespaces | Macros | Typedefs
function.hpp File Reference
#include "formula/callable.hpp"
#include "formula/formula.hpp"
#include <set>
#include <string>
Include dependency graph for function.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  wfl::call_stack_manager
 
class  wfl::formula_expression
 
class  wfl::function_expression
 
class  wfl::key_value_pair
 
class  wfl::formula_function_expression
 
class  wfl::formula_function
 
class  wfl::user_formula_function
 
class  wfl::builtin_formula_function< T >
 
class  wfl::function_symbol_table
 
class  wfl::action_function_symbol_table
 
class  wfl::wrapper_formula
 

Namespaces

 wfl
 

Macros

#define DEFINE_WFL_FUNCTION(name, min_args, max_args)
 Helper macro to declare an associated class for a WFL function. More...
 
#define DECLARE_WFL_FUNCTION(name)   functions_table.add_function(#name, std::make_shared<builtin_formula_function<name##_function>>(#name))
 Declares a function name in the local function table functions_table. More...
 

Typedefs

typedef std::shared_ptr
< function_expression > 
wfl::function_expression_ptr
 
typedef std::shared_ptr
< formula_function > 
wfl::formula_function_ptr
 
typedef std::map< std::string,
formula_function_ptr > 
wfl::functions_map
 

Macro Definition Documentation

#define DECLARE_WFL_FUNCTION (   name)    functions_table.add_function(#name, std::make_shared<builtin_formula_function<name##_function>>(#name))

Declares a function name in the local function table functions_table.

The function must be defined by a name_function class which is accessible in the current scope.

Definition at line 47 of file function.hpp.

Referenced by wfl::action_function_symbol_table::action_function_symbol_table(), wfl::ai_function_symbol_table::ai_function_symbol_table(), wfl::gamestate_function_symbol_table::gamestate_function_symbol_table(), and wfl::function_symbol_table::get_builtins().

#define DEFINE_WFL_FUNCTION (   name,
  min_args,
  max_args 
)
Value:
class name##_function : public function_expression \
{ \
public: \
explicit name##_function(const args_list& args) \
: function_expression(#name, args, min_args, max_args) \
{ \
} \
\
private: \
variant execute(const formula_callable& variables, formula_debugger* fdb) const; \
}; \
\
variant name##_function::execute(const formula_callable& variables, formula_debugger* fdb) const
static const char * name(const std::vector< SDL_Joystick * > &joysticks, const size_t index)
Definition: joystick.cpp:48

Helper macro to declare an associated class for a WFL function.

Definition at line 27 of file function.hpp.