The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
lua_formula_bridge.hpp
Go to the documentation of this file.
1 /*
2  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY.
10 
11  See the COPYING file for more details.
12  */
13 
14 #ifndef LUA_FORMULA_BRIDGE_HPP_INCLUDED
15 #define LUA_FORMULA_BRIDGE_HPP_INCLUDED
16 
17 #include <string>
18 #include <boost/shared_ptr.hpp>
19 
20 struct lua_State;
21 
22 class variant;
23 namespace game_logic {
24  class formula;
25  class function_symbol_table;
26  class formula_debugger;
27  class formula_callable;
28 }
29 
30 namespace lua_formula_bridge {
31 
35 
36  class fwrapper {
38  public:
39  fwrapper(const std::string& code, game_logic::function_symbol_table* functions = nullptr);
40  std::string str() const;
41  variant evaluate(const game_logic::formula_callable& variables, game_logic::formula_debugger* fdb = nullptr) const;
42  };
43 
44 } // end namespace lua_formula_bridge
45 
46 #endif
boost::shared_ptr< game_logic::formula > formula_ptr
int intf_eval_formula(lua_State *)
Evaluates a formula in the formula engine.
variant evaluate(const game_logic::formula_callable &variables, game_logic::formula_debugger *fdb=nullptr) const
int intf_compile_formula(lua_State *)
std::string register_metatables(lua_State *)
fwrapper(const std::string &code, game_logic::function_symbol_table *functions=nullptr)
GLsizei const GLcharARB ** string
Definition: glew.h:4503