|
OpenTTD Source 20260311-master-g511d3794ce
|
Base class for base of all pools. More...
#include <pool_type.hpp>
Public Member Functions | |
| PoolBase (PoolType pt) | |
| Constructor registers this object in the pool vector. | |
| virtual | ~PoolBase () |
| Ensure the destructor of the sub classes are called as well. | |
| 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(). | |
Base class for base of all pools.
Definition at line 87 of file pool_type.hpp.
|
inline |
Constructor registers this object in the pool vector.
| pt | type of this pool. |
Definition at line 106 of file pool_type.hpp.
References GetPools(), and type.
Referenced by Clean(), and PoolBase().
|
virtual |
Ensure the destructor of the sub classes are called as well.
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().
|
private |
Dummy private copy constructor to prevent compilers from copying the structure, which fails due to GetPools().
| other | The pool not to copy from. |
References PoolBase().
|
static |
Clean all pools of given type.
| pt | pool types to clean. |
Definition at line 30 of file pool_func.cpp.
References GetPools(), PoolBase(), and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().
Referenced by InitializeNetworkPools(), and ShutdownGame().
|
pure virtual |
Virtual method that deletes all items in the pool.
Implemented in Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >, Pool< BaseStation, StationID, 32 >, Pool< CargoPacket, CargoPacketID, 1024, PoolType::Normal, true >, Pool< CargoPayment, CargoPaymentID, 512 >, Pool< Company, CompanyID, 1 >, Pool< Depot, DepotID, 64 >, Pool< Engine, EngineID, 64 >, Pool< EngineRenew, EngineRenewID, 16 >, Pool< Goal, GoalID, 64 >, Pool< Group, GroupID, 16 >, Pool< Industry, IndustryID, 64 >, Pool< LeagueTable, LeagueTableID, 4 >, Pool< LeagueTableElement, LeagueTableElementID, 64 >, Pool< LinkGraph, LinkGraphID, 32 >, Pool< LinkGraphJob, LinkGraphJobID, 32 >, Pool< NetworkClientInfo, ClientPoolID, 8, PoolType::NetworkClient >, Pool< NetworkClientSocket, ClientPoolID, 8, PoolType::NetworkClient >, Pool< Object, ObjectID, 64 >, Pool< OrderBackup, OrderBackupID, 1 >, Pool< OrderList, OrderListID, 128 >, Pool< PersistentStorage, PersistentStorageID, 1 >, Pool< RoadStop, RoadStopID, 32 >, Pool< ServerNetworkAdminSocketHandler, AdminID, 2, PoolType::NetworkAdmin >, Pool< Sign, SignID, 16 >, Pool< SpriteGroup, SpriteGroupID, 1024, PoolType::Data >, Pool< StoryPage, StoryPageID, 64 >, Pool< StoryPageElement, StoryPageElementID, 64 >, Pool< Subsidy, SubsidyID, 1 >, Pool< Town, TownID, 64 >, and Pool< Vehicle, VehicleID, 512 >.
|
inlinestatic |
Function used to access the vector of all pools.
Definition at line 94 of file pool_type.hpp.
Referenced by Clean(), PoolBase(), and ~PoolBase().
| const PoolType PoolBase::type |