diff -r 89d6a7a84779 -r 25a17d01db0c Symbian3/PDK/Source/GUID-A18153C0-230C-51FB-9384-A48BB4E42F03.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/PDK/Source/GUID-A18153C0-230C-51FB-9384-A48BB4E42F03.dita Fri Jan 22 18:26:19 2010 +0000 @@ -0,0 +1,37 @@ + + + + + +Cleanup +StrategyThe support for custom cleanup strategies is based on a template-based +implementation of the Strategy design pattern. Cleanup strategies can be specified +as an optional template parameter of the class templates for automatic resource +management. +
Default Cleanup Strategy

The default cleanup strategy +is determined by the TResourceCleanupStrategy class template +which by default calls a function named Cleanup() function. +The DEFINE_CLEANUP_FUNCTION macro defines an inline function +named Cleanup() function which is invoked for cleanup of the managed object +in place of the default CallCleanupFunction function defined in the header +file.

+
DEFINE_CLEANUP_FUNCTION Macro

DEFINE_CLEANUP_FUNCTION is +provided in order to enable Symbian Developers to easily define the default +cleanup member function for a class type, such as an R-class. The macro can +be used in the same namespace in which the R-class is defined or in a namespace +in which the R-class is used. The DEFINE_CLEANUP_FUNCTION can be used by class +designers, but if a class does not have a cleanup function specified, then +the class users can use the DEFINE_CLEANUP_FUNCTION in order to define the +default cleanup function for that class.

+Clean-up Strategy example DEFINE_CLEANUP_FUNCTION(RSimple, ReleaseData);

This sets the default cleanup behaviour for the RSimple class to be RSimple::ReleaseData(). +If this Macro is not used then the default cleanup behaviour would be to call RSimple::Close().

+
+Cleanup Strategy +Tutorial +
\ No newline at end of file