This class implements a range proctor that destroys managed objects.

Synopsis

Declared in <bslma_autodestructor.h>

template<class TYPE>
class AutoDestructor;

Description

This class implements a range proctor that, unless its release method has previously been invoked, automatically destroys the contiguous sequence of managed objects upon its own destruction by invoking each object's destructor. If release is invoked (see release), the proctor will not destroy any objects upon its own destruction (unless reset is invoked to assign the proctor another contiguous sequence of objects for management). Note that when the length of this object is non‐zero, it must refer to a non‐null array of objects.

Member Functions

Name

Description

AutoDestructor [constructor]

Create a range proctor to manage an array of objects.

~AutoDestructor [destructor]

Destroy this range proctor and the objects it manages.

length

Return the (signed) length of the sequence of objects managed by this range proctor.

operator++

Increase by one the (signed) length of the managed object sequence.

operator‐‐

Decrease by one the (signed) length of the managed object sequence.

release

Release from management the sequence of objects managed by this proctor.

reset

Set the origin of the sequence of objects managed by this proctor.

setLength

Set the (signed) length of the managed object sequence.

Created with MrDocs