Quick Links:

bal | bbl | bdl | bsl

Public Member Functions

bslma::RawDeleterGuard< TYPE, ALLOCATOR > Class Template Reference

#include <bslma_rawdeleterguard.h>

List of all members.

Public Member Functions

 RawDeleterGuard (TYPE *object, ALLOCATOR *allocator)
 ~RawDeleterGuard ()

Detailed Description

template<class TYPE, class ALLOCATOR>
class bslma::RawDeleterGuard< TYPE, ALLOCATOR >

This class implements a guard that unconditionally 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 guard object.

See Component bslma_rawdeleterguard


Constructor & Destructor Documentation

template<class TYPE, class ALLOCATOR>
bslma::RawDeleterGuard< TYPE, ALLOCATOR >::RawDeleterGuard ( TYPE *  object,
ALLOCATOR *  allocator 
)

Create a raw deleter guard that unconditionally manages the specified object, and that uses the specified allocator to delete object upon the destruction of this guard. The behavior is undefined unless object and allocator are non-zero, and allocator supplied the memory for object. Note that allocator must remain valid throughout the lifetime of this guard.

template<class TYPE, class ALLOCATOR>
bslma::RawDeleterGuard< TYPE, ALLOCATOR >::~RawDeleterGuard (  ) 

Destroy this raw deleter guard and delete the object it manages by first invoking the destructor of the (managed) object, and then invoking the deallocate method of the allocator (or pool) that was supplied with the object at construction.


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