#include <formula.hpp>
Public Member Functions | |
tformula (const std::string &str) | |
T | operator() () const |
Returns the value, can only be used it the data is no formula. | |
T | operator() (const game_logic::map_formula_callable &variables) const |
Returns the value, can always be used. | |
bool | has_formula () const |
Determine whether the class contains a formula. | |
template<> | |
bool | execute (const game_logic::map_formula_callable &variables) const |
template<> | |
int | execute (const game_logic::map_formula_callable &variables) const |
template<> | |
unsigned | execute (const game_logic::map_formula_callable &variables) const |
template<> | |
std::string | execute (const game_logic::map_formula_callable &variables) const |
template<> | |
t_string | execute (const game_logic::map_formula_callable &variables) const |
template<> | |
void | convert (const std::string &str) |
template<> | |
void | convert (const std::string &str) |
template<> | |
void | convert (const std::string &str) |
Private Member Functions | |
void | convert (const std::string &str) |
Converts the string ot the template value. | |
T | execute (const game_logic::map_formula_callable &variables) const |
Private Attributes | |
std::string | formula_ |
If there is a formula it's stored in this string, empty if no formula. | |
T | value_ |
If no formula it contains the value. |
Definition at line 30 of file gui/widgets/formula.hpp.
gui2::tformula< T >::tformula | ( | const std::string & | str | ) | [inline] |
Definition at line 70 of file gui/widgets/formula.hpp.
References gui2::tformula< T >::convert(), and gui2::tformula< T >::formula_.
T gui2::tformula< T >::operator() | ( | ) | const [inline] |
Returns the value, can only be used it the data is no formula.
Another option would be to cache the output of the formula in value_ and always allow this function. But for now decided that the caller needs to do the caching. It might be changed later.
Definition at line 42 of file gui/widgets/formula.hpp.
T gui2::tformula< T >::operator() | ( | const game_logic::map_formula_callable & | variables | ) | const [inline] |
Returns the value, can always be used.
Definition at line 87 of file gui/widgets/formula.hpp.
References debug, gui2::tformula< T >::execute(), gui2::tformula< T >::formula_, lg::gui_draw, gui2::tformula< T >::has_formula(), LOG_STREAM_INDENT, and gui2::tformula< T >::value_.
bool gui2::tformula< T >::has_formula | ( | ) | const [inline] |
Determine whether the class contains a formula.
Definition at line 52 of file gui/widgets/formula.hpp.
Referenced by gui2::tformula< T >::operator()(), and gui2::tformula< unsigned >::operator()().
void gui2::tformula< T >::convert | ( | const std::string & | str | ) | [inline, private] |
Converts the string ot the template value.
Definition at line 155 of file gui/widgets/formula.hpp.
References gui2::tformula< T >::value_.
Referenced by gui2::tformula< T >::tformula().
T gui2::tformula< T >::execute | ( | const game_logic::map_formula_callable & | variables | ) | const [inline, private] |
Definition at line 128 of file gui/widgets/formula.hpp.
Referenced by gui2::tformula< T >::operator()().
bool gui2::tformula< bool >::execute | ( | const game_logic::map_formula_callable & | variables | ) | const [inline] |
int gui2::tformula< int >::execute | ( | const game_logic::map_formula_callable & | variables | ) | const [inline] |
unsigned gui2::tformula< unsigned >::execute | ( | const game_logic::map_formula_callable & | variables | ) | const [inline] |
std::string gui2::tformula< std::string >::execute | ( | const game_logic::map_formula_callable & | variables | ) | const [inline] |
t_string gui2::tformula< t_string >::execute | ( | const game_logic::map_formula_callable & | variables | ) | const [inline] |
void gui2::tformula< bool >::convert | ( | const std::string & | str | ) | [inline] |
Definition at line 137 of file gui/widgets/formula.hpp.
References utils::string_bool(), and gui2::tformula< T >::value_.
void gui2::tformula< std::string >::convert | ( | const std::string & | str | ) | [inline] |
void gui2::tformula< t_string >::convert | ( | const std::string & | str | ) | [inline] |
std::string gui2::tformula< T >::formula_ [private] |
If there is a formula it's stored in this string, empty if no formula.
Definition at line 62 of file gui/widgets/formula.hpp.
Referenced by gui2::tformula< T >::execute(), gui2::tformula< unsigned >::has_formula(), gui2::tformula< T >::operator()(), and gui2::tformula< T >::tformula().
T gui2::tformula< T >::value_ [private] |
If no formula it contains the value.
Definition at line 65 of file gui/widgets/formula.hpp.
Referenced by gui2::tformula< T >::convert(), gui2::tformula< T >::operator()(), and gui2::tformula< unsigned >::operator()().
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |