OpenTTD Source: Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolIterator< T > 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 >::PoolIterator< T > 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
| PoolIterator (size_t index)
bool | operator== (const PoolIterator &other) const
T * | operator* () const
PoolIterator & | operator++ ()

## Private Member Functions
void | ValidateIndex ()

## Private Attributes
size_t | index

## Detailed Description

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

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 197 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 >

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

Definition at line 201 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 >

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

Definition at line 202 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 >

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

Definition at line 199 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 >

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

Definition at line 200 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 >

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

Definition at line 198 of file pool_type.hpp.

## Constructor & Destructor Documentation

## ◆ PoolIterator()

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

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

Definition at line 204 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 >

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

Definition at line 210 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 >

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

Definition at line 211 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 >

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

Definition at line 209 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 >

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

Definition at line 215 of file pool_type.hpp.

## Field Documentation

## ◆ index

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

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

Definition at line 214 of file pool_type.hpp.

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

- src/core/pool_type.hpp