Den::THeapSwitcher Class Reference

class Den::THeapSwitcher

Helper class for switching the current thread to share that of a peer worker thread. This is necessary for heap manipulating actions such as adding to a container owned by the peer, as well as the more obvious case of deleting an object created by them. Construct a THeapSwitcher instance passing the identity of the peer thread to switch to using their heap. Destroy the THeapSwitcher instance or explicitly call RevertToOwnHeap() to resume using the normal heap for the caller thread.

Public Member Functions
THeapSwitcher ( CCommonPitBoss &, const Messages::TNodeId &)
THeapSwitcher ( CCommonPitBoss &, CommsFW::TWorkerId )
~THeapSwitcher ()
IMPORT_C void RevertToOwnHeap ()
Private Member Functions
IMPORT_C void MaybeSwitch ( CCommonPitBoss &, CommsFW::TWorkerId )
Private Attributes
RAllocator * iPrev

Constructor & Destructor Documentation

THeapSwitcher(CCommonPitBoss &, const Messages::TNodeId &)

IMPORT_C THeapSwitcher ( CCommonPitBoss & aPitBoss,
const Messages::TNodeId & aTarget
)

Parameters

CCommonPitBoss & aPitBoss
const Messages::TNodeId & aTarget

THeapSwitcher(CCommonPitBoss &, CommsFW::TWorkerId)

IMPORT_C THeapSwitcher ( CCommonPitBoss & aPitBoss,
CommsFW::TWorkerId aForeignWorkerId
)

Parameters

CCommonPitBoss & aPitBoss
CommsFW::TWorkerId aForeignWorkerId

~THeapSwitcher()

IMPORT_C ~THeapSwitcher ( )

Member Functions Documentation

MaybeSwitch(CCommonPitBoss &, CommsFW::TWorkerId)

IMPORT_C void MaybeSwitch ( CCommonPitBoss & aPitBoss,
CommsFW::TWorkerId aForeignWorkerId
) [private]

Parameters

CCommonPitBoss & aPitBoss
CommsFW::TWorkerId aForeignWorkerId

RevertToOwnHeap()

IMPORT_C void RevertToOwnHeap ( )

Member Data Documentation

RAllocator * iPrev

RAllocator * iPrev [private]