The Battle for Wesnoth  1.15.1+dev
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
unit_map::iterator_base< iter_types > Struct Template Reference

#include <map.hpp>

Public Types

typedef std::forward_iterator_tag iterator_category
 
typedef int difference_type
 
typedef iter_types::value_type value_type
 
typedef boost::intrusive_ptr< value_typepointer
 
typedef value_typereference
 
typedef iter_types::container_type container_type
 
typedef iter_types::iterator_type iterator_type
 

Public Member Functions

 ~iterator_base ()
 
 iterator_base ()
 
 iterator_base (iterator_type i, container_type *m)
 
 iterator_base (const iterator_base &that)
 
iterator_baseoperator= (const iterator_base &that)
 
 operator iterator_base< const_iter_types > () const
 
pointer operator-> () const
 
pointer get_shared_ptr () const
 This is exactly the same as operator-> but it's slightly more readable, and can replace &*iter syntax easily. More...
 
reference operator* () const
 
iterator_baseoperator++ ()
 
iterator_base operator++ (int)
 
iterator_baseoperator-- ()
 
iterator_base operator-- (int)
 
bool valid () const
 
 operator bool () const
 
bool operator== (const iterator_base &rhs) const
 
bool operator!= (const iterator_base &rhs) const
 

Private Member Functions

 iterator_base (lmap::iterator ui, container_type *m)
 Constructs an iterator from the location map. More...
 
bool valid_for_dereference () const
 
bool valid_entry () const
 
void valid_exit () const
 
bool valid_ref_count () const
 
void inc ()
 Increment the reference counter. More...
 
void dec ()
 Decrement the reference counter Delete the umap entry if the unit is gone and the reference counter is zero. More...
 
unit_map::umapthe_map () const
 

Private Attributes

iterator_type i_
 
container_typetank_
 local iterator More...
 

Friends

template<typename Y >
struct iterator_base
 
class unit_map
 

Detailed Description

template<typename iter_types>
struct unit_map::iterator_base< iter_types >

Definition at line 143 of file map.hpp.

Member Typedef Documentation

◆ container_type

template<typename iter_types>
typedef iter_types::container_type unit_map::iterator_base< iter_types >::container_type

Definition at line 150 of file map.hpp.

◆ difference_type

template<typename iter_types>
typedef int unit_map::iterator_base< iter_types >::difference_type

Definition at line 146 of file map.hpp.

◆ iterator_category

template<typename iter_types>
typedef std::forward_iterator_tag unit_map::iterator_base< iter_types >::iterator_category

Definition at line 145 of file map.hpp.

◆ iterator_type

template<typename iter_types>
typedef iter_types::iterator_type unit_map::iterator_base< iter_types >::iterator_type

Definition at line 151 of file map.hpp.

◆ pointer

template<typename iter_types>
typedef boost::intrusive_ptr<value_type> unit_map::iterator_base< iter_types >::pointer

Definition at line 148 of file map.hpp.

◆ reference

template<typename iter_types>
typedef value_type& unit_map::iterator_base< iter_types >::reference

Definition at line 149 of file map.hpp.

◆ value_type

template<typename iter_types>
typedef iter_types::value_type unit_map::iterator_base< iter_types >::value_type

Definition at line 147 of file map.hpp.

Constructor & Destructor Documentation

◆ ~iterator_base()

template<typename iter_types>
unit_map::iterator_base< iter_types >::~iterator_base ( )
inline

Definition at line 153 of file map.hpp.

◆ iterator_base() [1/4]

template<typename iter_types>
unit_map::iterator_base< iter_types >::iterator_base ( )
inline

Definition at line 158 of file map.hpp.

◆ iterator_base() [2/4]

template<typename iter_types>
unit_map::iterator_base< iter_types >::iterator_base ( iterator_type  i,
container_type m 
)
inline

Definition at line 164 of file map.hpp.

◆ iterator_base() [3/4]

template<typename iter_types>
unit_map::iterator_base< iter_types >::iterator_base ( const iterator_base< iter_types > &  that)
inline

Definition at line 172 of file map.hpp.

◆ iterator_base() [4/4]

template<typename iter_types>
unit_map::iterator_base< iter_types >::iterator_base ( lmap::iterator  ui,
container_type m 
)
inlineprivate

Constructs an iterator from the location map.

Definition at line 200 of file map.hpp.

Member Function Documentation

◆ dec()

template<typename iter_types>
void unit_map::iterator_base< iter_types >::dec ( )
inlineprivate

Decrement the reference counter Delete the umap entry if the unit is gone and the reference counter is zero.

Note
this deletion will advance i_ to the next umap entry.

Definition at line 336 of file map.hpp.

◆ get_shared_ptr()

template<typename iter_types>
pointer unit_map::iterator_base< iter_types >::get_shared_ptr ( ) const
inline

◆ inc()

template<typename iter_types>
void unit_map::iterator_base< iter_types >::inc ( )
inlineprivate

Increment the reference counter.

Definition at line 323 of file map.hpp.

◆ operator bool()

template<typename iter_types>
unit_map::iterator_base< iter_types >::operator bool ( ) const
inlineexplicit

Definition at line 281 of file map.hpp.

◆ operator iterator_base< const_iter_types >()

template<typename iter_types>
unit_map::iterator_base< iter_types >::operator iterator_base< const_iter_types > ( ) const
inline

Definition at line 193 of file map.hpp.

◆ operator!=()

template<typename iter_types>
bool unit_map::iterator_base< iter_types >::operator!= ( const iterator_base< iter_types > &  rhs) const
inline

Definition at line 291 of file map.hpp.

References operator==().

◆ operator*()

template<typename iter_types>
reference unit_map::iterator_base< iter_types >::operator* ( ) const
inline

Definition at line 225 of file map.hpp.

◆ operator++() [1/2]

template<typename iter_types>
iterator_base& unit_map::iterator_base< iter_types >::operator++ ( )
inline

Definition at line 232 of file map.hpp.

References unit_map::end().

◆ operator++() [2/2]

template<typename iter_types>
iterator_base unit_map::iterator_base< iter_types >::operator++ ( int  )
inline

Definition at line 247 of file map.hpp.

◆ operator--() [1/2]

template<typename iter_types>
iterator_base& unit_map::iterator_base< iter_types >::operator-- ( )
inline

Definition at line 254 of file map.hpp.

References unit_map::begin().

◆ operator--() [2/2]

template<typename iter_types>
iterator_base unit_map::iterator_base< iter_types >::operator-- ( int  )
inline

Definition at line 269 of file map.hpp.

◆ operator->()

template<typename iter_types>
pointer unit_map::iterator_base< iter_types >::operator-> ( ) const
inline

Definition at line 209 of file map.hpp.

◆ operator=()

template<typename iter_types>
iterator_base& unit_map::iterator_base< iter_types >::operator= ( const iterator_base< iter_types > &  that)
inline

◆ operator==()

template<typename iter_types>
bool unit_map::iterator_base< iter_types >::operator== ( const iterator_base< iter_types > &  rhs) const
inline

◆ the_map()

template<typename iter_types>
unit_map::umap& unit_map::iterator_base< iter_types >::the_map ( ) const
inlineprivate

Definition at line 347 of file map.hpp.

◆ valid()

template<typename iter_types>
bool unit_map::iterator_base< iter_types >::valid ( ) const
inline

Definition at line 276 of file map.hpp.

Referenced by replay::add_unit_checksum(), advance_unit(), advance_unit_at(), BOOST_AUTO_TEST_CASE(), playsingle_controller::hotkey_handler::can_execute_command(), play_controller::hotkey_handler::can_execute_command(), ai::readonly_context_impl::check_attack_action(), battle_context::choose_defender_weapon(), actions::shroud_clearer::clear_loc(), events::mouse_handler::current_unit_attacks_from(), ai::move_result::do_execute(), ai::stage_unit_formulas::do_play_stage(), do_replay_handle(), ai::ai_default_rca::move_leader_to_goals_phase::evaluate(), ai::ai_default_rca::move_leader_to_keep_phase::evaluate(), wb::attack::execute(), ai::ai_default_rca::leader_shares_keep_phase::execute(), ai::readwrite_context_impl::execute_attack_action(), ai::attack_analysis::execute_self(), unit_creator::find_location(), actions::find_recruit_location(), events::mouse_handler::find_unit(), events::mouse_handler::find_unit_nonowning(), game_board::find_visible_unit(), lua_unit::get(), ai::unit_advancements_aspect::get_advancements(), lua_unit::get_shared(), wb::suppose_dead::get_unit(), wb::move::get_unit(), actions::get_village(), display_context::get_visible_unit(), game_board::has_visible_unit(), ai::helper_check_village(), events::mouse_handler::hex_hosts_unit(), game_lua_kernel::intf_find_cost_map(), game_lua_kernel::intf_find_path(), game_lua_kernel::intf_find_reach(), game_lua_kernel::intf_get_displayed_unit(), game_lua_kernel::intf_get_unit(), terrain_filter::match_internal(), unit_animation::matches(), game_events::entity_location::matches_unit(), game_events::entity_location::matches_unit_filter(), events::mouse_handler::mouse_motion(), actions::place_recruit(), wb::manager::post_draw(), wb::manager::pre_draw(), play_controller::process_keyup_event(), ai::readonly_context_impl::recalculate_move_maps(), game_display::scroll_to_leader(), events::mouse_handler::select_hex(), game_board::side_change_controller(), game_board::side_drop_to(), attack_type::special_active(), SYNCED_COMMAND_HANDLER_FUNCTION(), events::mouse_handler::touch_action(), events::mouse_handler::touch_motion(), unit_display::unit_attack(), display_context::unit_can_move(), pathfind::vision_path::vision_path(), unit_helper::will_certainly_advance(), and display_context::would_be_discovered().

◆ valid_entry()

template<typename iter_types>
bool unit_map::iterator_base< iter_types >::valid_entry ( ) const
inlineprivate

Definition at line 305 of file map.hpp.

References unit_map::end().

◆ valid_exit()

template<typename iter_types>
void unit_map::iterator_base< iter_types >::valid_exit ( ) const
inlineprivate

Definition at line 310 of file map.hpp.

References unit_map::end().

◆ valid_for_dereference()

template<typename iter_types>
bool unit_map::iterator_base< iter_types >::valid_for_dereference ( ) const
inlineprivate

Definition at line 300 of file map.hpp.

◆ valid_ref_count()

template<typename iter_types>
bool unit_map::iterator_base< iter_types >::valid_ref_count ( ) const
inlineprivate

Definition at line 317 of file map.hpp.

Friends And Related Function Documentation

◆ iterator_base

template<typename iter_types>
template<typename Y >
friend struct iterator_base
friend

Definition at line 297 of file map.hpp.

◆ unit_map

template<typename iter_types>
friend class unit_map
friend

Definition at line 352 of file map.hpp.

Member Data Documentation

◆ i_

template<typename iter_types>
iterator_type unit_map::iterator_base< iter_types >::i_
private

◆ tank_

template<typename iter_types>
container_type* unit_map::iterator_base< iter_types >::tank_
private

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