BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlma::AutoReleaser< ALLOCATOR > Class Template Reference

#include <bdlma_autoreleaser.h>

Public Member Functions

 AutoReleaser (ALLOCATOR *originalAllocator)
 
 ~AutoReleaser ()
 
void release ()
 
void reset (ALLOCATOR *newAllocator)
 

Detailed Description

template<class ALLOCATOR>
class bdlma::AutoReleaser< ALLOCATOR >

This class implements a proctor that invokes the release method of its managed allocator or pool at destruction unless the proctor's release method is invoked.

See bdlma_autoreleaser

Constructor & Destructor Documentation

◆ AutoReleaser()

template<class ALLOCATOR >
bdlma::AutoReleaser< ALLOCATOR >::AutoReleaser ( ALLOCATOR *  originalAllocator)
inline

Create a proctor object to manage the specified originalAllocator. Unless the release method of this proctor is invoked, the release method of originalAllocator is automatically invoked upon destruction of this proctor.

◆ ~AutoReleaser()

template<class ALLOCATOR >
bdlma::AutoReleaser< ALLOCATOR >::~AutoReleaser ( )
inline

Destroy this proctor object and, unless the release method has been invoked on this object with no subsequent call to reset, invoke the release method of the held allocator or pool.

Member Function Documentation

◆ release()

template<class ALLOCATOR >
void bdlma::AutoReleaser< ALLOCATOR >::release ( )
inline

Release from management the allocator or pool currently managed by this proctor. If no allocator or pool is currently being managed, this method has no effect.

◆ reset()

template<class ALLOCATOR >
void bdlma::AutoReleaser< ALLOCATOR >::reset ( ALLOCATOR *  newAllocator)
inline

Set the specified newAllocator as the allocator or pool to be managed by this proctor. Note that this method releases from management any previously held allocator or pool, and so may be invoked with or without having called release when reusing this object.


The documentation for this class was generated from the following file: