11#ifndef INCLUDED_BSLMA_SHAREDPTRINPLACEREP_CPP03
12#define INCLUDED_BSLMA_SHAREDPTRINPLACEREP_CPP03
63#ifdef COMPILING_BSLMA_SHAREDPTRINPLACEREP_H
78class SharedPtrInplaceRep :
public SharedPtrRep {
81 Allocator *d_allocator_p;
94 SharedPtrInplaceRep(
const SharedPtrInplaceRep&);
95 SharedPtrInplaceRep& operator=(
const SharedPtrInplaceRep&);
108#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
111#ifndef BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT
112#define BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT 14
114#ifndef BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A
115#define BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT
118#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 0
119 explicit SharedPtrInplaceRep(Allocator *basicAllocator);
122#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 1
123 template <
class ARGS_01>
124 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
128#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 2
129 template <
class ARGS_01,
131 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
136#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 3
137 template <
class ARGS_01,
140 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
146#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 4
147 template <
class ARGS_01,
151 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
158#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 5
159 template <
class ARGS_01,
164 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
172#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 6
173 template <
class ARGS_01,
179 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
188#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 7
189 template <
class ARGS_01,
196 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
206#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 8
207 template <
class ARGS_01,
215 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
226#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 9
227 template <
class ARGS_01,
236 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
248#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 10
249 template <
class ARGS_01,
259 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
272#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 11
273 template <
class ARGS_01,
284 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
298#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 12
299 template <
class ARGS_01,
311 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
326#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 13
327 template <
class ARGS_01,
340 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
356#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 14
357 template <
class ARGS_01,
371 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
392 template <
class... ARGS>
393 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
440struct SharedPtrInplaceRep_ImpUtil {
449 template <
class TYPE>
450 static const TYPE& forward(
const TYPE& reference);
451 template <
class TYPE>
452 static BloombergLP::bslmf::MovableRef<TYPE> forward(
453 const BloombergLP::bslmf::MovableRef<TYPE>& reference);
457 template <
class TYPE>
458 static void *voidify(TYPE *address);
461 template <
class TYPE>
462 static void dispose(
const TYPE&
object);
465 template <
class TYPE,
size_t SIZE>
466 static void dispose(
const TYPE (&
object)[SIZE]);
488 const BloombergLP::bslmf::MovableRef<TYPE>& reference)
496 return static_cast<void *
>(
507template <
class TYPE,
size_t SIZE>
511 for (
size_t i = 0; i < SIZE; ++i) {
521#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
524#ifndef BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT
525#define BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT 14
527#ifndef BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B
528#define BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT
530#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 0
532SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator)
533: d_allocator_p(basicAllocator)
539#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 1
541template <
class ARGS_01>
542SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
544: d_allocator_p(basicAllocator)
550#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 2
552template <
class ARGS_01,
554SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
557: d_allocator_p(basicAllocator)
564#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 3
566template <
class ARGS_01,
569SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
573: d_allocator_p(basicAllocator)
581#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 4
583template <
class ARGS_01,
587SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
592: d_allocator_p(basicAllocator)
601#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 5
603template <
class ARGS_01,
608SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
614: d_allocator_p(basicAllocator)
624#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 6
626template <
class ARGS_01,
632SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
639: d_allocator_p(basicAllocator)
650#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 7
652template <
class ARGS_01,
659SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
667: d_allocator_p(basicAllocator)
679#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 8
681template <
class ARGS_01,
689SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
698: d_allocator_p(basicAllocator)
711#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 9
713template <
class ARGS_01,
722SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
732: d_allocator_p(basicAllocator)
746#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 10
748template <
class ARGS_01,
758SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
769: d_allocator_p(basicAllocator)
784#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 11
786template <
class ARGS_01,
797SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
809: d_allocator_p(basicAllocator)
825#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 12
827template <
class ARGS_01,
839SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
852: d_allocator_p(basicAllocator)
869#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 13
871template <
class ARGS_01,
884SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
898: d_allocator_p(basicAllocator)
916#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 14
918template <
class ARGS_01,
932SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
947: d_allocator_p(basicAllocator)
970template <
class... ARGS>
971SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
973: d_allocator_p(basicAllocator)
981SharedPtrInplaceRep<TYPE>::~SharedPtrInplaceRep()
989void SharedPtrInplaceRep<TYPE>::disposeObject()
991 SharedPtrInplaceRep_ImpUtil::dispose(d_instance);
996void SharedPtrInplaceRep<TYPE>::disposeRep()
998 d_allocator_p->deallocate(
this);
1001template <
class TYPE>
1003void *SharedPtrInplaceRep<TYPE>::getDeleter(
const std::type_info&)
1008template <
class TYPE>
1010TYPE *SharedPtrInplaceRep<TYPE>::ptr()
1016template <
class TYPE>
1018void *SharedPtrInplaceRep<TYPE>::originalPtr()
const
1020 return const_cast<void *
>(
static_cast<const void *
>(
1031template <
class ELEMENT_TYPE>
1032struct UsesBslmaAllocator<SharedPtrInplaceRep<ELEMENT_TYPE> >
1040# error Not valid except when included from bslma_sharedptrinplacerep.h
void * getDeleter(const std::type_info &type) BSLS_KEYWORD_OVERRIDE
Definition bslma_sharedptrinplacerep.h:433
void * originalPtr() const BSLS_KEYWORD_OVERRIDE
Definition bslma_sharedptrinplacerep.h:448
void disposeObject() BSLS_KEYWORD_OVERRIDE
Definition bslma_sharedptrinplacerep.h:419
void disposeRep() BSLS_KEYWORD_OVERRIDE
Definition bslma_sharedptrinplacerep.h:426
TYPE * ptr()
Definition bslma_sharedptrinplacerep.h:440
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_COMPILERFEATURES_FORWARD_REF(T)
Definition bsls_compilerfeatures.h:2012
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2018
#define BSLS_KEYWORD_OVERRIDE
Definition bsls_keyword.h:653
Definition balxml_encoderoptions.h:68
Definition bdldfp_decimal.h:5188
Definition bslmf_integralconstant.h:244
remove_const< typenameremove_volatile< t_TYPE >::type >::type type
Definition bslmf_removecv.h:126
static void * voidify(TYPE *address)
Definition bslma_sharedptrinplacerep.h:373
static const TYPE & forward(const TYPE &reference)
Definition bslma_sharedptrinplacerep.h:358
static void dispose(const TYPE &object)
Destroy the specified object.
Definition bslma_sharedptrinplacerep.h:380
static TYPE * addressOf(TYPE &obj)
Definition bsls_util.h:305