Den::CSubSessionIx Class Reference

class Den::CSubSessionIx : public CBase

class CSubSessionIx This sub-session container will maintain its own array of TEntry cells in memory as arrays provide for quick access in some situations. There will be two types of cells in the array; cells carrying pointers to sub-sessions and a virtual list of free cells. This layout means that with a handle, the entry holding the sub-session can be looked up in the container directly and if needing to insert a new entry the first free cell is indicated by iFreeListHead. The array will grow with EIndexGranularity each time it runs out of free entries. However, it maintains a high watermark and will never shrink. The handles are defined by TSubSessionHandle, which in the current architectures is a 32 bit word, constructed as needed. It is simple to deduct from the context so there is no need to store it.

0 8 16 31 |--------|--------|----------------| Type Magic Index

The three components comprising the handle are:
  • Type - 8 bit value. One of the members of CSockSubsession::TSubSessionType.

  • Magic - 8 bit value. Ensures that handles are not re-used immediately. Each time an entry is re-cycled this value increments, rolling around when reaching max.

  • Index - 16 bit value. The position in the array. CSockSubsession::TSubSessionType

Inherits from

Constructor & Destructor Documentation

~CSubSessionIx()

IMPORT_C ~CSubSessionIx ( )

Member Functions Documentation

ActiveCount()

TInt ActiveCount ( ) const [inline]

Add(CWorkerSubSession *, TSubSessionHandle &)

TInt Add ( CWorkerSubSession * aSubSession,
TSubSessionHandle & aHandle
)

Parameters

CWorkerSubSession * aSubSession
TSubSessionHandle & aHandle

At(TInt, TSubSessInfo)

IMPORT_C CWorkerSubSession * At ( TInt aHandle,
TSubSessInfo aType
) const

Parameters

TInt aHandle
TSubSessInfo aType

At(TSubSessionHandle)

IMPORT_C TEntry * At ( TSubSessionHandle aHandle ) const [private]

Parameters

TSubSessionHandle aHandle

ExpandArray()

TInt ExpandArray ( ) [private]

Find(CWorkerSubSession *, TSubSessionHandle &)

IMPORT_C TInt Find ( CWorkerSubSession * aSubSession,
TSubSessionHandle & aHandle
) const

Parameters

CWorkerSubSession * aSubSession
TSubSessionHandle & aHandle

IndexFromHandle(TInt)

TInt IndexFromHandle ( TInt aHandle ) const [private, inline]

Parameters

TInt aHandle

InitialiseL()

void InitialiseL ( )

Lock()

void Lock ( ) const [inline]

Optional locking. When accessing any of the public methods of this class in a multithreaded environment, locking is often necessary. This lock does not allow for lock nesting.

MakeHandle(TInt, TInt, TInt)

TSubSessionHandle MakeHandle ( TInt aIndex,
TInt aMagic,
TInt aType
) const [private, inline]

Parameters

TInt aIndex
TInt aMagic
TInt aType

NONSHARABLE_CLASS(TIter)

NONSHARABLE_CLASS ( TIter ) [inline]

Parameters

TIter

Remove(TSubSessionHandle)

IMPORT_C CWorkerSubSession * Remove ( TSubSessionHandle aHandle )

Parameters

TSubSessionHandle aHandle

Replace(TSubSessionHandle, CWorkerSubSession *)

IMPORT_C CWorkerSubSession * Replace ( TSubSessionHandle aHandle,
CWorkerSubSession * aSubSession
)

Parameters

TSubSessionHandle aHandle
CWorkerSubSession * aSubSession

Unlock()

void Unlock ( ) const [inline]

Unlocking. Lock()

Member Enumerations Documentation

Enum anonymous

Enumerators

KTypeBits = 8
KMagicBits = 8
KIndexBits = 16

Enum anonymous

Enumerators

EIndexGranularity = 8

Member Type Definitions Documentation

Typedef TSubSessionHandle

typedef TInt TSubSessionHandle

Member Data Documentation

TInt iActiveCount

TInt iActiveCount [private]

TEntry * iIx

TEntry * iIx [private]

RWorkerLock iLock

RWorkerLock iLock [private]

TInt iSize

TInt iSize [private]