|
pbr-cpp-memory-pool 1.1.2
Fixed-block-size O(1) memory pool — C++17 with an ANSI C public surface
|
Observer of pool-lifecycle events (the GoF Observer — ADR-0026). More...
#include <instrumented_pool.hpp>
Public Member Functions | |
| PoolObserver (const PoolObserver &)=default | |
| PoolObserver (PoolObserver &&)=default | |
| PoolObserver & | operator= (const PoolObserver &)=default |
| PoolObserver & | operator= (PoolObserver &&)=default |
| virtual void | on_pool_event (PoolEvent event, const PoolStats &stats) noexcept=0 |
| Called once per event, with a snapshot of the pool's counters. | |
Observer of pool-lifecycle events (the GoF Observer — ADR-0026).
Register a concrete observer with InstrumentedPool::add_observer; it is notified on the calling thread. Notification is not internally synchronized (ADR-0026 §4) — register before concurrent use and make observers thread-safe, or observe single-threaded. The observer must out-live the InstrumentedPool it is attached to (the subject stores a non-owning pointer).
Definition at line 74 of file instrumented_pool.hpp.
|
pure virtualnoexcept |
Called once per event, with a snapshot of the pool's counters.
noexcept by contract — an event handler must not throw (it may be invoked from the noexcept try_allocate and from the destructor); a throwing handler terminates, like a throwing destructor.