ThspsDomStringPoolOptimizer Class Reference

class ThspsDomStringPoolOptimizer

Optimizer module for ChspsDomStringPool.

hspsdomdocument.lib
Since
Series 60 5.2
Public Member Functions
voidAddEntryL(ThspsDomStringPoolOptimizerEntry &)
voidClose()
TInt Count()
ThspsDomStringPoolOptimizerEntry &Entry(const TInt)
TInt GetIndex(const TDesC8 &)
voidReset()
Private Member Functions
TInt FindEntry(const TDesC8 &, const TInt, const TInt)
TInt FindInsertionIndexEstimate(const TDesC8 &, const TInt, const TInt)
Private Attributes
RArray< ThspsDomStringPoolOptimizerEntry >iEntries

Member Functions Documentation

AddEntryL(ThspsDomStringPoolOptimizerEntry &)

voidAddEntryL(ThspsDomStringPoolOptimizerEntry &aEntry)

Add entry to optimizer list.

Parameters

ThspsDomStringPoolOptimizerEntry & aEntryEntry to be added.

Close()

voidClose()

Close allocated resources.

Count()

TInt Count()

Get item count.

Entry(const TInt)

ThspsDomStringPoolOptimizerEntry &Entry(const TIntaIndex)

Get entry.

Parameters

const TInt aIndexIndex to Entry.

FindEntry(const TDesC8 &, const TInt, const TInt)

TInt FindEntry(const TDesC8 &aString,
const TIntaLeft,
const TIntaRight
)[private]

Find entry from alphabetic list. Uses binary search.

Parameters

const TDesC8 & aStringReference to string to be searched for.
const TInt aLeftLeft limit for binary search
const TInt aRightRight limit for binary search.

FindInsertionIndexEstimate(const TDesC8 &, const TInt, const TInt)

TInt FindInsertionIndexEstimate(const TDesC8 &aString,
const TIntaLeft,
const TIntaRight
)[private]

Find a position clue for given string.

Will return index that can be used to initiate linear search. Uses binary search to limit required comparisons when string pools starts to fill.

Note: Returned index is not absolute! it must be only used as a start index for linear searching.

Returned index will be quite close to actual insertion position. it will be 0 - 2 steps backward from actual position.

Parameters

const TDesC8 & aStringReference to string.
const TInt aLeftLeft limit for binary search
const TInt aRightRight limit for binary search.

GetIndex(const TDesC8 &)

TInt GetIndex(const TDesC8 &aString)

Get index for string.

Parameters

const TDesC8 & aStringReference to given string.

Reset()

voidReset()

Reset.

Member Data Documentation

RArray< ThspsDomStringPoolOptimizerEntry > iEntries

RArray< ThspsDomStringPoolOptimizerEntry >iEntries[private]

Array of optimizer entries.