BDE 4.14.0 Production release
|
#include <bslma_rawdeleterproctor.h>
Public Member Functions | |
RawDeleterProctor (TYPE *object, ALLOCATOR *allocator) | |
~RawDeleterProctor () | |
void | release () |
void | reset (TYPE *object) |
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's destructor, and then invoking the deallocate
method of an allocator (or pool) of parameterized ALLOCATOR
type supplied to it at construction. 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.
|
inline |
Create a raw deleter proctor that conditionally manages the specified object
(if non-zero), and that uses the specified allocator
to delete the object managed by this proctor (if not released – see release
) upon destruction. The behavior is undefined unless allocator
is non-zero and supplied the memory for object
(if non-zero). Note that allocator
must remain valid throughout the lifetime of this proctor.
|
inline |
Destroy this raw deleter proctor, and delete the object it manages (if any) by first invoking the destructor of the (managed) object, and then invoking the deallocate
method of the allocator (or pool) that was supplied at the construction of this proctor. If no object is currently being managed, this method has no effect.
|
inline |
Release from management the object currently managed by this proctor. If no object is currently being managed, this method has no effect.
|
inline |
Set the specified object
as the object to be managed by this proctor. The behavior is undefined unless object
is non-zero and was allocated from the allocator (or pool) supplied at construction. Note that this method releases any previously-managed object from management (without deleting it), and so may be invoked with or without having called release
when reusing this object.