Blender V5.0
blender::Pool< T, ChunkLen > Class Template Reference

#include <BLI_pool.hh>

Inherits blender::NonCopyable.

Public Member Functions

 ~Pool ()
template<typename... ForwardT>
Tconstruct (ForwardT &&...value)
void destruct (T &value)
int64_t size () const
bool is_empty () const

Detailed Description

template<typename T, int64_t ChunkLen = 64>
class blender::Pool< T, ChunkLen >

Definition at line 24 of file BLI_pool.hh.

Constructor & Destructor Documentation

◆ ~Pool()

template<typename T, int64_t ChunkLen = 64>
blender::Pool< T, ChunkLen >::~Pool ( )
inline

Definition at line 36 of file BLI_pool.hh.

References BLI_assert, and size().

Member Function Documentation

◆ construct()

template<typename T, int64_t ChunkLen = 64>
template<typename... ForwardT>
T & blender::Pool< T, ChunkLen >::construct ( ForwardT &&... value)
inline

Construct an object inside this pool's memory.

Definition at line 45 of file BLI_pool.hh.

References i, ptr, and T.

Referenced by bm_log_face_alloc(), bm_log_vert_alloc(), blender::tests::TEST(), and blender::tests::TEST().

◆ destruct()

template<typename T, int64_t ChunkLen = 64>
void blender::Pool< T, ChunkLen >::destruct ( T & value)
inline

Destroy the given element inside this memory pool. Memory will be reused by next element construction. This invokes undefined behavior if the item is not from this pool.

Definition at line 63 of file BLI_pool.hh.

References T.

Referenced by bm_log_entry_free(), blender::tests::TEST(), and blender::tests::TEST().

◆ is_empty()

template<typename T, int64_t ChunkLen = 64>
bool blender::Pool< T, ChunkLen >::is_empty ( ) const
inline

Returns true when the pool contains no elements, otherwise false.

Definition at line 80 of file BLI_pool.hh.

References size().

Referenced by bm_log_entry_free().

◆ size()

template<typename T, int64_t ChunkLen = 64>
int64_t blender::Pool< T, ChunkLen >::size ( ) const
inline

Return the number of constructed elements in this pool.

Definition at line 72 of file BLI_pool.hh.

Referenced by bm_log_entry_free(), is_empty(), blender::tests::TEST(), blender::tests::TEST(), and ~Pool().


The documentation for this class was generated from the following file: