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&);
109#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
112#ifndef BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT
113#define BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT 14
115#ifndef BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A
116#define BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT
119#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 0
120 explicit SharedPtrInplaceRep(Allocator *basicAllocator);
123#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 1
124 template <
class ARGS_01>
125 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
129#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 2
130 template <
class ARGS_01,
132 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
137#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 3
138 template <
class ARGS_01,
141 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
147#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 4
148 template <
class ARGS_01,
152 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
159#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 5
160 template <
class ARGS_01,
165 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
173#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 6
174 template <
class ARGS_01,
180 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
189#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 7
190 template <
class ARGS_01,
197 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
207#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 8
208 template <
class ARGS_01,
216 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
227#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 9
228 template <
class ARGS_01,
237 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
249#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 10
250 template <
class ARGS_01,
260 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
273#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 11
274 template <
class ARGS_01,
285 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
299#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 12
300 template <
class ARGS_01,
312 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
327#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 13
328 template <
class ARGS_01,
341 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
357#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 14
358 template <
class ARGS_01,
372 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
393 template <
class... ARGS>
394 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
447struct SharedPtrInplaceRep_ImpUtil {
457 template <
class TYPE>
458 static const TYPE& forward(
const TYPE& reference);
459 template <
class TYPE>
460 static BloombergLP::bslmf::MovableRef<TYPE> forward(
461 const BloombergLP::bslmf::MovableRef<TYPE>& reference);
464 template <
class TYPE>
465 static void dispose(
const TYPE&
object);
468 template <
class TYPE,
size_t SIZE>
469 static void dispose(
const TYPE (&
object)[SIZE]);
491 const BloombergLP::bslmf::MovableRef<TYPE>& reference)
503template <
class TYPE,
size_t SIZE>
507 for (
size_t i = 0; i < SIZE; ++i) {
517#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
520#ifndef BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT
521#define BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT 14
523#ifndef BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B
524#define BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT
526#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 0
528SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator)
529: d_allocator_p(basicAllocator)
535#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 1
537template <
class ARGS_01>
538SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
540: d_allocator_p(basicAllocator)
546#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 2
548template <
class ARGS_01,
550SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
553: d_allocator_p(basicAllocator)
560#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 3
562template <
class ARGS_01,
565SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
569: d_allocator_p(basicAllocator)
577#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 4
579template <
class ARGS_01,
583SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
588: d_allocator_p(basicAllocator)
597#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 5
599template <
class ARGS_01,
604SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
610: d_allocator_p(basicAllocator)
620#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 6
622template <
class ARGS_01,
628SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
635: d_allocator_p(basicAllocator)
646#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 7
648template <
class ARGS_01,
655SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
663: d_allocator_p(basicAllocator)
675#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 8
677template <
class ARGS_01,
685SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
694: d_allocator_p(basicAllocator)
707#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 9
709template <
class ARGS_01,
718SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
728: d_allocator_p(basicAllocator)
742#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 10
744template <
class ARGS_01,
754SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
765: d_allocator_p(basicAllocator)
780#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 11
782template <
class ARGS_01,
793SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
805: d_allocator_p(basicAllocator)
821#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 12
823template <
class ARGS_01,
835SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
848: d_allocator_p(basicAllocator)
865#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 13
867template <
class ARGS_01,
880SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
894: d_allocator_p(basicAllocator)
912#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 14
914template <
class ARGS_01,
928SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
943: d_allocator_p(basicAllocator)
966template <
class... ARGS>
967SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
969: d_allocator_p(basicAllocator)
977SharedPtrInplaceRep<TYPE>::~SharedPtrInplaceRep()
985void SharedPtrInplaceRep<TYPE>::disposeObject()
987 SharedPtrInplaceRep_ImpUtil::dispose(d_instance);
992void SharedPtrInplaceRep<TYPE>::disposeRep()
994 d_allocator_p->deallocate(
this);
999void *SharedPtrInplaceRep<TYPE>::getDeleter(
const std::type_info&)
1004template <
class TYPE>
1006TYPE *SharedPtrInplaceRep<TYPE>::ptr()
1012template <
class TYPE>
1014void *SharedPtrInplaceRep<TYPE>::originalPtr()
const
1026template <
class ELEMENT_TYPE>
1027struct UsesBslmaAllocator<SharedPtrInplaceRep<ELEMENT_TYPE> >
1035# error Not valid except when included from bslma_sharedptrinplacerep.h
void * getDeleter(const std::type_info &type) BSLS_KEYWORD_OVERRIDE
Definition bslma_sharedptrinplacerep.h:434
void * originalPtr() const BSLS_KEYWORD_OVERRIDE
Definition bslma_sharedptrinplacerep.h:449
void disposeObject() BSLS_KEYWORD_OVERRIDE
Definition bslma_sharedptrinplacerep.h:420
void disposeRep() BSLS_KEYWORD_OVERRIDE
Definition bslma_sharedptrinplacerep.h:427
TYPE * ptr()
Definition bslma_sharedptrinplacerep.h:441
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1976
#define BSLS_COMPILERFEATURES_FORWARD_REF(T)
Definition bsls_compilerfeatures.h:2343
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2349
#define BSLS_KEYWORD_OVERRIDE
Definition bsls_keyword.h:695
Definition baljsn_encoder_testtypes.h:76
Definition bdldfp_decimal.h:5549
Definition bslmf_integralconstant.h:261
static const TYPE & forward(const TYPE &reference)
Definition bslma_sharedptrinplacerep.h:366
static void dispose(const TYPE &object)
Destroy the specified object.
Definition bslma_sharedptrinplacerep.h:381
static TYPE * addressOf(TYPE &obj)
Definition bsls_util.h:312