ESock::CRefCountOwnerBase Class Reference

class ESock::CRefCountOwnerBase : public CBase

Base container class useful for passing reference counted objects around the stack. When a node receives an object based on this, it calls Open to increment the access counter and ensure the object does go away while it's being used. When the node is finished with the object it calls Close on it. The object will then delete itself if it's access counter is zero.

Objects of this type will delete themselves asynchronously. WARNING: For internal use ONLY. Compatibility is not guaranteed in future releases.

Inherits from

Constructor & Destructor Documentation

CRefCountOwnerBase(const TAny *)

IMPORT_C CRefCountOwnerBase ( const TAny * aPtr ) [protected]

Parameters

const TAny * aPtr pointer to the real object to be contained

~CRefCountOwnerBase()

IMPORT_C ~CRefCountOwnerBase ( ) [protected]

Member Functions Documentation

Close()

IMPORT_C void Close ( )

Relinquish access to the object. Decrements and access counter and may trigger deletion of the point and of the object

DeletePtr()

void DeletePtr ( ) [protected, pure virtual]

Delete the object pointed to by iPtr. Derived classes must implement this.

DeletePtr(CObject *)

void DeletePtr ( CObject * aPtr ) [protected, static, inline]

Parameters

CObject * aPtr CObject to delete

DeletePtr(const CBase *)

void DeletePtr ( const CBase * aPtr ) [protected, static, inline]

Parameters

const CBase * aPtr CBase to delete

DeletePtr(const Meta::SMetaData *)

void DeletePtr ( const Meta::SMetaData * aPtr ) [protected, static, inline]

Parameters

const Meta::SMetaData * aPtr Pointer to a Meta::SMetaData to delete

Open()

IMPORT_C void Open ( )

Gain access to the object. Increments the access counter

ReceivedL(const Messages::TRuntimeCtxId &, const Messages::TNodeId &, Messages::TSignatureBase &)

IMPORT_C void ReceivedL ( const Messages::TRuntimeCtxId & aSender,
const Messages::TNodeId & aRecipient,
Messages::TSignatureBase & aMessage
) [protected, virtual]

Receive a message. CRefCountOwnerBase objects can only receive TCFDataClient::TStop , which will trigger deletion of the ptr and deletion of the object

Parameters

const Messages::TRuntimeCtxId & aSender
const Messages::TNodeId & aRecipient
Messages::TSignatureBase & aMessage

Member Data Documentation

TAny * iPtr

TAny * iPtr [protected]

Pointer to the contained object

TInt iRefCount

TInt iRefCount [private]

TBool iRefOpened

TBool iRefOpened [protected]

Sanity checking member. Set to true after first open. Prevents dead objects being used. Only used in udeb, but not conditional to avoid any urel/udeb BC issues