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

#include <property_handler.hpp>

Inheritance diagram for ai::vector_property_handler< T >:
Inheritance graph

Public Types

typedef std::shared_ptr< T > ptr
 
typedef std::vector< std::shared_ptr< T > > ptr_vector
 

Public Member Functions

 vector_property_handler (const std::string &property, ptr_vector &values, std::function< void(ptr_vector &, const config &)> &construction_factory)
 
componenthandle_get (const path_element &child)
 
bool handle_change (const path_element &child, config cfg)
 
bool handle_add (const path_element &child, const config &cfg)
 
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 ()
 

Protected Member Functions

void call_factory (ptr_vector &vec, const config &cfg)
 

Private Member Functions

bool do_add (int pos, const config &cfg)
 

Private Attributes

std::function< void(ptr_vector &, const config &)> factory_
 
const std::string property_
 
ptr_vectorvalues_
 

Detailed Description

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

Definition at line 74 of file property_handler.hpp.

Member Typedef Documentation

◆ ptr

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

Definition at line 76 of file property_handler.hpp.

◆ ptr_vector

template<typename T>
typedef std::vector< std::shared_ptr<T> > ai::vector_property_handler< T >::ptr_vector

Definition at line 77 of file property_handler.hpp.

Constructor & Destructor Documentation

◆ vector_property_handler()

template<typename T>
ai::vector_property_handler< T >::vector_property_handler ( const std::string &  property,
ptr_vector values,
std::function< void(ptr_vector &, const config &)> &  construction_factory 
)
inline

Definition at line 79 of file property_handler.hpp.

Member Function Documentation

◆ call_factory()

template<typename T>
void ai::vector_property_handler< T >::call_factory ( ptr_vector vec,
const config cfg 
)
inlineprotected

Definition at line 144 of file property_handler.hpp.

◆ do_add()

template<typename T>
bool ai::vector_property_handler< T >::do_add ( int  pos,
const config cfg 
)
inlineprivate

Definition at line 149 of file property_handler.hpp.

References b.

◆ handle_add()

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

◆ handle_change()

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

◆ handle_delete()

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

Implements ai::base_property_handler.

Definition at line 117 of file property_handler.hpp.

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

◆ handle_get()

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

Implements ai::base_property_handler.

Reimplemented in ai::facets_property_handler< T >.

Definition at line 83 of file property_handler.hpp.

References i.

Referenced by ai::facets_property_handler< T >::handle_get().

◆ handle_get_children()

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

Member Data Documentation

◆ factory_

template<typename T>
std::function<void(ptr_vector&, const config&)> ai::vector_property_handler< T >::factory_
private

Definition at line 164 of file property_handler.hpp.

◆ property_

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

Definition at line 165 of file property_handler.hpp.

◆ values_

template<typename T>
ptr_vector& ai::vector_property_handler< T >::values_
private

Definition at line 166 of file property_handler.hpp.


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