OpenTTD Source: Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolIteratorFiltered< T, F > Struct Template Reference

OpenTTD Source 15.3

Public Types | Public Member Functions | Private Member Functions | Private Attributes
Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolIteratorFiltered< T, F > Struct Template Reference

Iterator to iterate all valid T of a pool. More...

`#include <pool_type.hpp>`

## Public Types
typedef T | value_type
typedef T * | pointer
typedef T & | reference
typedef size_t | difference_type
typedef std::forward_iterator_tag | iterator_category

## Public Member Functions
| PoolIteratorFiltered (size_t index, F filter)
bool | operator== (const PoolIteratorFiltered &other) const
T * | operator* () const
PoolIteratorFiltered & | operator++ ()

## Private Member Functions
void | ValidateIndex ()

## Private Attributes
size_t | index
F | filter

## Detailed Description

template<class Titem, typename Tindex, size_t Tgrowth_step, PoolType Tpool_type = PoolType::Normal, bool Tcache = false>
template<class T, class F>
struct Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolIteratorFiltered< T, F >

Iterator to iterate all valid T of a pool.

Template Parameters

  T | Type of the class/struct that is going to be iterated

Definition at line 240 of file pool_type.hpp.

## Member Typedef Documentation

## ◆ difference_type

template<class Titem , typename Tindex , size_t Tgrowth_step, PoolType Tpool_type = PoolType::Normal, bool Tcache = false>
template<class T , class F >

typedef size_t Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolIteratorFiltered< T, F >::difference_type

Definition at line 244 of file pool_type.hpp.

## ◆ iterator_category

template<class Titem , typename Tindex , size_t Tgrowth_step, PoolType Tpool_type = PoolType::Normal, bool Tcache = false>
template<class T , class F >

typedef std::forward_iterator_tag Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolIteratorFiltered< T, F >::iterator_category

Definition at line 245 of file pool_type.hpp.

## ◆ pointer

template<class Titem , typename Tindex , size_t Tgrowth_step, PoolType Tpool_type = PoolType::Normal, bool Tcache = false>
template<class T , class F >

typedef T* Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolIteratorFiltered< T, F >::pointer

Definition at line 242 of file pool_type.hpp.

## ◆ reference

template<class Titem , typename Tindex , size_t Tgrowth_step, PoolType Tpool_type = PoolType::Normal, bool Tcache = false>
template<class T , class F >

typedef T& Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolIteratorFiltered< T, F >::reference

Definition at line 243 of file pool_type.hpp.

## ◆ value_type

template<class Titem , typename Tindex , size_t Tgrowth_step, PoolType Tpool_type = PoolType::Normal, bool Tcache = false>
template<class T , class F >

typedef T Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolIteratorFiltered< T, F >::value_type

Definition at line 241 of file pool_type.hpp.

## Constructor & Destructor Documentation

## ◆ PoolIteratorFiltered()

template<class Titem , typename Tindex , size_t Tgrowth_step, PoolType Tpool_type = PoolType::Normal, bool Tcache = false>
template<class T , class F >

Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolIteratorFiltered< T, F >::PoolIteratorFiltered | ( | size_t | index,
|  | F | filter
| ) |  |
| inlineexplicit

Definition at line 247 of file pool_type.hpp.

## Member Function Documentation

## ◆ operator*()

template<class Titem , typename Tindex , size_t Tgrowth_step, PoolType Tpool_type = PoolType::Normal, bool Tcache = false>
template<class T , class F >

T * Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolIteratorFiltered< T, F >::operator* | ( |  | ) | const
| inline

Definition at line 253 of file pool_type.hpp.

## ◆ operator++()

template<class Titem , typename Tindex , size_t Tgrowth_step, PoolType Tpool_type = PoolType::Normal, bool Tcache = false>
template<class T , class F >

PoolIteratorFiltered & Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolIteratorFiltered< T, F >::operator++ | ( |  | ) |
| inline

Definition at line 254 of file pool_type.hpp.

## ◆ operator==()

template<class Titem , typename Tindex , size_t Tgrowth_step, PoolType Tpool_type = PoolType::Normal, bool Tcache = false>
template<class T , class F >

bool Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolIteratorFiltered< T, F >::operator== | ( | const PoolIteratorFiltered< T, F > & | other | ) | const
| inline

Definition at line 252 of file pool_type.hpp.

## ◆ ValidateIndex()

template<class Titem , typename Tindex , size_t Tgrowth_step, PoolType Tpool_type = PoolType::Normal, bool Tcache = false>
template<class T , class F >

void Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolIteratorFiltered< T, F >::ValidateIndex | ( |  | ) |
| inlineprivate

Definition at line 259 of file pool_type.hpp.

## Field Documentation

## ◆ filter

template<class Titem , typename Tindex , size_t Tgrowth_step, PoolType Tpool_type = PoolType::Normal, bool Tcache = false>
template<class T , class F >

F Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolIteratorFiltered< T, F >::filter
| private

Definition at line 258 of file pool_type.hpp.

## ◆ index

template<class Titem , typename Tindex , size_t Tgrowth_step, PoolType Tpool_type = PoolType::Normal, bool Tcache = false>
template<class T , class F >

size_t Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolIteratorFiltered< T, F >::index
| private

Definition at line 257 of file pool_type.hpp.

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

- src/core/pool_type.hpp