The Battle for Wesnoth  1.15.1+dev
Public Types | Public Member Functions | List of all members
variable_info_implementation::as_scalar_visitor< V > Class Template Reference

Tries to convert it to an (maybe const) attribute value. More...

#include <variable_info_private.hpp>

Inheritance diagram for variable_info_implementation::as_scalar_visitor< V >:
Inheritance graph

Public Types

using result_t = typename as_scalar_visitor::result_t
 
using param_t = typename as_scalar_visitor::param_t
 
- Public Types inherited from variable_info_implementation::info_visitor_base< R, P >
using result_t = R
 
using param_t = P &
 

Public Member Functions

result_t from_named (param_t state) const
 
result_t from_temporary (param_t) const
 Only implemented for read-only variable_info. More...
 
template<>
const config::attribute_valuefrom_temporary (as_scalar_visitor::param_t state) const
 Values like '.length' are readonly so we only support reading them, especially since we don't want to return non-const references. More...
 

Detailed Description

template<typename V>
class variable_info_implementation::as_scalar_visitor< V >

Tries to convert it to an (maybe const) attribute value.

Definition at line 195 of file variable_info_private.hpp.

Member Typedef Documentation

◆ param_t

Definition at line 200 of file variable_info_private.hpp.

◆ result_t

Definition at line 199 of file variable_info_private.hpp.

Member Function Documentation

◆ from_named()

template<typename V >
result_t variable_info_implementation::as_scalar_visitor< V >::from_named ( param_t  state) const
inline

Definition at line 202 of file variable_info_private.hpp.

◆ from_temporary() [1/2]

template<typename V >
result_t variable_info_implementation::as_scalar_visitor< V >::from_temporary ( param_t  ) const
inline

Only implemented for read-only variable_info.

Other types use the default throw implementation.

Definition at line 210 of file variable_info_private.hpp.

◆ from_temporary() [2/2]

template<>
const config::attribute_value & variable_info_implementation::as_scalar_visitor< const vi_policy_const >::from_temporary ( as_scalar_visitor< V >::param_t  state) const

Values like '.length' are readonly so we only support reading them, especially since we don't want to return non-const references.

Definition at line 221 of file variable_info_private.hpp.


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