The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
variable_info< vit > Class Template Reference

#include <variable_info.hpp>

Inheritance diagram for variable_info< vit >:
Inheritance graph

Public Types

typedef
variable_info_detail::maybe_const
< vit, config >::type 
t_config
 

Public Member Functions

 variable_info (const std::string &varname, t_config &vars)
 Doesn't throw. More...
 
 ~variable_info ()
 
std::string get_error_message () const
 
bool explicit_index () const
 Doesn't throw. More...
 
bool exists_as_attribute () const
 might throw invalid_variablename_exception More...
 
bool exists_as_container () const
 might throw invalid_variablename_exception More...
 
variable_info_detail::maybe_const
< vit, config::attribute_value >
::type
as_scalar () const
 might throw invalid_variablename_exception NOTE: If vit == vit_const, then the lifime of the returned const attribute_value& might end with the lifetime of this object. More...
 
variable_info_detail::maybe_const
< vit, config >::type
as_container () const
 might throw invalid_variablename_exception More...
 
variable_info_detail::maybe_const
< vit, config::child_itors >
::type 
as_array () const
 might throw invalid_variablename_exception More...
 
template<>
std::string get_error_message () const
 
template<>
std::string get_error_message () const
 
template<>
std::string get_error_message () const
 

Protected Member Functions

void throw_on_invalid () const
 
void calculate_value ()
 

Protected Attributes

std::string name_
 
variable_info_detail::variable_info_state
< vit > 
state_
 
bool valid_
 

Detailed Description

template<const variable_info_detail::variable_info_type vit>
class variable_info< vit >

Definition at line 36 of file variable_info.hpp.

Member Typedef Documentation

template<const variable_info_detail::variable_info_type vit>
typedef variable_info_detail::maybe_const<vit,config>::type variable_info< vit >::t_config

Definition at line 40 of file variable_info.hpp.

Constructor & Destructor Documentation

template<const variable_info_type vit>
variable_info< vit >::variable_info ( const std::string varname,
t_config vars 
)

Doesn't throw.

Definition at line 507 of file variable_info.cpp.

References variable_info< vit >::calculate_value(), and variable_info< vit >::valid_.

template<const variable_info_type vit>
variable_info< vit >::~variable_info ( )

Definition at line 523 of file variable_info.cpp.

Member Function Documentation

template<const variable_info_type vit>
maybe_const< vit, config::child_itors >::type variable_info< vit >::as_array ( ) const
template<const variable_info_type vit>
maybe_const< vit, config >::type & variable_info< vit >::as_container ( ) const
template<const variable_info_type vit>
maybe_const< vit, config::attribute_value >::type & variable_info< vit >::as_scalar ( ) const

might throw invalid_variablename_exception NOTE: If vit == vit_const, then the lifime of the returned const attribute_value& might end with the lifetime of this object.

Definition at line 579 of file variable_info.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), game_data::get_variable(), game_data::get_variable_const(), luaW_checkvariable(), luaW_pushvariable(), and game_events::WML_HANDLER_FUNCTION().

template<const variable_info_type vit>
void variable_info< vit >::calculate_value ( )
protected

Definition at line 528 of file variable_info.cpp.

Referenced by variable_info< vit >::variable_info().

template<const variable_info_type vit>
bool variable_info< vit >::exists_as_attribute ( ) const
template<const variable_info_type vit>
bool variable_info< vit >::exists_as_container ( ) const

might throw invalid_variablename_exception

Definition at line 668 of file variable_info.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), and luaW_pushvariable().

template<const variable_info_type vit>
bool variable_info< vit >::explicit_index ( ) const
template<const variable_info_detail::variable_info_type vit>
std::string variable_info< vit >::get_error_message ( ) const
template<>
std::string variable_info< vit_const >::get_error_message ( ) const

Definition at line 609 of file variable_info.cpp.

template<>
std::string variable_info< vit_create_if_not_existent >::get_error_message ( ) const

Definition at line 615 of file variable_info.cpp.

template<>
std::string variable_info< vit_throw_if_not_existent >::get_error_message ( ) const

Definition at line 621 of file variable_info.cpp.

template<const variable_info_type vit>
void variable_info< vit >::throw_on_invalid ( ) const
protected

Definition at line 600 of file variable_info.cpp.

Member Data Documentation

template<const variable_info_detail::variable_info_type vit>
std::string variable_info< vit >::name_
protected

Definition at line 64 of file variable_info.hpp.

template<const variable_info_detail::variable_info_type vit>
variable_info_detail::variable_info_state<vit> variable_info< vit >::state_
protected

Definition at line 65 of file variable_info.hpp.

template<const variable_info_detail::variable_info_type vit>
bool variable_info< vit >::valid_
protected

Definition at line 67 of file variable_info.hpp.

Referenced by variable_info< vit >::variable_info().


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