Proctor that destroys a guarded object unless released.

Synopsis

Declared in <bslalg_autoscalardestructor.h>

template<class OBJECT_TYPE>
class AutoScalarDestructor;

Description

This class provides a specialized proctor object that, upon destruction and unless the release method is called, destroys the guarded object of the parameterized OBJECT_TYPE.

Member Functions

Name

Description

AutoScalarDestructor [constructor]

Create a guard that destroys the specified object unless released.

~AutoScalarDestructor [destructor]

Call the destructor on the object of the parameterized OBJECT_TYPE that is proctored by this guard object, if any, and destroy this object.

release

Set the address of the object proctored by this guard object to 0, thereby releasing from management the object currently managed by this proctor, if any.

reset

Set this guard object to manage the specified object, thereby releasing from management any object currently managed by this proctor, if any.

Created with MrDocs