Quick Links:

bal | bbl | bdl | bsl

Namespaces

Component bslstl_sharedptrallocateinplacerep
[Package bslstl]

Provide an in-place implementation of bslma::SharedPtrRep. More...

Namespaces

namespace  bslstl

Detailed Description

Outline
Purpose:
Provide an in-place implementation of bslma::SharedPtrRep.
Classes:
bslstl::SharedPtrAllocateInplaceRep in-place shared_ptr implementation
See also:
Component bslma_sharedptrrep, Component bslma_sharedptrinplacerep, Component bslstl_sharedptr
Description:
This component provides a class template, bslstl::SharedPtrAllocateInplaceRep, proving a concrete implementation of bslma::SharedPtrRep for managing objects of the parameterized TYPE that are stored in-place in the representation, and are allocated by an allocator that satisfies the requirements of an Allocator type in the C++11 standard. Thus, only one memory allocation is required to create both the representation and the managed object. When all references to the in-place object are released (using releaseRef), the destructor of TYPE is invoked.
Thread Safety:
bslstl::SharedPtrAllocateInplaceRep is thread-safe provided that disposeObject and disposeRep are not called explicitly, meaning that all non-creator operations other than disposeObject and disposeRep on a given instance can be safely invoked simultaneously from multiple threads (disposeObject and disposeRep are meant to be invoked only by releaseRef and releaseWeakRef). Note that there is no thread safety guarantees for operations on the managed object contained in bslstl::SharedPtrAllocateInplaceRep.