Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members

s11n::pointer_cleaner< T > Class Template Reference

A poor-man's garbage collector. More...

#include <pointer_cleaner.h>

List of all members.

Public Types

typedef T value_type

Public Member Functions

 pointer_cleaner ()
 This is the only way to construct a new cleaner: they may not be copied.
 ~pointer_cleaner ()
 Deletes any objects added via o.
void add (value_type *o)
 Adds o to be deleted when this object goes out of scope.


Detailed Description

template<typename T>
class s11n::pointer_cleaner< T >

A poor-man's garbage collector.

It destroys any pointers added to it when it is destroyed.

This type models Non-Copyable. The only thing of use you can do with them is create them and then use their add() function.

Definition at line 25 of file pointer_cleaner.h.


Member Function Documentation

template<typename T>
void s11n::pointer_cleaner< T >::add value_type *  o  )  [inline]
 

Adds o to be deleted when this object goes out of scope.

Once you do this, there is no way to remove o from the this object's Path of Destruction.

Definition at line 52 of file pointer_cleaner.h.


The documentation for this class was generated from the following file:
Generated on Tue Oct 26 18:26:00 2004 for s11n by  doxygen 1.3.9.1