|
PACS System 0.1.0
PACS DICOM system library
|
Pool wrapper with statistics tracking. More...
#include <pool_manager.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_pool (std::size_t initial_size=32) | |
| template<typename... Args> | |
| auto | acquire (Args &&... args) -> unique_ptr_type |
| Acquire an object from the pool. | |
| auto | statistics () const noexcept -> const 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_ |
| pool_statistics | stats_ |
Pool wrapper with statistics tracking.
| T | The type of objects to pool |
Definition at line 72 of file pool_manager.h.
| using kcenon::pacs::core::tracked_pool< T >::pool_type = kcenon::common::utils::ObjectPool<T> |
Definition at line 74 of file pool_manager.h.
| using kcenon::pacs::core::tracked_pool< T >::unique_ptr_type = std::unique_ptr<T, std::function<void(T*)>> |
Definition at line 75 of file pool_manager.h.
|
inlineexplicit |
Definition at line 77 of file pool_manager.h.
References kcenon::pacs::core::tracked_pool< T >::pool_.
|
inline |
Acquire an object from the pool.
| args | Arguments forwarded to the object's constructor |
Definition at line 88 of file pool_manager.h.
References kcenon::pacs::core::tracked_pool< T >::pool_, kcenon::pacs::core::pool_statistics::pool_hits, kcenon::pacs::core::pool_statistics::pool_misses, kcenon::pacs::core::tracked_pool< T >::stats_, and kcenon::pacs::core::pool_statistics::total_acquisitions.
|
inlinenodiscard |
Get the number of available objects in the pool.
Definition at line 114 of file pool_manager.h.
References kcenon::pacs::core::tracked_pool< T >::pool_.
|
inline |
Clear the pool and release all memory.
Definition at line 129 of file pool_manager.h.
References kcenon::pacs::core::tracked_pool< T >::pool_.
|
inline |
Reserve additional capacity in the pool.
| count | Number of objects to pre-allocate |
Definition at line 122 of file pool_manager.h.
References kcenon::pacs::core::tracked_pool< T >::pool_.
|
inlinenodiscardnoexcept |
Get the pool statistics.
Definition at line 106 of file pool_manager.h.
References kcenon::pacs::core::tracked_pool< T >::stats_.
|
private |
Definition at line 134 of file pool_manager.h.
Referenced by kcenon::pacs::core::tracked_pool< T >::acquire(), kcenon::pacs::core::tracked_pool< T >::available(), kcenon::pacs::core::tracked_pool< T >::clear(), kcenon::pacs::core::tracked_pool< T >::reserve(), and kcenon::pacs::core::tracked_pool< T >::tracked_pool().
|
private |
Definition at line 135 of file pool_manager.h.
Referenced by kcenon::pacs::core::tracked_pool< T >::acquire(), and kcenon::pacs::core::tracked_pool< T >::statistics().