header_utils
Loading...
Searching...
No Matches
ghassanpl::pool< T, BLOCK_SIZE > Struct Template Reference

Very simple object pool implementation. More...

#include <pools.h>

Public Member Functions

template<typename... ARGS>
T * create (ARGS &&... args)
void destroy (T *ptr)
void clear ()
size_t capacity () const noexcept
size_t capacity_in_bytes () const noexcept
size_t free_elements () const noexcept
size_t allocated_elements () const noexcept

Detailed Description

template<typename T, size_t BLOCK_SIZE = 1024>
struct ghassanpl::pool< T, BLOCK_SIZE >

Very simple object pool implementation.

Definition at line 18 of file pools.h.

Member Function Documentation

◆ allocated_elements()

template<typename T, size_t BLOCK_SIZE = 1024>
size_t ghassanpl::pool< T, BLOCK_SIZE >::allocated_elements ( ) const
inlinenoexcept

Definition at line 49 of file pools.h.

◆ capacity()

template<typename T, size_t BLOCK_SIZE = 1024>
size_t ghassanpl::pool< T, BLOCK_SIZE >::capacity ( ) const
inlinenoexcept

Definition at line 46 of file pools.h.

◆ capacity_in_bytes()

template<typename T, size_t BLOCK_SIZE = 1024>
size_t ghassanpl::pool< T, BLOCK_SIZE >::capacity_in_bytes ( ) const
inlinenoexcept

Definition at line 47 of file pools.h.

◆ clear()

template<typename T, size_t BLOCK_SIZE = 1024>
void ghassanpl::pool< T, BLOCK_SIZE >::clear ( )
inline

Definition at line 40 of file pools.h.

◆ create()

template<typename T, size_t BLOCK_SIZE = 1024>
template<typename... ARGS>
T * ghassanpl::pool< T, BLOCK_SIZE >::create ( ARGS &&... args)
inline

Definition at line 21 of file pools.h.

◆ destroy()

template<typename T, size_t BLOCK_SIZE = 1024>
void ghassanpl::pool< T, BLOCK_SIZE >::destroy ( T * ptr)
inline

Definition at line 34 of file pools.h.

◆ free_elements()

template<typename T, size_t BLOCK_SIZE = 1024>
size_t ghassanpl::pool< T, BLOCK_SIZE >::free_elements ( ) const
inlinenoexcept

Definition at line 48 of file pools.h.