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

This class implements a proctor that, unless its `release` method has previously been invoked, automatically deletes a managed object upon destruction by first invoking the object&apos;s destructor, and then 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 have been created using memory provided by this allocator (or pool), which 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 `void &ast;` parameter, i&period;e&period;, the same deallocation interface as `bslma&colon;&colon;Allocator`&period;

== Synopsis

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

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

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslma/DeleteObjectProctor/2constructor-0f.adoc[`DeleteObjectProctor`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bslma/DeleteObjectProctor/2destructor.adoc[`&#126;DeleteObjectProctor`] [.small]#[destructor]#
| Destroy and deallocate the managed object, if any&period;
| xref:BloombergLP/bslma/DeleteObjectProctor/ptr.adoc[`ptr`] 
| Return the address of the currently managed object, if engaged&semi; otherwise return null&period;
| xref:BloombergLP/bslma/DeleteObjectProctor/release.adoc[`release`] 
| Disengage this allocator and return a pointer to the formerly managed object&period;
| xref:BloombergLP/bslma/DeleteObjectProctor/reset.adoc[`reset`] 
| Release the managed object and reset this proctor to manage the specified `p` object&period; If `p` is null, the proctor will be disengaged&period; Note that the previously managed object is not destroyed or deallocated&period;
|===



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