This is a wrapper for a list of weak pointers to handlers. More...
#include <handlers.hpp>
Classes | |
class | iterator |
Handler list iterators are rather limited. More... | |
Public Types | |
typedef iterator | const_iterator |
Public Member Functions | |
handler_list () | |
Default constructor. More... | |
const_iterator | begin () const |
const_iterator | end () const |
void | push_front (const handler_ptr &p) |
void | push_back (const handler_ptr &p) |
void | clear () |
Private Types | |
typedef boost::weak_ptr < event_handler > | internal_ptr |
The weak pointers that are used internally. More... | |
typedef utils::smart_list < internal_ptr > | list_t |
The underlying list. More... | |
Private Member Functions | |
handler_list & | operator= (const handler_list &) |
No implementation of operator=() since smart_list does not support it. More... | |
Private Attributes | |
list_t | data_ |
The actual list. More... | |
Friends | |
class | iterator |
This is a wrapper for a list of weak pointers to handlers.
It allows forward iterations of the list, with each element returned as a shared pointer. (Weak pointers that fail to lock are silently removed from the list.) These iterations can be used recursively, even when the innermost iteration might erase arbitrary elements from the list.
The interface is not the standard list interface because that would be inconvenient. The functionality implemented is that required by Wesnoth.
Definition at line 88 of file handlers.hpp.
Definition at line 121 of file handlers.hpp.
|
private |
The weak pointers that are used internally.
Definition at line 91 of file handlers.hpp.
|
private |
The underlying list.
Definition at line 93 of file handlers.hpp.
|
inline |
Default constructor.
Note: This explicit definition is required (by the more pedantic compilers) in order to declare a default-constructed, static, and const variable in t_event_handlers::get(), in handlers.cpp.
Definition at line 128 of file handlers.hpp.
|
inline |
|
inline |
Definition at line 139 of file handlers.hpp.
References utils::smart_list< Data >::clear(), and data_.
|
inline |
|
private |
No implementation of operator=() since smart_list does not support it.
|
inline |
Definition at line 137 of file handlers.hpp.
References data_, and utils::smart_list< Data >::push_back().
Referenced by game_events::t_event_handlers::add_event_handler().
|
inline |
Definition at line 136 of file handlers.hpp.
References data_, and utils::smart_list< Data >::push_front().
|
friend |
Definition at line 120 of file handlers.hpp.
|
private |
The actual list.
Definition at line 146 of file handlers.hpp.
Referenced by begin(), clear(), end(), push_back(), and push_front().