The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Private Attributes | List of all members
util::const_iterator_extend< Value, Container, Deref, Key > Class Template Reference

This is a const_iterator class that extends an existing const_iterator by overriding dereference. More...

#include <iterator.hpp>

Public Types

typedef Container::const_iterator base_iter_type
 
typedef const Value value_type
 
typedef value_typepointer
 
typedef value_typereference
 
typedef
base_iter_type::difference_type 
difference_type
 
typedef
base_iter_type::iterator_category 
iterator_category
 

Public Member Functions

 const_iterator_extend ()
 Default constructor. More...
 
 const_iterator_extend (const base_iter_type &iter)
 Initialized constructor. More...
 
 const_iterator_extend (const iterator_extend< Value, Container, Deref, Key > &iter)
 Conversion from iterator_extend (same parameters). More...
 
bool operator== (const const_iterator_extend &that) const
 
bool operator!= (const const_iterator_extend &that) const
 
bool operator< (const const_iterator_extend &that) const
 
bool operator> (const const_iterator_extend &that) const
 
bool operator<= (const const_iterator_extend &that) const
 
bool operator>= (const const_iterator_extend &that) const
 
reference operator* () const
 
pointer operator-> () const
 
const_iterator_extendoperator++ ()
 
const_iterator_extendoperator-- ()
 
const_iterator_extend operator++ (int)
 
const_iterator_extend operator-- (int)
 
const_iterator_extendoperator+= (difference_type n)
 
const_iterator_extendoperator-= (difference_type n)
 
const_iterator_extend operator+ (difference_type n) const
 
const_iterator_extend operator- (difference_type n) const
 
difference_type operator- (const const_iterator_extend &that) const
 
reference operator[] (difference_type n) const
 
const base_iter_typeget (const Key &) const
 

Private Attributes

base_iter_type iter_
 The underlying base iterator. More...
 

Detailed Description

template<typename Value, class Container, class Deref, class Key>
class util::const_iterator_extend< Value, Container, Deref, Key >

This is a const_iterator class that extends an existing const_iterator by overriding dereference.

Access to the underlying iterator is controlled, promoting a black-box approach.

The expected use of this class is as a typedef. If used in conjunction with a typedef of iterator_extend (with the same template parameters), you get conversion from your regular iterator.

Value = Intended value_type, minus "const". Container = The container whose const_iterator is being extended. Deref = A class whose member static const Value& eval(const Container::const_iterator &) can be used for dereferencing. (This same class can be used for iterator_extend.) Key = A class that unlocks the underlying const_iterator. (This way the underlying const_iterator is not exposed to everyone.) If Key is accessible, then the underlying const_iterator can be obtained via get(const Key &).

Definition at line 27 of file iterator.hpp.

Member Typedef Documentation

template<typename Value, class Container, class Deref, class Key>
typedef Container::const_iterator util::const_iterator_extend< Value, Container, Deref, Key >::base_iter_type

Definition at line 128 of file iterator.hpp.

template<typename Value, class Container, class Deref, class Key>
typedef base_iter_type::difference_type util::const_iterator_extend< Value, Container, Deref, Key >::difference_type

Definition at line 134 of file iterator.hpp.

template<typename Value, class Container, class Deref, class Key>
typedef base_iter_type::iterator_category util::const_iterator_extend< Value, Container, Deref, Key >::iterator_category

Definition at line 135 of file iterator.hpp.

template<typename Value, class Container, class Deref, class Key>
typedef value_type* util::const_iterator_extend< Value, Container, Deref, Key >::pointer

Definition at line 132 of file iterator.hpp.

template<typename Value, class Container, class Deref, class Key>
typedef value_type& util::const_iterator_extend< Value, Container, Deref, Key >::reference

Definition at line 133 of file iterator.hpp.

template<typename Value, class Container, class Deref, class Key>
typedef const Value util::const_iterator_extend< Value, Container, Deref, Key >::value_type

Definition at line 131 of file iterator.hpp.

Constructor & Destructor Documentation

template<typename Value, class Container, class Deref, class Key>
util::const_iterator_extend< Value, Container, Deref, Key >::const_iterator_extend ( )
inline
template<typename Value, class Container, class Deref, class Key>
util::const_iterator_extend< Value, Container, Deref, Key >::const_iterator_extend ( const base_iter_type iter)
inlineexplicit

Initialized constructor.

Definition at line 140 of file iterator.hpp.

template<typename Value, class Container, class Deref, class Key>
util::const_iterator_extend< Value, Container, Deref, Key >::const_iterator_extend ( const iterator_extend< Value, Container, Deref, Key > &  iter)
inline

Conversion from iterator_extend (same parameters).

Definition at line 142 of file iterator.hpp.

Member Function Documentation

template<typename Value, class Container, class Deref, class Key>
const base_iter_type& util::const_iterator_extend< Value, Container, Deref, Key >::get ( const Key &  ) const
inline
template<typename Value, class Container, class Deref, class Key>
bool util::const_iterator_extend< Value, Container, Deref, Key >::operator!= ( const const_iterator_extend< Value, Container, Deref, Key > &  that) const
inline
template<typename Value, class Container, class Deref, class Key>
reference util::const_iterator_extend< Value, Container, Deref, Key >::operator* ( ) const
inline
template<typename Value, class Container, class Deref, class Key>
const_iterator_extend util::const_iterator_extend< Value, Container, Deref, Key >::operator+ ( difference_type  n) const
inline
template<typename Value, class Container, class Deref, class Key>
const_iterator_extend& util::const_iterator_extend< Value, Container, Deref, Key >::operator++ ( )
inline
template<typename Value, class Container, class Deref, class Key>
const_iterator_extend util::const_iterator_extend< Value, Container, Deref, Key >::operator++ ( int  )
inline
template<typename Value, class Container, class Deref, class Key>
const_iterator_extend& util::const_iterator_extend< Value, Container, Deref, Key >::operator+= ( difference_type  n)
inline
template<typename Value, class Container, class Deref, class Key>
const_iterator_extend util::const_iterator_extend< Value, Container, Deref, Key >::operator- ( difference_type  n) const
inline
template<typename Value, class Container, class Deref, class Key>
difference_type util::const_iterator_extend< Value, Container, Deref, Key >::operator- ( const const_iterator_extend< Value, Container, Deref, Key > &  that) const
inline
template<typename Value, class Container, class Deref, class Key>
const_iterator_extend& util::const_iterator_extend< Value, Container, Deref, Key >::operator-- ( )
inline
template<typename Value, class Container, class Deref, class Key>
const_iterator_extend util::const_iterator_extend< Value, Container, Deref, Key >::operator-- ( int  )
inline
template<typename Value, class Container, class Deref, class Key>
const_iterator_extend& util::const_iterator_extend< Value, Container, Deref, Key >::operator-= ( difference_type  n)
inline
template<typename Value, class Container, class Deref, class Key>
pointer util::const_iterator_extend< Value, Container, Deref, Key >::operator-> ( ) const
inline

Definition at line 157 of file iterator.hpp.

template<typename Value, class Container, class Deref, class Key>
bool util::const_iterator_extend< Value, Container, Deref, Key >::operator< ( const const_iterator_extend< Value, Container, Deref, Key > &  that) const
inline
template<typename Value, class Container, class Deref, class Key>
bool util::const_iterator_extend< Value, Container, Deref, Key >::operator<= ( const const_iterator_extend< Value, Container, Deref, Key > &  that) const
inline
template<typename Value, class Container, class Deref, class Key>
bool util::const_iterator_extend< Value, Container, Deref, Key >::operator== ( const const_iterator_extend< Value, Container, Deref, Key > &  that) const
inline
template<typename Value, class Container, class Deref, class Key>
bool util::const_iterator_extend< Value, Container, Deref, Key >::operator> ( const const_iterator_extend< Value, Container, Deref, Key > &  that) const
inline
template<typename Value, class Container, class Deref, class Key>
bool util::const_iterator_extend< Value, Container, Deref, Key >::operator>= ( const const_iterator_extend< Value, Container, Deref, Key > &  that) const
inline
template<typename Value, class Container, class Deref, class Key>
reference util::const_iterator_extend< Value, Container, Deref, Key >::operator[] ( difference_type  n) const
inline

Definition at line 170 of file iterator.hpp.

Member Data Documentation

template<typename Value, class Container, class Deref, class Key>
base_iter_type util::const_iterator_extend< Value, Container, Deref, Key >::iter_
private

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