AtScopeExit< T, X > Class Template Reference

Invoke a function at scope exit. More...

#include <common.h>

Collaboration diagram for AtScopeExit< T, X >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 AtScopeExit (T func, X target)
 ~AtScopeExit ()

Private Attributes

m_func
m_target

Detailed Description

template<typename T, typename X>
class AtScopeExit< T, X >

Invoke a function at scope exit.

For example, to free a ptr using free() when a function exists create a object like this: AtScopeExit<void (*)(), void*> delPtr(free, ptr); Thus when delPtr is destroyed free(ptr) will be invoked.


Constructor & Destructor Documentation

template<typename T, typename X>
AtScopeExit< T, X >::AtScopeExit ( func,
target 
) [inline]

template<typename T, typename X>
AtScopeExit< T, X >::~AtScopeExit (  )  [inline]


Member Data Documentation

template<typename T, typename X>
T AtScopeExit< T, X >::m_func [private]

template<typename T, typename X>
X AtScopeExit< T, X >::m_target [private]


The documentation for this class was generated from the following file:
Generated on Sun Mar 11 15:33:26 2007 for MetalWarriors by  doxygen 1.4.7