#include <oldpool.h>
Public Member Functions | |
virtual | ~PoolItem () |
We like to have the correct class destructed. | |
PoolItem () | |
Constructor of given class. | |
void * | operator new (size_t size) |
An overriden version of new that allocates memory on the pool. | |
void | operator delete (void *p) |
'Free' the memory allocated by the overriden new. | |
void * | operator new (size_t size, int index) |
An overriden version of new, so you can directly allocate a new object with the correct index when one is loading the savegame. | |
void | operator delete (void *p, int index) |
'Free' the memory allocated by the overriden new. | |
void * | operator new (size_t size, T *pn) |
An overriden version of new, so you can use the vehicle instance instead of a newly allocated piece of memory. | |
void | operator delete (void *p, T *pn) |
'Free' the memory allocated by the overriden new. | |
Static Public Member Functions | |
static bool | CanAllocateItem () |
Check whether we can allocate an item in this pool. | |
Data Fields | |
Tid | index |
The pool-wide index of this object. | |
Static Protected Member Functions | |
static T * | AllocateRaw () |
Allocate a pool item; possibly allocate a new block in the pool. | |
static T * | AllocateRaw (uint &first) |
Allocate a pool item; possibly allocate a new block in the pool. | |
static bool | CleaningPool () |
Are we cleaning this pool? | |
Static Private Member Functions | |
static T * | AllocateSafeRaw (uint &first) |
Allocate a pool item; possibly allocate a new block in the pool. |
It specifies all the mechanics to access the pool easily.
Definition at line 164 of file oldpool.h.
void* PoolItem< T, Tid, Tpool >::operator new | ( | size_t | size | ) | [inline] |
void PoolItem< T, Tid, Tpool >::operator delete | ( | void * | p | ) | [inline] |
void* PoolItem< T, Tid, Tpool >::operator new | ( | size_t | size, | |
int | index | |||
) | [inline] |
void PoolItem< T, Tid, Tpool >::operator delete | ( | void * | p, | |
int | index | |||
) | [inline] |
void* PoolItem< T, Tid, Tpool >::operator new | ( | size_t | size, | |
T * | pn | |||
) | [inline] |
An overriden version of new, so you can use the vehicle instance instead of a newly allocated piece of memory.
size | the size of the variable (unused) | |
pn | the already existing object to use as 'storage' backend |
void PoolItem< T, Tid, Tpool >::operator delete | ( | void * | p, | |
T * | pn | |||
) | [inline] |
static T* PoolItem< T, Tid, Tpool >::AllocateSafeRaw | ( | uint & | first | ) | [inline, static, private] |
Allocate a pool item; possibly allocate a new block in the pool.
first | the first pool item to start searching |
Definition at line 269 of file oldpool.h.
Referenced by PoolItem< Sign, uint16,&_Sign_pool >::AllocateRaw().
static T* PoolItem< T, Tid, Tpool >::AllocateRaw | ( | ) | [inline, static, protected] |
Allocate a pool item; possibly allocate a new block in the pool.
Definition at line 295 of file oldpool.h.
Referenced by PoolItem< Sign, uint16,&_Sign_pool >::AllocateSafeRaw(), and PoolItem< Sign, uint16,&_Sign_pool >::operator new().
static T* PoolItem< T, Tid, Tpool >::AllocateRaw | ( | uint & | first | ) | [inline, static, protected] |
static bool PoolItem< T, Tid, Tpool >::CleaningPool | ( | ) | [inline, static, protected] |
Are we cleaning this pool?
Definition at line 316 of file oldpool.h.
Referenced by RoadStop::~RoadStop().
static bool PoolItem< T, Tid, Tpool >::CanAllocateItem | ( | ) | [inline, static] |
Check whether we can allocate an item in this pool.
This to prevent the need to actually construct the object and then destructing it again, which could be *very* costly.
Definition at line 328 of file oldpool.h.
Referenced by AddEngineReplacement(), PoolItem< Sign, uint16,&_Sign_pool >::CanAllocateItem(), CmdBuildRoadStop(), and CreateNewIndustryHelper().