OpenTTD Source 20250810-master-gcd61682ebf
|
A simplified pool which stores values instead of pointers and doesn't redefine operator new/delete. More...
#include <smallstack_type.hpp>
Data Structures | |
struct | SimplePoolPoolItem |
Public Member Functions | |
Titem & | Get (Tindex index) |
Get the item at position index. | |
Tindex | Create () |
Create a new item and return its index. | |
void | Destroy (Tindex index) |
Destroy (or rather invalidate) the item at the given index. | |
Private Member Functions | |
Tindex | FindFirstFree () |
Private Attributes | |
Tindex | first_unused |
Tindex | first_free |
std::vector< SimplePoolPoolItem > | data |
A simplified pool which stores values instead of pointers and doesn't redefine operator new/delete.
It also never zeroes memory and always reuses it.
Definition at line 19 of file smallstack_type.hpp.
|
inline |
Definition at line 21 of file smallstack_type.hpp.
|
inline |
Create a new item and return its index.
Definition at line 33 of file smallstack_type.hpp.
Referenced by SmallStack< Titem, Tindex, Tinvalid_value, Tgrowth_step, Tmax_size >::Push().
|
inline |
Destroy (or rather invalidate) the item at the given index.
index | Index of item to be destroyed. |
Definition at line 48 of file smallstack_type.hpp.
Referenced by SmallStack< Titem, Tindex, Tinvalid_value, Tgrowth_step, Tmax_size >::Pop().
|
inlineprivate |
Definition at line 56 of file smallstack_type.hpp.
|
inline |
Get the item at position index.
Definition at line 27 of file smallstack_type.hpp.
Referenced by SmallStack< Titem, Tindex, Tinvalid_value, Tgrowth_step, Tmax_size >::Branch(), SmallStack< Titem, Tindex, Tinvalid_value, Tgrowth_step, Tmax_size >::Contains(), SmallStack< Titem, Tindex, Tinvalid_value, Tgrowth_step, Tmax_size >::Pop(), and SmallStack< Titem, Tindex, Tinvalid_value, Tgrowth_step, Tmax_size >::Push().
|
private |
Definition at line 76 of file smallstack_type.hpp.
|
private |
Definition at line 74 of file smallstack_type.hpp.
|
private |
Definition at line 73 of file smallstack_type.hpp.