The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
game_events::handler_list::iterator Class Reference

Handler list iterators are rather limited. More...

#include <handlers.hpp>

Public Member Functions

 iterator (const list_t::iterator &base_iter)
 Initialized constructor (to be called by handler_list). More...
 
iteratoroperator++ ()
 Increment. More...
 
handler_ptr operator* ()
 Dereference. More...
 

Private Attributes

list_t::iterator iter_
 The current element. More...
 

Detailed Description

Handler list iterators are rather limited.

They can be constructed from a reference iterator (not default constructed), incremented, and dereferenced. Consecutive dereferences are not guaranteed to return the same element (if the list mutates between them, the next element might be returned). An increment guarantees that the next dereference will differ from the previous (unless at the end of the list). The end of the list is indicated by dereferencing to a null pointer.

Definition at line 104 of file handlers.hpp.

Constructor & Destructor Documentation

game_events::handler_list::iterator::iterator ( const list_t::iterator &  base_iter)
inlineexplicit

Initialized constructor (to be called by handler_list).

Definition at line 111 of file handlers.hpp.

Member Function Documentation

handler_ptr game_events::handler_list::iterator::operator* ( )

Dereference.

If the current element has become invalid, we will increment first.

Definition at line 59 of file handlers.cpp.

References utils::smart_list< internal_ptr >::erase(), and iter_.

iterator& game_events::handler_list::iterator::operator++ ( )
inline

Increment.

Definition at line 116 of file handlers.hpp.

References iter_.

Member Data Documentation

list_t::iterator game_events::handler_list::iterator::iter_
private

The current element.

Definition at line 107 of file handlers.hpp.

Referenced by operator*(), and operator++().


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