The Battle for Wesnoth  1.17.0-dev
Public Types | Public Member Functions | Private Attributes | List of all members
ai::aspect_property_handler< T > Class Template Reference

#include <property_handler.hpp>

Inheritance diagram for ai::aspect_property_handler< T >:

Public Types

typedef std::shared_ptr< T > ptr
 
typedef std::map< std::string, ptraspect_map
 

Public Member Functions

 aspect_property_handler (const std::string &property, aspect_map &aspects, std::function< void(aspect_map &, const config &, std::string)> &construction_factory)
 
componenthandle_get (const path_element &child)
 
bool handle_change (const path_element &child, config cfg)
 
bool handle_add (const path_element &, const config &)
 
bool handle_delete (const path_element &child)
 
std::vector< component * > handle_get_children ()
 
- Public Member Functions inherited from ai::base_property_handler
virtual ~base_property_handler ()
 

Private Attributes

const std::string & property_
 
aspect_mapaspects_
 
std::function< void(aspect_map &, const config &, std::string)> factory_
 

Detailed Description

template<typename T>
class ai::aspect_property_handler< T >

Definition at line 212 of file property_handler.hpp.

Member Typedef Documentation

◆ aspect_map

template<typename T >
typedef std::map< std::string, ptr > ai::aspect_property_handler< T >::aspect_map

Definition at line 215 of file property_handler.hpp.

◆ ptr

template<typename T >
typedef std::shared_ptr<T> ai::aspect_property_handler< T >::ptr

Definition at line 214 of file property_handler.hpp.

Constructor & Destructor Documentation

◆ aspect_property_handler()

template<typename T >
ai::aspect_property_handler< T >::aspect_property_handler ( const std::string &  property,
aspect_map aspects,
std::function< void(aspect_map &, const config &, std::string)> &  construction_factory 
)
inline

Definition at line 217 of file property_handler.hpp.

Member Function Documentation

◆ handle_add()

template<typename T >
bool ai::aspect_property_handler< T >::handle_add ( const path_element ,
const config  
)
inlinevirtual

Implements ai::base_property_handler.

Definition at line 244 of file property_handler.hpp.

◆ handle_change()

template<typename T >
bool ai::aspect_property_handler< T >::handle_change ( const path_element child,
config  cfg 
)
inlinevirtual

Implements ai::base_property_handler.

Definition at line 231 of file property_handler.hpp.

References config::has_attribute(), and ai::path_element::id.

◆ handle_delete()

template<typename T >
bool ai::aspect_property_handler< T >::handle_delete ( const path_element child)
inlinevirtual

Implements ai::base_property_handler.

Definition at line 249 of file property_handler.hpp.

References a, b, and ai::path_element::id.

◆ handle_get()

template<typename T >
component* ai::aspect_property_handler< T >::handle_get ( const path_element child)
inlinevirtual

Implements ai::base_property_handler.

Definition at line 222 of file property_handler.hpp.

References a, and ai::path_element::id.

◆ handle_get_children()

template<typename T >
std::vector<component*> ai::aspect_property_handler< T >::handle_get_children ( )
inlinevirtual

Implements ai::base_property_handler.

Definition at line 262 of file property_handler.hpp.

References a.

Member Data Documentation

◆ aspects_

template<typename T >
aspect_map& ai::aspect_property_handler< T >::aspects_
private

Definition at line 274 of file property_handler.hpp.

◆ factory_

template<typename T >
std::function<void(aspect_map&, const config&, std::string)> ai::aspect_property_handler< T >::factory_
private

Definition at line 275 of file property_handler.hpp.

◆ property_

template<typename T >
const std::string& ai::aspect_property_handler< T >::property_
private

Definition at line 273 of file property_handler.hpp.


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