|
PACS System 0.1.0
PACS DICOM system library
|
Pool wrapper with statistics tracking for PDU buffers. More...
#include <pdu_buffer_pool.h>


Public Types | |
| using | pool_type = kcenon::common::utils::ObjectPool<T> |
| using | unique_ptr_type = std::unique_ptr<T, std::function<void(T*)>> |
Public Member Functions | |
| tracked_pdu_pool (std::size_t initial_size=64) | |
| template<typename... Args> | |
| auto | acquire (Args &&... args) -> unique_ptr_type |
| Acquire an object from the pool. | |
| auto | statistics () const noexcept -> const pdu_pool_statistics & |
| Get the pool statistics. | |
| auto | available () const -> std::size_t |
| Get the number of available objects in the pool. | |
| void | reserve (std::size_t count) |
| Reserve additional capacity in the pool. | |
| void | clear () |
| Clear the pool and release all memory. | |
Private Attributes | |
| pool_type | pool_ |
| pdu_pool_statistics | stats_ |
Pool wrapper with statistics tracking for PDU buffers.
| T | The type of objects to pool |
Definition at line 165 of file pdu_buffer_pool.h.
| using kcenon::pacs::network::tracked_pdu_pool< T >::pool_type = kcenon::common::utils::ObjectPool<T> |
Definition at line 167 of file pdu_buffer_pool.h.
| using kcenon::pacs::network::tracked_pdu_pool< T >::unique_ptr_type = std::unique_ptr<T, std::function<void(T*)>> |
Definition at line 168 of file pdu_buffer_pool.h.
|
inlineexplicit |
Definition at line 170 of file pdu_buffer_pool.h.
References kcenon::pacs::network::tracked_pdu_pool< T >::pool_.
|
inline |
Acquire an object from the pool.
| args | Arguments forwarded to the object's constructor |
Definition at line 181 of file pdu_buffer_pool.h.
References kcenon::pacs::network::tracked_pdu_pool< T >::pool_, kcenon::pacs::network::pdu_pool_statistics::pool_hits, kcenon::pacs::network::pdu_pool_statistics::pool_misses, kcenon::pacs::network::tracked_pdu_pool< T >::stats_, and kcenon::pacs::network::pdu_pool_statistics::total_acquisitions.
|
inlinenodiscard |
Get the number of available objects in the pool.
Definition at line 207 of file pdu_buffer_pool.h.
References kcenon::pacs::network::tracked_pdu_pool< T >::pool_.
|
inline |
Clear the pool and release all memory.
Definition at line 222 of file pdu_buffer_pool.h.
References kcenon::pacs::network::tracked_pdu_pool< T >::pool_.
|
inline |
Reserve additional capacity in the pool.
| count | Number of objects to pre-allocate |
Definition at line 215 of file pdu_buffer_pool.h.
References kcenon::pacs::network::tracked_pdu_pool< T >::pool_.
|
inlinenodiscardnoexcept |
Get the pool statistics.
Definition at line 199 of file pdu_buffer_pool.h.
References kcenon::pacs::network::tracked_pdu_pool< T >::stats_.
|
private |
Definition at line 227 of file pdu_buffer_pool.h.
Referenced by kcenon::pacs::network::tracked_pdu_pool< T >::acquire(), kcenon::pacs::network::tracked_pdu_pool< T >::available(), kcenon::pacs::network::tracked_pdu_pool< T >::clear(), kcenon::pacs::network::tracked_pdu_pool< T >::reserve(), and kcenon::pacs::network::tracked_pdu_pool< T >::tracked_pdu_pool().
|
private |
Definition at line 228 of file pdu_buffer_pool.h.
Referenced by kcenon::pacs::network::tracked_pdu_pool< T >::acquire(), and kcenon::pacs::network::tracked_pdu_pool< T >::statistics().