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;
317 std::size_t alignment = k_MAX_ALIGNMENT);
343 std::size_t alignment = k_MAX_ALIGNMENT);
365template <
class ALLOCATOR>
375template <
class ALLOCATOR>
387template <
class ALLOCATOR>
392 d_nbytes, d_alignment);
395template <
class ALLOCATOR>
397void DeallocateBytesProctor<ALLOCATOR>::doDeallocate(
bsl::true_type)
399 d_allocator->deallocate(d_bytes_p);
403template <
class ALLOCATOR>
406 const ALLOCATOR& allocator,
409 std::size_t alignment)
410 : d_allocator(allocator)
413 , d_alignment(alignment)
417template <
class ALLOCATOR>
421 : d_allocator(
MoveUtil::access(original).d_allocator)
422 , d_bytes_p(
MoveUtil::access(original).d_bytes_p)
423 , d_nbytes(
MoveUtil::access(original).d_nbytes)
424 , d_alignment(
MoveUtil::access(original).d_alignment)
429template <
class ALLOCATOR>
439template <
class ALLOCATOR>
441typename DeallocateBytesProctor<ALLOCATOR>::PtrType
444 PtrType ret = d_bytes_p;
445 d_bytes_p = PtrType();
449template <
class ALLOCATOR>
453 std::size_t alignment)
457 d_alignment = alignment;
461template <
class ALLOCATOR>
463typename DeallocateBytesProctor<ALLOCATOR>::PtrType
Definition bslma_deallocatebytesproctor.h:272
~DeallocateBytesProctor()
Definition bslma_deallocatebytesproctor.h:431
PtrType release()
Definition bslma_deallocatebytesproctor.h:442
DeallocateBytesProctor(bslmf::MovableRef< DeallocateBytesProctor > original)
Definition bslma_deallocatebytesproctor.h:419
void reset(PtrType p, std::size_t nbytes, std::size_t alignment=k_MAX_ALIGNMENT)
Definition bslma_deallocatebytesproctor.h:451
DeallocateBytesProctor(const ALLOCATOR &allocator, PtrType p, std::size_t nbytes, std::size_t alignment=k_MAX_ALIGNMENT)
Definition bslma_deallocatebytesproctor.h:405
PtrType ptr() const
Definition bslma_deallocatebytesproctor.h:464
Definition bslmf_movableref.h:751
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#define BSLS_KEYWORD_DELETED
Definition bsls_keyword.h:609
Definition balxml_encoderoptions.h:68
BloombergLP::bslma::AllocatorTraits_VoidPointerType< ALLOCATOR_TYPE >::type void_pointer
Definition bslma_allocatortraits.h:1155
Definition bslmf_integralconstant.h:244
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=k_MAX_ALIGNMENT)
Definition bslma_allocatorutil.h:911
void * type
Definition bslma_deallocatebytesproctor.h:379
Definition bslma_deallocatebytesproctor.h:367
bsl::allocator_traits< ALLOCATOR >::void_pointer type
Definition bslma_deallocatebytesproctor.h:369
Definition bslmf_movableref.h:791
static t_TYPE & access(t_TYPE &ref) BSLS_KEYWORD_NOEXCEPT
Definition bslmf_movableref.h:1032
@ BSLS_MAX_ALIGNMENT
Definition bsls_alignmentutil.h:275