BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslma::DestructorProctor< TYPE > Class Template Reference

#include <bslma_destructorproctor.h>

Public Member Functions

 DestructorProctor (TYPE *object)
 
 ~DestructorProctor ()
 
void release ()
 
void reset (TYPE *object)
 

Detailed Description

template<class TYPE>
class bslma::DestructorProctor< TYPE >

This class implements a proctor that, unless its release method has previously been invoked, automatically destroys a managed object upon destruction by invoking the (managed) object's destructor.

See bslma_destructorproctor

Constructor & Destructor Documentation

◆ DestructorProctor()

template<class TYPE >
bslma::DestructorProctor< TYPE >::DestructorProctor ( TYPE *  object)
inlineexplicit

Create a destructor proctor that conditionally manages the specified object (if non-zero) by invoking the destructor of the object managed by this proctor (if not released – see release) upon destruction.

◆ ~DestructorProctor()

template<class TYPE >
bslma::DestructorProctor< TYPE >::~DestructorProctor ( )
inline

Destroy this destructor proctor, and destroy the object it manages (if any) by invoking the destructor of the (managed) object. If no object is currently being managed, this method has no effect.

Member Function Documentation

◆ release()

template<class TYPE >
void bslma::DestructorProctor< TYPE >::release ( )
inline

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

◆ reset()

template<class TYPE >
void bslma::DestructorProctor< TYPE >::reset ( TYPE *  object)
inline

Set the specified object as the object to be managed by this proctor. The behavior is undefined unless object is non-zero. Note that this method releases any previously-managed object from management (without destroying it), 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: