[#BloombergLP-bdlcc-SharedObjectPool] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::SharedObjectPool :relfileprefix: ../../ :mrdocs: This class provides a thread‐safe pool of `bsl::shared_ptr` objects. == Synopsis Declared in `<bdlcc_sharedobjectpool.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class TYPE, class CREATOR = xref:BloombergLP/bdlcc/ObjectPoolFunctors/DefaultCreator.adoc[ObjectPoolFunctors::DefaultCreator], class RESETTER = xref:BloombergLP/bdlcc/ObjectPoolFunctors/Nil.adoc[ObjectPoolFunctors::Nil<TYPE>]> class SharedObjectPool; ---- == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlcc/SharedObjectPool/CreatorType.adoc[`CreatorType`] | Type of the creator functor used by this pool. | xref:BloombergLP/bdlcc/SharedObjectPool/ResetterType.adoc[`ResetterType`] | Type of the resetter functor used by this pool. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlcc/SharedObjectPool/2constructor-01.adoc[`SharedObjectPool`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bdlcc/SharedObjectPool/2destructor.adoc[`~SharedObjectPool`] [.small]#[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. | xref:BloombergLP/bdlcc/SharedObjectPool/getObject.adoc[`getObject`] | Return a shared pointer to an object from this pool. | xref:BloombergLP/bdlcc/SharedObjectPool/increaseCapacity.adoc[`increaseCapacity`] | Create the specified `growBy` objects and add them to this object pool. The behavior is undefined unless `0 <= growBy`. | xref:BloombergLP/bdlcc/SharedObjectPool/numAvailableObjects.adoc[`numAvailableObjects`] | Return a _snapshot_ of the number of objects available in this pool. | xref:BloombergLP/bdlcc/SharedObjectPool/numObjects.adoc[`numObjects`] | Return the number of objects currently managed by this pool. | xref:BloombergLP/bdlcc/SharedObjectPool/reserveCapacity.adoc[`reserveCapacity`] | Create enough objects to satisfy at least `growBy` future requests. | xref:BloombergLP/bdlcc/SharedObjectPool/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<SharedObjectPool, UsesBslmaAllocator>`] | Declare that this type uses a `bslma` allocator. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#