Quick Links:

bal | bbl | bdl | bsl

Public Member Functions

bslma::DestructorProctor< TYPE > Class Template Reference

#include <bslma_destructorproctor.h>

List of all members.

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 Component bslma_destructorproctor


Constructor & Destructor Documentation

template<class TYPE>
bslma::DestructorProctor< TYPE >::DestructorProctor ( TYPE *  object  )  [explicit]

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.

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

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

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

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

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

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: