emanaged.h File Reference

Utility class templates that provide RAII-based automatic resource management.

CallCleanupFunction ( T * )

voidCallCleanupFunction(T *aObjPtr)[inline]

Implementation function.In order to override the default cleanup strategy for a particular type, use the provided DEFINE_CLEANUP_FUNCTION utility macro

DEFINE_CLEANUP_FUNCTION

Utility macro that can be used for defining the cleanup member function for a class (typically a R-class).

This 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.

Example:

class RDestroyableClass { public: ... void Destroy(); // member function used for cleanup and releasing the resources owned by a RDestroyableClass object ... };

DEFINE_CLEANUP_FUNCTION(RDestroyableClass, Destroy)

CONSTRUCTORS_MAY_LEAVE

Utility macro that can be used for specializing the default cleanup strategy class template TResourceCleanupStrategy for a particular class (typically a R-class). The default cleanup strategy for a class specified using DEFINE_CLEANUP_STRATEGY overrides any other cleanup strategy specified using DEFINE_CLEANUP_FUNCTION for that class.

This macro must be used in the same namespace in which the R-class is defined.

Utility macro that can be used for enabling single phase construction for CBase-derived classes. This is necessary because Symbian OS currently lacks the placement delete operator counterparts corresponding to the placement new operators that take a TLeave parameter (new(ELeave)), which will result in memory leaks if a class constructor leaves.

This macro must be used within a public section of a class definition, if the single phase construction is part of the public interface of the class.

Current Limitation CONSTRUCTORS_MAY_LEAVE is an unfortunate blight on the usability of single-phase construction, but we have yet to come up with a better alternative in the face of the legacy handling of ELeave.

ManagedPopCleanupStackItem ( T )

voidManagedPopCleanupStackItem(TaIsManaged)

Enum TManagedPtrType

EnumeratorValueDescription
EPtrNonSpecial
EPtrCBaseDerived

IS_PTR_SPECIAL

Enum TAutoHandleType

IS_HANDLE_SPECIAL

operator== ( const LManagedPtr< T > &, const LManagedPtr< U > & )

TBool operator==(const LManagedPtr< T > &aPtr1,
const LManagedPtr< U > &aPtr2
)

operator!= ( const LManagedPtr< T > &, const LManagedPtr< U > & )

TBool operator!=(const LManagedPtr< T > &aPtr1,
const LManagedPtr< U > &aPtr2
)

operator< ( const LManagedPtr< T > &, const LManagedPtr< U > & )

TBool operator<(const LManagedPtr< T > &aPtr1,
const LManagedPtr< U > &aPtr2
)

operator== ( const LCleanedupPtr< T > &, const LCleanedupPtr< U > & )

TBool operator==(const LCleanedupPtr< T > &aPtr1,
const LCleanedupPtr< U > &aPtr2
)

operator!= ( const LCleanedupPtr< T > &, const LCleanedupPtr< U > & )

TBool operator!=(const LCleanedupPtr< T > &aPtr1,
const LCleanedupPtr< U > &aPtr2
)

operator< ( const LCleanedupPtr< T > &, const LCleanedupPtr< U > & )

TBool operator<(const LCleanedupPtr< T > &aPtr1,
const LCleanedupPtr< U > &aPtr2
)