OpenTTD Source: PoolBase Struct Reference

OpenTTD Source 15.3

Public Member Functions | Static Public Member Functions | Data Fields | Private Member Functions
PoolBase Struct Referenceabstract

Base class for base of all pools. More...

`#include <pool_type.hpp>`

Inheritance diagram for PoolBase:

## Public Member Functions
| PoolBase (PoolType pt)
| Constructor registers this object in the pool vector.
virtual | ~PoolBase ()
| Destructor removes this object from the pool vector and deletes the vector itself if this was the last item removed.
virtual void | CleanPool ()=0
| Virtual method that deletes all items in the pool.

## Static Public Member Functions
static PoolVector * | GetPools ()
| Function used to access the vector of all pools.
static void | Clean (PoolTypes)
| Clean all pools of given type.

## Data Fields
const PoolType | type
| Type of this pool.

## Private Member Functions
| PoolBase (const PoolBase &other)
| Dummy private copy constructor to prevent compilers from copying the structure, which fails due to GetPools().

## Detailed Description

Base class for base of all pools.

Definition at line 83 of file pool_type.hpp.

## Constructor & Destructor Documentation

## ◆ PoolBase()

PoolBase::PoolBase | ( | PoolType | pt | ) |
| inline

Constructor registers this object in the pool vector.

Parameters

  pt | type of this pool.

Definition at line 102 of file pool_type.hpp.

References GetPools().

## ◆ ~PoolBase()

PoolBase::~PoolBase | ( |  | ) |
| virtual

Destructor removes this object from the pool vector and deletes the vector itself if this was the last item removed.

Definition at line 19 of file pool_func.cpp.

References GetPools().

## Member Function Documentation

## ◆ Clean()

void PoolBase::Clean | ( | PoolTypes | pt | ) |
| static

Clean all pools of given type.

Parameters

  pt | pool types to clean.

Definition at line 30 of file pool_func.cpp.

References GetPools(), and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().

Referenced by InitializeNetworkPools(), and ShutdownGame().

## ◆ CleanPool()

virtual void PoolBase::CleanPool | ( |  | ) |
| pure virtual

Virtual method that deletes all items in the pool.

Implemented in Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >.

## ◆ GetPools()

static PoolVector * PoolBase::GetPools | ( |  | ) |
| inlinestatic

Function used to access the vector of all pools.

Returns
  pointer to vector of all pools

Definition at line 90 of file pool_type.hpp.

Referenced by Clean(), PoolBase(), and ~PoolBase().

## Field Documentation

## ◆ type

const PoolType PoolBase::type

Type of this pool.

Definition at line 84 of file pool_type.hpp.

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

- src/core/pool_type.hpp
- src/core/pool_func.cpp