[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

 

LCleanupTask



Overview:

LCleanupTask is a PowerPlant class that is an abstract base class for any operation which needs to be performed at application shutdown time. It patches ExitToShell() to ensure that tasks are performed even if the user force-quits application.

Methods :

The methods in this class are:

 

LCleanupTask()  
~LCleanupTask()  
CleanUpAtExit()  
DoCleanup()  
ETSPatch()  
 

Data Members:

The data members in this class are:

 

sCleanupTaskList  
sOldETSRoutine  
sNewETSRoutine  
 

Operation:

This class may be used as a mix-in to ensure that an object cleans up after itself when the application quits.

Source files:

(Networking Classes)

LCleanupTask.h

LCleanupTask.cp

See also:

LInterruptSafeList

LMacTCPTCPEndpoint

LOpenTptUDPEndpoint

LMacTCP_CloseResolver

LOpenTpt_CloseOpenTpt

LCleanupTask()

Purpose:

The constructor creates the object. Don't use the copy contructor.

Access :

Protected

Prototype:

LCleanupTask();

LCleanupTask(LCleanupTask&); /* copy ctor */
Parameters:

None

~LCleanupTask()

Purpose:

The destructor destroys the LCleanupTask object.

Access :

Virtual, Protected

Prototype:

~LCleanupTask();

CleanUpAtExit()

Purpose:

Should be called only once whenever the application quits, either by the normal Quit command exit or by a user abort. This method runs all of the cleanup tasks and removes them from the list.

Access :

Static, Public

Prototype:

void CleanUpAtExit();
Parameters:

None

Return:

None

DoCleanup()

Purpose:

Override to perform any task that must be performed before the app quits.

Access :

Virtual, Protected

Prototype:

void DoCleanup();
Parameters:

None

Return:

None

ETSPatch()

Purpose:

Patch ExitToShell().

Access :

Static, Protected

Prototype:

void ETSPatch();
Parameters:

None

Return:

None

sCleanupTaskList

Purpose:

The task list for cleanup.

Access :

Static, Protected

Prototype:

LInterruptSafeList*	sCleanupTaskList;

sOldETSRoutine

Purpose:

Temporary storage for the ExitToShell() routine.

Access :

Static, Protected

Prototype:

UniversalProcPtr		sOldETSRoutine;

sNewETSRoutine

Purpose:

The pointer to the new ExitToShell() routine.

Access :

Static, Protected

Prototype:

UniversalProcPtr		sNewETSRoutine;

 


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: July 21, 2000