Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

TAO::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 TAO::Utils::Auto_Functor< X, Functor >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef X element_type
typedef Functor functor_type

Public Methods

 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 TAO::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 TAO::Utils::Auto_Functor< X, Functor >::element_type
 

template<typename X, typename Functor>
typedef Functor TAO::Utils::Auto_Functor< X, Functor >::functor_type
 


Constructor & Destructor Documentation

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

Constructor.

template<typename X, typename Functor>
ACE_INLINE TAO::Utils::Auto_Functor< X, Functor >::Auto_Functor Auto_Functor< X, Functor > &    rhs throw ()
 

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

template<typename X, typename Functor>
TAO::Utils::Auto_Functor< X, Functor >::~Auto_Functor   throw ()
 

template<typename X, typename Functor>
ACE_INLINE TAO::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 & TAO::Utils::Auto_Functor< X, Functor >::functor   throw ()
 

template<typename X, typename Functor>
ACE_INLINE X * TAO::Utils::Auto_Functor< X, Functor >::get   throw ()
 

template<typename X, typename Functor>
ACE_INLINE X & TAO::Utils::Auto_Functor< X, Functor >::operator *   throw ()
 

template<typename X, typename Functor>
template<typename Y>
TAO::Utils::Auto_Functor< X, Functor >::operator Auto_Functor   throw ()
 

template<typename X, typename Functor>
template<typename Y>
TAO::Utils::Auto_Functor< X, Functor >::operator Auto_Functor_Ref   throw ()
 

template<typename X, typename Functor>
ACE_INLINE X * TAO::Utils::Auto_Functor< X, Functor >::operator->   throw ()
 

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

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

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

template<typename X, typename Functor>
ACE_INLINE X * TAO::Utils::Auto_Functor< X, Functor >::release   throw ()
 

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

template<typename X, typename Functor>
void TAO::Utils::Auto_Functor< X, Functor >::reset X *    p = 0 throw ()
 


Member Data Documentation

template<typename X, typename Functor>
Functor TAO::Utils::Auto_Functor< X, Functor >::f_ [private]
 

template<typename X, typename Functor>
X* TAO::Utils::Auto_Functor< X, Functor >::p_ [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Jan 14 23:42:10 2004 for TAO by doxygen1.2.18