Thread‐safe pool of reusable objects that implements bdlma::Factory.
Synopsis
Declared in <bdlcc_objectpool.h>
template<
class TYPE,
class CREATOR = ObjectPoolFunctors::DefaultCreator,
class RESETTER = ObjectPoolFunctors::Nil<TYPE>>
class ObjectPool
: public bdlma::Factory<TYPE>
Description
This class provides a thread‐safe pool of reusable objects. It also implements the bdlma::Factory protocol: "creating" objects gets them from the pool and "deleting" objects returns them to the pool.
Base Classes
Name |
Description |
Provide a protocol for a thread‐safe object creator and deleter. |
Type Aliases
Name |
Description |
Type of the creator functor used by this pool. |
|
Type of the resetter functor used by this pool. |
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this object pool. All objects created by this pool are destroyed (even if some of them are still in use) and memory is reclaimed. |
|
This concrete implementation of |
|
|
Return a modifiable object from this object pool. |
|
Create the specified |
|
Return a snapshot of the number of objects available in this pool. |
|
Return the number of objects currently managed by this pool. |
|
Return the specified |
|
Ensure this pool can satisfy at least |
|
|
Declare that this type uses a |
Friends
Name |
Description |
|
Created with MrDocs