[#BloombergLP-bslma-DeallocateObjectProctor]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::DeallocateObjectProctor
:relfileprefix: ../../
:mrdocs:

This class implements a proctor that, unless its `release` method has previously been invoked, automatically deallocates a managed object upon destruction by invoking the `deallocate` method of an allocator (or pool) of parameterized `ALLOCATOR` type supplied to it at construction&period; The managed object of parameterized `TYPE` must be memory that was provided by this allocator (or pool)&semi; the allocator (or pool) must remain valid throughout the lifetime of the proctor object&period; If `ALLOCATOR` is a non&hyphen;pointer type, it is assumed to be STL compatible&semi; otherwise, it is assumed have a `deallocate` method with a single &apos;void &ast;&apos; parameter, i&period;e&period;, the same deallocation interface as `bslma&colon;&colon;Allocator`&period;

== Synopsis

Declared in `&lt;bslma&lowbar;deallocateobjectproctor&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class ALLOCATOR,
    class TYPE = ALLOCATOR::value&lowbar;type&gt;
class DeallocateObjectProctor;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslma/DeallocateObjectProctor/2constructor-0d.adoc[`DeallocateObjectProctor`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bslma/DeallocateObjectProctor/2destructor.adoc[`&#126;DeallocateObjectProctor`] [.small]#[destructor]#
| Deallocate the managed objects, if any&period; Note that the managed objects&apos; destructors are not invoked&period;
| xref:BloombergLP/bslma/DeallocateObjectProctor/ptr.adoc[`ptr`] 
| Return the address of the currently managed objects, if engaged&semi; otherwise return a null pointer&period;
| xref:BloombergLP/bslma/DeallocateObjectProctor/release.adoc[`release`] 
| Disengage this allocator and return a pointer to the formerly managed object(s)&period;
| xref:BloombergLP/bslma/DeallocateObjectProctor/reset.adoc[`reset`] 
| Release the managed object and reset this proctor to manage the specified `p` pointer to optionally specified `n` objects&period; If `p` is null, then the proctor will be disenaged&period; Note that the previously managed objects are not deallocated&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
