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 voidRevertToOwnHeap()
Private Member Functions
IMPORT_C voidMaybeSwitch(CCommonPitBoss &, CommsFW::TWorkerId)
Private Attributes
RAllocator *iPrev

Constructor & Destructor Documentation

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

IMPORT_CTHeapSwitcher(CCommonPitBoss &aPitBoss,
const Messages::TNodeId &aTarget
)

Parameters

CCommonPitBoss & aPitBoss
const Messages::TNodeId & aTarget

THeapSwitcher(CCommonPitBoss &, CommsFW::TWorkerId)

IMPORT_CTHeapSwitcher(CCommonPitBoss &aPitBoss,
CommsFW::TWorkerIdaForeignWorkerId
)

Parameters

CCommonPitBoss & aPitBoss
CommsFW::TWorkerId aForeignWorkerId

~THeapSwitcher()

IMPORT_C~THeapSwitcher()

Member Functions Documentation

MaybeSwitch(CCommonPitBoss &, CommsFW::TWorkerId)

IMPORT_C voidMaybeSwitch(CCommonPitBoss &aPitBoss,
CommsFW::TWorkerIdaForeignWorkerId
)[private]

Parameters

CCommonPitBoss & aPitBoss
CommsFW::TWorkerId aForeignWorkerId

RevertToOwnHeap()

IMPORT_C voidRevertToOwnHeap()

Member Data Documentation

RAllocator * iPrev

RAllocator *iPrev[private]