BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslstl::SharedPtrArrayAllocateInplaceRep< TYPE, ALLOCATOR > Class Template Reference

#include <bslstl_sharedptrallocateinplacerep.h>

Inheritance diagram for bslstl::SharedPtrArrayAllocateInplaceRep< TYPE, ALLOCATOR >:

Public Types

typedef bsl::remove_extent< TYPE >::type element_type
 
typedef ReboundTraits::allocator_type ReboundAllocator
 

Public Member Functions

void disposeObject () BSLS_KEYWORD_OVERRIDE
 
void disposeRep () BSLS_KEYWORD_OVERRIDE
 
void * getDeleter (const std::type_info &type) BSLS_KEYWORD_OVERRIDE
 
element_typeptr ()
 
void * originalPtr () const BSLS_KEYWORD_OVERRIDE
 

Static Public Member Functions

static size_t alloc_size (size_t numElements)
 
static SharedPtrArrayAllocateInplaceRepmakeRep (ReboundAllocator basicAllocator, size_t numElements)
 

Detailed Description

template<class TYPE, class ALLOCATOR>
class bslstl::SharedPtrArrayAllocateInplaceRep< TYPE, ALLOCATOR >

This class provides a concrete implementation of the SharedPtrRep protocol for in-place instances of the (template parameter) TYPE, which must be an array. Upon destruction of this object, each element of the array is destructed.

Member Typedef Documentation

◆ element_type

template<class TYPE , class ALLOCATOR >
typedef bsl::remove_extent<TYPE>::type bslstl::SharedPtrArrayAllocateInplaceRep< TYPE, ALLOCATOR >::element_type

◆ ReboundAllocator

template<class TYPE , class ALLOCATOR >
typedef ReboundTraits::allocator_type bslstl::SharedPtrArrayAllocateInplaceRep< TYPE, ALLOCATOR >::ReboundAllocator

Member Function Documentation

◆ alloc_size()

template<class TYPE , class ALLOCATOR >
size_t bslstl::SharedPtrArrayAllocateInplaceRep< TYPE, ALLOCATOR >::alloc_size ( size_t  numElements)
inlinestatic

Return the size (in bytes) for an allocation to hold an object of type SharedPtrArrayAllocateInplaceRep<T[]> containing the specified numElements number of elements.

◆ disposeObject()

template<class TYPE , class ALLOCATOR >
void bslstl::SharedPtrArrayAllocateInplaceRep< TYPE, ALLOCATOR >::disposeObject ( )
inline

Destroy the object being referred to by this representation. This method is automatically invoked by releaseRef when the number of shared references reaches zero and should not be explicitly invoked otherwise.

◆ disposeRep()

template<class TYPE , class ALLOCATOR >
void bslstl::SharedPtrArrayAllocateInplaceRep< TYPE, ALLOCATOR >::disposeRep ( )
inline

Destroy this representation object and deallocate the associated memory. This method is automatically invoked by releaseRef and releaseWeakRef when the number of weak references and the number of shared references both reach zero and should not be explicitly invoked otherwise. The behavior is undefined unless disposeObject has already been called for this representation. Note that this method effectively serves as the representation object's destructor.

◆ getDeleter()

template<class TYPE , class ALLOCATOR >
void * bslstl::SharedPtrArrayAllocateInplaceRep< TYPE, ALLOCATOR >::getDeleter ( const std::type_info &  type)
inline

Ignore the specified type and return a null pointer. Note that there is no facility for the user to supply a deleter for an in-place representation for a shared pointer.

◆ makeRep()

template<class TYPE , class ALLOCATOR >
SharedPtrArrayAllocateInplaceRep< TYPE, ALLOCATOR > * bslstl::SharedPtrArrayAllocateInplaceRep< TYPE, ALLOCATOR >::makeRep ( ReboundAllocator  basicAllocator,
size_t  numElements 
)
inlinestatic

Create a SharedPtrArrayAllocateInplaceRep object having storage for an in-place uninitialized sized array of (template parameter) TYPE containing space for the specified numElements number of elements, and return its address. Use the specified basicAllocator to supply memory and, upon a call to disposeRep, to destroy this representation (and the in-place shared object). Note that the function members ptr and originalPtr will return the address of an uninitialized array. This object should be explicitly initialized by the caller, and it is undefined behavior to call disposeRep until this object has been successfully constructed.

◆ originalPtr()

template<class TYPE , class ALLOCATOR >
void * bslstl::SharedPtrArrayAllocateInplaceRep< TYPE, ALLOCATOR >::originalPtr ( ) const
inline

Return the (untyped) address of the modifiable shared object to which this object refers.

◆ ptr()

template<class TYPE , class ALLOCATOR >
SharedPtrArrayAllocateInplaceRep< TYPE, ALLOCATOR >::element_type * bslstl::SharedPtrArrayAllocateInplaceRep< TYPE, ALLOCATOR >::ptr ( )
inline

Return the address of the modifiable shared object to which this object refers. Note that in order to return a pointer to a modifiable object, this function cannot be const qualified as the referenced object is stored internally.


The documentation for this class was generated from the following file: