# ACE_Utils::Auto_Functor< X, Functor > Class Template Reference

Helper template to implement auto_ptr<>-like classes, but executing a functor in the destructor, instead of always deleting things. More...

`#include <Auto_Functor.h>`

Collaboration diagram for ACE_Utils::Auto_Functor< X, Functor >:

[legend]
List of all members.

## Public Types

typedef X | element_type
typedef Functor | functor_type

## Public Member Functions

| Auto_Functor (X *p=0, Functor functor=Functor()) throw ()
| Constructor.
| Auto_Functor (Auto_Functor &rhs) throw ()
Auto_Functor< X, Functor > & | operator= (Auto_Functor &rhs) throw ()
template<typename Y>
| Auto_Functor (Auto_Functor< Y, Functor > &rhs) throw ()
template<typename Y>
Auto_Functor< X, Functor > & | operator= (Auto_Functor< Y, Functor > &rhs) throw ()
| ~Auto_Functor () throw ()
X & | operator * () const throw ()
X * | operator-> () const throw ()
X * | get () throw ()
X * | release () throw ()
void | reset (X *p=0) throw ()
void | reset (X *p, Functor f) throw ()
Functor const & | functor () const throw ()
| Auto_Functor (Auto_Functor_Ref< X, Functor > rhs) throw ()
Auto_Functor< X, Functor > & | operator= (Auto_Functor_Ref< X, Functor > rhs) throw ()
template<typename Y>
| operator Auto_Functor_Ref () throw ()
template<typename Y>
| operator Auto_Functor () throw ()

## Private Attributes

X * | p_
Functor | f_

## Detailed Description

### template<typename X, typename Functor>
class ACE_Utils::Auto_Functor< X, Functor >

Helper template to implement auto_ptr<>-like classes, but executing a functor in the destructor, instead of always deleting things.

The functor is called in the destructor, and it must implement:

Functor() throw();
Functor(Functor const &) throw();
Functor & operator=(Functor const &) throw();
void operator()(X * p) throw();

## Member Typedef Documentation

template<typename X, typename Functor>
typedef X ACE_Utils::Auto_Functor< X, Functor >::element_type

template<typename X, typename Functor>
typedef Functor ACE_Utils::Auto_Functor< X, Functor >::functor_type

## Constructor & Destructor Documentation

template<typename X, typename Functor>
ACE_INLINE ACE_Utils::Auto_Functor< X, Functor >::Auto_Functor | ( | X * | p = `0`,
|  | Functor | functor = `Functor()`
| ) | throw ()`[explicit]`

| Constructor.

template<typename X, typename Functor>
ACE_INLINE ACE_Utils::Auto_Functor< X, Functor >::Auto_Functor | ( | Auto_Functor< X, Functor > & | rhs | ) | throw ()

template<typename X, typename Functor>
template<typename Y>
ACE_INLINE ACE_Utils::Auto_Functor< X, Functor >::Auto_Functor | ( | Auto_Functor< Y, Functor > & | rhs | ) | throw ()

template<typename X, typename Functor>
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Utils::Auto_Functor< X, Functor >::~Auto_Functor | ( |  | ) | throw ()

template<typename X, typename Functor>
ACE_INLINE ACE_Utils::Auto_Functor< X, Functor >::Auto_Functor | ( | Auto_Functor_Ref< X, Functor > | rhs | ) | throw ()

## Member Function Documentation

template<typename X, typename Functor>
ACE_INLINE Functor const & ACE_Utils::Auto_Functor< X, Functor >::functor | ( |  | ) | const throw ()

template<typename X, typename Functor>
ACE_INLINE X * ACE_Utils::Auto_Functor< X, Functor >::get | ( |  | ) | throw ()

template<typename X, typename Functor>
ACE_INLINE X & ACE_Utils::Auto_Functor< X, Functor >::operator * | ( |  | ) | const throw ()

template<typename X, typename Functor>
template<typename Y>
ACE_Utils::Auto_Functor< X, Functor >::operator Auto_Functor | ( |  | ) | throw ()

template<typename X, typename Functor>
template<typename Y>
ACE_Utils::Auto_Functor< X, Functor >::operator Auto_Functor_Ref | ( |  | ) | throw ()

template<typename X, typename Functor>
ACE_INLINE X * ACE_Utils::Auto_Functor< X, Functor >::operator-> | ( |  | ) | const throw ()

template<typename X, typename Functor>
ACE_INLINE ACE_Utils::Auto_Functor< X, Functor > & ACE_Utils::Auto_Functor< X, Functor >::operator= | ( | Auto_Functor_Ref< X, Functor > | rhs | ) | throw ()

template<typename X, typename Functor>
template<typename Y>
ACE_INLINE ACE_Utils::Auto_Functor< X, Functor > & ACE_Utils::Auto_Functor< X, Functor >::operator= | ( | Auto_Functor< Y, Functor > & | rhs | ) | throw ()

template<typename X, typename Functor>
ACE_INLINE ACE_Utils::Auto_Functor< X, Functor > & ACE_Utils::Auto_Functor< X, Functor >::operator= | ( | Auto_Functor< X, Functor > & | rhs | ) | throw ()

template<typename X, typename Functor>
ACE_INLINE X * ACE_Utils::Auto_Functor< X, Functor >::release | ( |  | ) | throw ()

template<typename X, typename Functor>
void ACE_Utils::Auto_Functor< X, Functor >::reset | ( | X * | p,
|  | Functor | f
| ) | throw ()

template<typename X, typename Functor>
void ACE_Utils::Auto_Functor< X, Functor >::reset | ( | X * | p = `0` | ) | throw ()

## Member Data Documentation

template<typename X, typename Functor>
Functor ACE_Utils::Auto_Functor< X, Functor >::f_`[private]`

template<typename X, typename Functor>
X* ACE_Utils::Auto_Functor< X, Functor >::p_`[private]`

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

- Auto_Functor.h
- Auto_Functor.cpp
- Auto_Functor.inl