This class implements a range proctor that, unless its release method has previously been invoked, automatically deletes the contiguous sequence of managed objects upon destruction by iterating on each (managed) object, first invoking the object's destructor, and then free memory by invoking the deallocate method of an allocator (or pool) of parameterized ALLOCATOR type supplied to it at construction. The sequence of managed objects of parameterized TYPE must have been created using memory provided by this allocator (or pool), which must remain valid throughout the lifetime of this range proctor. Note that when the length of this object is non‐zero, it must refer to a non‐null array of objects.
Synopsis
Declared in <bslma_autorawdeleter.h>
template<
class TYPE,
class ALLOCATOR>
class AutoRawDeleter;
Member Functions
Name |
Description |
|
Create an auto raw deleter to manage an array of objects at the specified |
|
Destroy this range proctor and delete the contiguous sequence of objects it manages (if any) by iterating over each (managed) object, first invoking the object's destructor, and then freeing memory by invoking the |
Return the (signed) length of the sequence of objects managed by this range proctor. |
|
Increase by one the (signed) length of the sequence of objects managed by this range proctor. The behavior is undefined unless the origin of the sequence of objects managed by this proctor is non‐zero. The behavior is undefined unless the origin or this range proctor is non‐zero. Note that if the length of this proctor is currently negative, the number of managed objects will decrease by one, whereas if the length is non‐negative, the number of managed objects will increase by one. |
|
Decrease by one the (signed) length of the sequence of objects managed by this range proctor. The behavior is undefined unless the origin of the sequence of objects managed by this proctor is non‐zero. The behavior is undefined unless the origin or this range proctor is non‐zero. Note that if the length of this proctor is currently positive, the number of managed objects will decrease by one, whereas if the length is non‐positive, the number of managed objects will increase by one. |
|
Release from management the sequence of objects currently managed by this range proctor by setting the length of the managed sequence to 0. All objects currently under management will become unmanaged (i.e., when the proctor goes out of scope and it was not assigned another sequence of objects to manage by invoking |
|
Set the specified |
|
Set the (signed) length of the sequence of objects managed by this range proctor to the specified |
Created with MrDocs