Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/util/Cleaner.h>
Public Member Functions | |
~CleanList (void) | |
void | add (Cleaner *cleaner) |
template<class T > | |
void | add (T *p) |
void | clean (void) |
Cleaner * | operator() (Cleaner *cleaner) |
template<class T > | |
const LockPtr< T > & | operator() (const LockPtr< T > &object) |
template<class T > | |
T * | operator() (T *object) |
A CleanList is an easy way to not forget or to delegate clean-up in complex program. A CleanList receives a list of Cleaner object that records some cleanup to perform. When
the CleanList is deleted or when the method clean() is called, clean-up actions of all stored object is invoked ensuring to not forget clean-up to perform. @code
{ CleanList to_clean; int *p = to_clean(new int); ... } // p deletion automatically performed at clean deletion
References CleanList::clean().
Add a cleaner to the list.
cleaner | Cleaner to add. |
References List< T, E, A >::add().
Referenced by CleanList::operator()().
|
inline |
References CleanList::add(), and elm::io::p().
Referenced by CleanList::add().
Clean the recorded cleaners.
References List< T, E, A >::clear().
Referenced by CleanList::~CleanList().
References CleanList::add().
References CleanList::add().
|
inline |
References CleanList::add().