16 #ifndef VARIABLE_H_INCLUDED
17 #define VARIABLE_H_INCLUDED
21 #include <boost/shared_ptr.hpp>
45 #if __GNUC__ == 4 && __GNUC_MINOR__ == 6 && defined(__GXX_EXPERIMENTAL_CXX0X__)
46 template<
class T1,
class T2>
47 friend class std::pair;
64 explicit operator bool()
const {
return !
null(); }
99 typedef std::pair<std::string, vconfig>
value_type;
146 std::pair<all_children_iterator,all_children_iterator>
all_ordered()
const {
boost::shared_ptr< const config > cache_
recursion_error(const std::string &msg)
size_t count_children(const std::string &key) const
vconfig(const config &cfg)
Constructor from a config.
vconfig get_child() const
vconfig child(const std::string &key) const
Returns a child of *this whose key is key.
config get_parsed_config() const
const std::string & name() const
all_children_iterator ordered_end() const
~vconfig()
Default destructor, but defined here for possibly faster compiles (templates sometimes can be rough o...
all_children_iterator(const Itor &i)
std::forward_iterator_tag iterator_category
GLint GLint GLint GLint GLint GLint y
const pointer_proxy pointer
GLint GLenum GLsizei GLint GLsizei const GLvoid * data
scoped_recall_unit(const std::string &var_name, const std::string &player, unsigned int recall_index)
std::pair< std::string, vconfig > value_type
Definitions for the interface to Wesnoth Markup Language (WML).
scoped_wml_variable(const std::string &var_name)
Variant for storing WML attributes.
bool memory_managed() const
Returns true if *this has made a copy of its config.
unsigned int recall_index_
const config * cfg_
Used to access our config (original or copy, as appropriate).
child_list get_children(const std::string &key) const
bool has_child(const std::string &key) const
Returns whether or not *this has a child whose key is key.
virtual void activate()=0
std::pair< all_children_iterator, all_children_iterator > all_ordered() const
config & store(const config &var_value=config())
const value_type * operator->() const
config::attribute_value expand(const std::string &) const
boost::shared_ptr< const config > cache_
Keeps a copy of our config alive when we manage our own memory.
const config & get_config() const
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
GLint GLint GLint GLint GLint x
const config::attribute_value operator[](const std::string &key) const
Note: vconfig::operator[] returns const, and this should not be changed because vconfig is often used...
scoped_weapon_info(const std::string &var_name, const config &data)
static vconfig unconstructed_vconfig()
This is just a wrapper for the default constructor; it exists for historical reasons and to make it c...
reference operator*() const
const std::string player_
config::all_children_iterator Itor
bool has_attribute(const std::string &key) const
bool operator==(const all_children_iterator &i) const
A variable-expanding proxy for the config class.
pointer operator->() const
Container associating units to locations.
static vconfig empty_vconfig()
static const config default_empty_config
std::vector< vconfig > child_list
A config object defines a single node in a WML file, with access to child nodes.
void make_safe() const
instruct the vconfig to make a private copy of its underlying data.
const std::string var_name_
bool operator!=(const all_children_iterator &i) const
GLsizei const GLcharARB ** string
virtual ~scoped_wml_variable()
std::string get_key() const
bool has_attribute(const std::string &key) const
< Synonym for operator[]
all_children_iterator ordered_begin() const
In-order iteration over all children.
const value_type reference
all_children_iterator & operator++()
scoped_xy_unit(const std::string &var_name, const int x, const int y, const unit_map &umap)