General KERNEL Documentation     End User KERNEL Services  


DESTRUCTEUR_DE_< TYPE > Class Template Reference

#include <Utils_DESTRUCTEUR_GENERIQUE.hxx>

Inherits DESTRUCTEUR_GENERIQUE_.

Inheritance diagram for DESTRUCTEUR_DE_< TYPE >:

Inheritance graph

Public Member Functions

 DESTRUCTEUR_DE_ (TYPE &objet)
virtual void operator() (void)
 performs the destruction
virtual ~DESTRUCTEUR_DE_ ()

Static Public Member Functions

static const int Ajout (DESTRUCTEUR_GENERIQUE_ &objet)
 adds a destruction object to the list of destructions

Static Public Attributes

static std::list< DESTRUCTEUR_GENERIQUE_ * > * Destructeurs = 0

Detailed Description

template<class TYPE>
class DESTRUCTEUR_DE_< TYPE >

Purpose

The DESTRUCTEUR_DE_ class allows the user to program - at any moment - the destruction of an object at the end of the process.

Usage

In this example the POINT_ ptrPoint will be destroyed at the end of the process (atexit).

POINT_ *ptrPoint = new POINT_ ;
DESTRUCTEUR_DE_<POINT_> *ptrDestruction = new DESTRUCTEUR_DE_<POINT_>( *ptrPoint ) ;

Note that neither ptrPoint, nor ptrDestruction should be destroyed by the user.

Design description

The destruction object must be created dynamicaly because it suscribes himself in the list of destruction to be performed at the end of the process.


Constructor & Destructor Documentation

template<class TYPE>
DESTRUCTEUR_DE_< TYPE >::DESTRUCTEUR_DE_ TYPE &  objet  )  [inline]
 

template<class TYPE>
virtual DESTRUCTEUR_DE_< TYPE >::~DESTRUCTEUR_DE_  )  [inline, virtual]
 


Member Function Documentation

template<class TYPE>
virtual void DESTRUCTEUR_DE_< TYPE >::operator() void   )  [inline, virtual]
 

Implements DESTRUCTEUR_GENERIQUE_.

const int DESTRUCTEUR_GENERIQUE_::Ajout DESTRUCTEUR_GENERIQUE_ objet  )  [static, inherited]
 

Adds a destruction object to the list of actions to be performed at the end of the process


Field Documentation

std::list< DESTRUCTEUR_GENERIQUE_ * > * DESTRUCTEUR_GENERIQUE_::Destructeurs = 0 [static, inherited]