Back to index
|DESTRUCTOR_OF (TYPE &anObject)|
|Programs the destruction at the end of the process, of the object anObject. |
|virtual void||operator() (void)|
|Performs the destruction of the object. |
The DESTRUCTOR_OF class allows the user to program - at any moment - the destruction of an object at the end of the process.
Example: the POINT ptrPoint will be destroyed at the end of the process (atexit).
POINT *ptrPoint = new POINT ;
DESTRUCTOR_OF<POINT> *ptrDestruct = new DESTRUCTOR_OF<POINT>(*ptrPoint);
Note that neither ptrPoint, nor ptrDestruct should be destroyed by the user.
The destruction object must be created dynamically because it suscribes itself in the list of destruction to be performed at the end of the process.
Programs the destruction at the end of the process, of the object anObject.
This method records in _objectPtr the address of an object to be destroyed at the end of the process
|virtual void DESTRUCTOR_OF< TYPE >::operator()||(||void||)||
Performs the destruction of the object.
This method really destroys the object pointed by _objectPtr. It should be called at the end of the process (i.e. at exit).