8#ifndef INCLUDED_BSLMA_DEALLOCATEBYTESPROCTOR
9#define INCLUDED_BSLMA_DEALLOCATEBYTESPROCTOR
234#include <bslscm_version.h>
253template <
class ALLOCATOR>
254struct DeallocateBytesProctor_PtrType;
271template <
class ALLOCATOR>
283 ALLOCATOR d_allocator;
285 std::size_t d_nbytes;
286 std::size_t d_alignment;
319 std::size_t alignment = k_MAX_ALIGNMENT);
347 std::size_t alignment = k_MAX_ALIGNMENT);
369template <
class ALLOCATOR>
379template <
class ALLOCATOR>
391template <
class ALLOCATOR>
396 d_nbytes, d_alignment);
399template <
class ALLOCATOR>
401void DeallocateBytesProctor<ALLOCATOR>::doDeallocate(
bsl::true_type)
403 d_allocator->deallocate(d_bytes_p);
407template <
class ALLOCATOR>
410 const ALLOCATOR& allocator,
413 std::size_t alignment)
414 : d_allocator(allocator)
417 , d_alignment(alignment)
421template <
class ALLOCATOR>
425 : d_allocator(
MoveUtil::access(original).d_allocator)
426 , d_bytes_p(
MoveUtil::access(original).d_bytes_p)
427 , d_nbytes(
MoveUtil::access(original).d_nbytes)
428 , d_alignment(
MoveUtil::access(original).d_alignment)
433template <
class ALLOCATOR>
443template <
class ALLOCATOR>
445typename DeallocateBytesProctor<ALLOCATOR>::PtrType
448 PtrType ret = d_bytes_p;
449 d_bytes_p = PtrType();
453template <
class ALLOCATOR>
457 std::size_t alignment)
461 d_alignment = alignment;
465template <
class ALLOCATOR>
467typename DeallocateBytesProctor<ALLOCATOR>::PtrType
Definition bslma_deallocatebytesproctor.h:272
~DeallocateBytesProctor()
Definition bslma_deallocatebytesproctor.h:435
PtrType release()
Definition bslma_deallocatebytesproctor.h:446
DeallocateBytesProctor(bslmf::MovableRef< DeallocateBytesProctor > original)
Definition bslma_deallocatebytesproctor.h:423
void reset(PtrType p, std::size_t nbytes, std::size_t alignment=k_MAX_ALIGNMENT)
Definition bslma_deallocatebytesproctor.h:455
DeallocateBytesProctor(const ALLOCATOR &allocator, PtrType p, std::size_t nbytes, std::size_t alignment=k_MAX_ALIGNMENT)
Definition bslma_deallocatebytesproctor.h:409
PtrType ptr() const
Definition bslma_deallocatebytesproctor.h:468
Definition bslmf_movableref.h:752
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
#define BSLS_KEYWORD_DELETED
Definition bsls_keyword.h:651
Definition baljsn_encoder_testtypes.h:76
BloombergLP::bslma::AllocatorTraits_VoidPointerType< ALLOCATOR_TYPE >::type void_pointer
Definition bslma_allocatortraits.h:1186
Definition bslmf_integralconstant.h:261
Definition bslmf_ispointer.h:138
static void deallocateBytes(const t_ALLOCATOR &allocator, typename AllocatorUtil_Traits< t_ALLOCATOR >::void_pointer p, std::size_t nbytes, std::size_t alignment=0)
Definition bslma_allocatorutil.h:930
void * type
Definition bslma_deallocatebytesproctor.h:383
Definition bslma_deallocatebytesproctor.h:371
bsl::allocator_traits< ALLOCATOR >::void_pointer type
Definition bslma_deallocatebytesproctor.h:373
Definition bslmf_movableref.h:795
static t_TYPE & access(t_TYPE &ref) BSLS_KEYWORD_NOEXCEPT
Definition bslmf_movableref.h:1039
@ BSLS_MAX_ALIGNMENT
Definition bsls_alignmentutil.h:300