This class provides a thread‐safe pool of bsl::shared_ptr objects.

Synopsis

Declared in <bdlcc_sharedobjectpool.h>

template<
    class TYPE,
    class CREATOR = ObjectPoolFunctors::DefaultCreator,
    class RESETTER = ObjectPoolFunctors::Nil<TYPE>>
class SharedObjectPool;

Type Aliases

Name

Description

CreatorType

Type of the creator functor used by this pool.

ResetterType

Type of the resetter functor used by this pool.

Member Functions

Name

Description

SharedObjectPool [constructor]

Constructors

~SharedObjectPool [destructor]

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.

getObject

Return a shared pointer to an object from this pool.

increaseCapacity

Create the specified growBy objects and add them to this object pool. The behavior is undefined unless 0 <= growBy.

numAvailableObjects

Return a snapshot of the number of objects available in this pool.

numObjects

Return the number of objects currently managed by this pool.

reserveCapacity

Create enough objects to satisfy at least growBy future requests.

operator BloombergLP::bslmf::NestedTraitDeclaration<SharedObjectPool, UsesBslmaAllocator>

Declare that this type uses a bslma allocator.

Created with MrDocs