Quick Links:

bal | bbl | bdl | bsl

Public Types | Public Member Functions | Static Public Member Functions

bslstl::SharedPtrAllocateInplaceRep< TYPE, ALLOCATOR > Class Template Reference

#include <bslstl_sharedptrallocateinplacerep.h>

List of all members.

Public Types

typedef
ReboundTraits::allocator_type 
ReboundAllocator

Public Member Functions

virtual void disposeObject ()
virtual void disposeRep ()
void * getDeleter (const std::type_info &type)
TYPE * ptr ()
virtual void * originalPtr () const

Static Public Member Functions

static
SharedPtrAllocateInplaceRep
makeRep (ReboundAllocator basicAllocator)

Detailed Description

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

This class provides a concrete implementation of the SharedPtrRep protocol for in-place instances of the (template parameter) TYPE. Upon destruction of this object, the destructor of TYPE is invoked on the shared object.

See Component bslstl_sharedptrallocateinplacerep


Member Typedef Documentation

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

Member Function Documentation

template<class TYPE , class ALLOCATOR >
static SharedPtrAllocateInplaceRep* bslstl::SharedPtrAllocateInplaceRep< TYPE, ALLOCATOR >::makeRep ( ReboundAllocator  basicAllocator  )  [static]

Create a SharedPtrAllocateInplaceRep object having storage for an in-place uninitialized object of (template parameter) TYPE, 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 object. This object should be explicitly initialized by the caller, and it is undefined behavior to call disposeRep until this object has been successfully constructed.

template<class TYPE , class ALLOCATOR >
virtual void bslstl::SharedPtrAllocateInplaceRep< TYPE, ALLOCATOR >::disposeObject (  )  [virtual]

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.

template<class TYPE , class ALLOCATOR >
virtual void bslstl::SharedPtrAllocateInplaceRep< TYPE, ALLOCATOR >::disposeRep (  )  [virtual]

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.

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

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.

template<class TYPE , class ALLOCATOR >
TYPE* bslstl::SharedPtrAllocateInplaceRep< TYPE, ALLOCATOR >::ptr (  ) 

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 as a data member.

template<class TYPE , class ALLOCATOR >
virtual void* bslstl::SharedPtrAllocateInplaceRep< TYPE, ALLOCATOR >::originalPtr (  )  const [virtual]

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


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