Public Member Functions | |
DESTRUCTEUR_DE_ (TYPE &objet) | |
virtual void | operator() (void) |
performs the destruction | |
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 |
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.
virtual void DESTRUCTEUR_DE_< TYPE >::operator() | ( | void | ) | [inline, virtual] |
performs the destruction
Implements DESTRUCTEUR_GENERIQUE_.
const int DESTRUCTEUR_GENERIQUE_::Ajout | ( | DESTRUCTEUR_GENERIQUE_ & | objet | ) | [static, inherited] |
adds a destruction object to the list of destructions
Adds a destruction object to the list of actions to be performed at the end of the process