8#ifndef INCLUDED_BSLMA_SHAREDPTROUTOFPLACEREP
9#define INCLUDED_BSLMA_SHAREDPTROUTOFPLACEREP
232#include <bslscm_version.h>
257template <
class TYPE,
class DELETER>
258struct SharedPtrOutofplaceRep_InitProctor;
259struct SharedPtrOutofplaceRep_DeleterHelper;
260struct SharedPtrOutofplaceRep_DeleterType;
261template <
class DELETER>
262class SharedPtrOutofplaceRep_DeleterDiscriminator;
310template <
class TYPE,
class DELETER>
344 const DELETER& deleter,
349 const DELETER& deleter,
354 const DELETER& deleter,
359 const DELETER& deleter,
373 const DELETER& deleter,
396 const DELETER& deleter,
442template <
class DELETER,
bool IS_ALLOC_PTR>
466 VALUE = BSLMA_USES_ALLOC
467 ? BSLMA_USES_ALLOC_ARG_T
485template <
class DELETER>
512template <
class DELETER>
553 template <
class TYPE,
class DELETER>
554 static void deleteObject(
562 template <
class TYPE,
class DELETER>
563 static void deleteObject(
571 template <
class TYPE,
class DELETER>
572 static void deleteObject(
580 template <
class TYPE,
class DELETER>
581 static void deleteObject(
590 template <
class TYPE,
class DELETER>
591 static void deleteObject(
600 template <
class TYPE,
class DELETER>
601 static void deleteObject(TYPE *ptr, DELETER& deleter);
619template <
class TYPE,
class DELETER>
654template <
class TYPE,
class DELETER>
658 const DELETER& deleter,
663 enum { BSLMA_DELETER_TYPE =
681template <
class TYPE,
class DELETER>
684 const DELETER& deleter,
687: d_deleter(
Default::allocator(deleter))
689, d_allocator_p(basicAllocator)
693template <
class TYPE,
class DELETER>
694SharedPtrOutofplaceRep<TYPE, DELETER>::SharedPtrOutofplaceRep(
696 const DELETER& deleter,
697 Allocator *basicAllocator,
701, d_allocator_p(basicAllocator)
705template <
class TYPE,
class DELETER>
706SharedPtrOutofplaceRep<TYPE, DELETER>::SharedPtrOutofplaceRep(
708 const DELETER& deleter,
709 Allocator *basicAllocator,
711: d_deleter(deleter, basicAllocator)
713, d_allocator_p(basicAllocator)
717template <
class TYPE,
class DELETER>
718SharedPtrOutofplaceRep<TYPE, DELETER>::SharedPtrOutofplaceRep(
720 const DELETER& deleter,
721 Allocator *basicAllocator,
723: d_deleter(
bsl::allocator_arg, basicAllocator, deleter)
725, d_allocator_p(basicAllocator)
729template <
class TYPE,
class DELETER>
730SharedPtrOutofplaceRep<TYPE, DELETER>::SharedPtrOutofplaceRep(
732 const DELETER& deleter,
733 Allocator *basicAllocator,
737, d_allocator_p(basicAllocator)
741template <
class TYPE,
class DELETER>
742SharedPtrOutofplaceRep<TYPE, DELETER>::~SharedPtrOutofplaceRep()
747template <
class TYPE,
class DELETER>
750 SharedPtrOutofplaceRep_DeleterHelper::deleteObject(d_ptr_p, d_deleter);
754template <
class TYPE,
class DELETER>
773template <
class TYPE,
class DELETER>
778 return (
typeid(d_deleter) == type)
784template <
class TYPE,
class DELETER>
788 return const_cast<void *
>(
static_cast<const void *
>(d_ptr_p));
791template <
class TYPE,
class DELETER>
803template <
class TYPE,
class DELETER>
805void SharedPtrOutofplaceRep_DeleterHelper::deleteObject(
810 deleter->deleteObject(ptr);
813template <
class TYPE,
class DELETER>
815void SharedPtrOutofplaceRep_DeleterHelper::deleteObject(
820 deleter->deleteObject(ptr);
823template <
class TYPE,
class DELETER>
825void SharedPtrOutofplaceRep_DeleterHelper::deleteObject(
833template <
class TYPE,
class DELETER>
835void SharedPtrOutofplaceRep_DeleterHelper::deleteObject(
843template <
class TYPE,
class DELETER>
845void SharedPtrOutofplaceRep_DeleterHelper::deleteObject(
853template <
class TYPE,
class DELETER>
855void SharedPtrOutofplaceRep_DeleterHelper::deleteObject(TYPE *ptr,
858 enum { BSLMA_DELETER_TYPE =
861 SharedPtrOutofplaceRep_DeleterHelper::deleteObject(
872template <
class TYPE,
class DELETER>
881template <
class TYPE,
class DELETER>
903 DELETER>::type tempDeleter(d_deleter);
904 SharedPtrOutofplaceRep_DeleterHelper::deleteObject(d_ptr_p, tempDeleter);
908template <
class TYPE,
class DELETER>
919template <
class TYPE,
class DELETER>
Definition bslma_allocator.h:457
virtual void deallocate(void *address)=0
Allocator * Type
Definition bslma_sharedptroutofplacerep.h:503
Definition bslma_sharedptroutofplacerep.h:443
bsl::conditional< bsl::is_function< DELETER >::value, DELETER *, DELETER >::type Type
Definition bslma_sharedptroutofplacerep.h:479
@ VALUE
Definition bslma_sharedptroutofplacerep.h:466
Definition bslma_sharedptroutofplacerep.h:513
@ VALUE
Definition bslma_sharedptroutofplacerep.h:525
ImpType::Type Type
Definition bslma_sharedptroutofplacerep.h:530
Definition bslma_sharedptroutofplacerep.h:311
void disposeObject() BSLS_KEYWORD_OVERRIDE
Definition bslma_sharedptroutofplacerep.h:748
void disposeRep() BSLS_KEYWORD_OVERRIDE
Definition bslma_sharedptroutofplacerep.h:756
static SharedPtrOutofplaceRep< TYPE, DELETER > * makeOutofplaceRep(TYPE *ptr, const DELETER &deleter, Allocator *basicAllocator=0)
Definition bslma_sharedptroutofplacerep.h:656
void * originalPtr() const BSLS_KEYWORD_OVERRIDE
Definition bslma_sharedptroutofplacerep.h:786
void * getDeleter(const std::type_info &type) BSLS_KEYWORD_OVERRIDE
Definition bslma_sharedptroutofplacerep.h:776
TYPE * ptr() const
Definition bslma_sharedptroutofplacerep.h:793
Definition bslma_sharedptrrep.h:338
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#define BSLS_KEYWORD_OVERRIDE
Definition bsls_keyword.h:653
Definition bdlb_printmethods.h:283
Definition balxml_encoderoptions.h:68
Definition bslmf_conditional.h:120
Definition bslmf_integralconstant.h:244
Definition bslmf_isconvertible.h:867
Definition bslmf_ispointer.h:138
Definition bslma_default.h:740
static Allocator * allocator(Allocator *basicAllocator=0)
Definition bslma_default.h:897
Definition bslma_sharedptroutofplacerep.h:539
SharedPtrOutofplaceRep_DeleterType DeleterType
Definition bslma_sharedptroutofplacerep.h:545
Definition bslma_sharedptroutofplacerep.h:270
@ BSLMA_FUNCTOR_WITH_ALLOC_ARG_T
Definition bslma_sharedptroutofplacerep.h:287
@ BSLMA_FUNCTOR_WITHOUT_ALLOC
Definition bslma_sharedptroutofplacerep.h:293
@ BSLMA_ALLOCATOR_PTR
Definition bslma_sharedptroutofplacerep.h:275
@ BSLMA_FACTORY_PTR
Definition bslma_sharedptroutofplacerep.h:279
@ BSLMA_FUNCTOR_WITH_ALLOC
Definition bslma_sharedptroutofplacerep.h:283
Definition bslma_sharedptroutofplacerep.h:620
void release()
Release from management the object referred to by this proctor.
Definition bslma_sharedptroutofplacerep.h:910
SharedPtrOutofplaceRep_InitProctor(TYPE *ptr, const DELETER &deleter)
Definition bslma_sharedptroutofplacerep.h:875
const DELETER & d_deleter
Definition bslma_sharedptroutofplacerep.h:626
TYPE * d_ptr_p
Definition bslma_sharedptroutofplacerep.h:623
~SharedPtrOutofplaceRep_InitProctor()
Definition bslma_sharedptroutofplacerep.h:884
Definition bslma_usesbslmaallocator.h:343
Definition bslmf_functionpointertraits.h:153
Definition bslmf_usesallocatorargt.h:100
static TYPE * addressOf(TYPE &obj)
Definition bsls_util.h:305