UtiLite  0.3.1
A lite utilities library
Public Member Functions
UDestroyer< T > Class Template Reference

#include <UDestroyer.h>

List of all members.

Public Member Functions

 UDestroyer (T *doomed=0)
bool setDoomed (T *doomed)

Detailed Description

template<class T>
class UDestroyer< T >

This class is used to delete a dynamically created objects. It was mainly designed to remove dynamically created Singleton. Created on the stack of a Singleton, when the application is finished, his destructor make sure that the Singleton is deleted.


Constructor & Destructor Documentation

template<class T>
UDestroyer< T >::UDestroyer ( T *  doomed = 0) [inline]

The constructor. Set the doomed object (take ownership of the object). The object is deleted when this object is deleted.


Member Function Documentation

template<class T>
bool UDestroyer< T >::setDoomed ( T *  doomed) [inline]

Set the doomed object. If a doomed object is already set, the function returns false.

Parameters:
doomedthe doomed object
Returns:
false if an object is already set and the new object is not null, otherwise true

The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Enumerations Friends Defines