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

#include <BLI_pool.hh>

Inherits blender::blender::NonCopyable.

Public Member Functions

 ~Pool ()
template<typename... ForwardT>
T & construct (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 38 of file BLI_pool.hh.

References blender::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 47 of file BLI_pool.hh.

References blender::IndexRange::IndexRange(), and T.

Referenced by 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 65 of file BLI_pool.hh.

References T.

Referenced by 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 82 of file BLI_pool.hh.

References size().

◆ 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 74 of file BLI_pool.hh.

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


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