OpenTTD: src/core/pool_type.hpp File Reference

OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

Data Structures | Macros | Typedefs | Enumerations
pool_type.hpp File Reference

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

`#include "smallvec_type.hpp"`
`#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 >::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...

## Macros
#define | FOR_ALL_ITEMS_FROM(type, iter, var, start)
#define | FOR_ALL_ITEMS(type, iter, var) FOR_ALL_ITEMS_FROM(type, iter, var, 0)

## Typedefs
typedef SmallVector< struct PoolBase *, 4 > | PoolVector
| Vector of pointers to PoolBase.

## Enumerations
enum | PoolType { PT_NONE = 0x00, PT_NORMAL = 0x01, PT_NCLIENT = 0x02, PT_NADMIN = 0x04, PT_DATA = 0x08, PT_ALL = 0x0F }
| Various types of a pool. More...

## Detailed Description

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

Definition in file pool_type.hpp.

## Macro Definition Documentation

#define FOR_ALL_ITEMS_FROM | ( |  | type,
|  |  | iter,
|  |  | var,
|  |  | start
| ) |  |

Value:
for (size_t iter = start; var = NULL, iter < type::GetPoolSize(); iter++) \
if ((var = type::Get(iter)) != NULL)

Definition at line 316 of file pool_type.hpp.

## Enumeration Type Documentation

enum PoolType

Various types of a pool.

Enumerator:

  PT_NONE | No pool is selected.
  PT_NORMAL | Normal pool containing game objects.
  PT_NCLIENT | Network client pools.
  PT_NADMIN | Network admin pool.
  PT_DATA | NewGRF or other data, that is not reset together with normal pools.
  PT_ALL | All pool types.

Definition at line 19 of file pool_type.hpp.