|
asynchrony 2.3.1
Add asynchrony to your C++ applications using standard C++20
|
Public Member Functions | |
| resource_pool ()=default | |
| Default constructor Creates an empty pool ready to accept resources. | |
| resource_pool (resource_pool &)=delete | |
| Copy constructor (deleted - pools are not copyable) Each pool manages its own resources independently. | |
| resource_pool (resource_pool &&src)=default | |
| Move constructor (defaulted) Allows moving a pool to a new location. | |
| resource_pool & | operator= (resource_pool &)=delete |
| Copy assignment operator (deleted - pools are not copyable). | |
| resource_pool & | operator= (resource_pool &&src)=default |
| Move assignment operator (defaulted). | |
| ~resource_pool () | |
| Destructor - clears all resources from the pool All remaining resources are destroyed. | |
| void | clear () |
| Clear all items from the pool. | |
| auto | size () |
| Get the current size of the pool. | |
| auto | checkout () -> resource_wrap< T > |
| void | checkin (T &&rsrc) |
Definition at line 339 of file resource_pool.hpp.
|
inline |
Destructor - clears all resources from the pool All remaining resources are destroyed.
Definition at line 371 of file resource_pool.hpp.
|
inline |
Definition at line 508 of file resource_pool.hpp.
|
inlinenodiscard |
Lambda that returns the resource back to the pool Captures 'this' to access the pool's checkin method Called by resource_wrap destructor to ensure automatic return even if an exception occurs
Definition at line 445 of file resource_pool.hpp.
|
inline |
Clear all items from the pool.
Removes and destroys all resources currently in the pool. Thread-safe operation. Safe to call on an empty pool.
Definition at line 383 of file resource_pool.hpp.
|
inline |
Get the current size of the pool.
Returns the number of resources available for checkout. Thread-safe operation.
Definition at line 402 of file resource_pool.hpp.