OpenTTD Source 20250205-master-gfd85ab1e2c
pool_type.hpp File Reference

Definition of Pool, structure used to access PoolItems, and PoolItem, base structure for Vehicle, Town, and other indexed items. More...

#include "enum_type.hpp"

Go to the source code of this file.

Data Structures

struct  PoolBase
 Base class for base of all pools. More...
 
struct  Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >
 Base class for all pools. More...
 
struct  Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolIterator< T >
 Iterator to iterate all valid T of a pool. More...
 
struct  Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::IterateWrapper< T >
 
struct  Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolIteratorFiltered< T, F >
 Iterator to iterate all valid T of a pool. More...
 
struct  Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::IterateWrapperFiltered< T, F >
 
struct  Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >
 Base class for all PoolItems. More...
 
struct  Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::AllocCache
 Helper struct to cache 'freed' PoolItems so we do not need to allocate them again. More...
 

Typedefs

using PoolTypes = EnumBitSet< PoolType, uint8_t >
 
typedef std::vector< struct PoolBase * > PoolVector
 Vector of pointers to PoolBase.
 

Enumerations

enum class  PoolType : uint8_t { Normal , NetworkClient , NetworkAdmin , Data }
 Various types of a pool. More...
 

Variables

static constexpr PoolTypes PT_ALL = {PoolType::Normal, PoolType::NetworkClient, PoolType::NetworkAdmin, PoolType::Data}
 

Detailed Description

Definition of Pool, structure used to access PoolItems, and PoolItem, base structure for Vehicle, Town, and other indexed items.

Definition in file pool_type.hpp.

Typedef Documentation

◆ PoolTypes

using PoolTypes = EnumBitSet<PoolType, uint8_t>

Definition at line 22 of file pool_type.hpp.

◆ PoolVector

typedef std::vector<struct PoolBase *> PoolVector

Vector of pointers to PoolBase.

Definition at line 25 of file pool_type.hpp.

Enumeration Type Documentation

◆ PoolType

enum class PoolType : uint8_t
strong

Various types of a pool.

Enumerator
Normal 

Normal pool containing game objects.

NetworkClient 

Network client pools.

NetworkAdmin 

Network admin pool.

Data 

NewGRF or other data, that is not reset together with normal pools.

Definition at line 16 of file pool_type.hpp.

Variable Documentation

◆ PT_ALL

Definition at line 23 of file pool_type.hpp.