Description | Hierarchy | Fields | Methods | Properties |
type TSparsePointerArray = class(TObject)
TSparsePointerArray
acts like an array of pointers with constant time access to Items. However, it uses less memory than an array for cases where many of the pointers are nil.
secDir: TSecDirType; |
|
slotsInDir: Cardinal; |
|
indexMask: Word; |
|
secShift: Word; |
|
FHighBound: Integer; |
|
FSectionSize: Word; |
|
cachedIndex: Integer; |
|
cachedValue: TCustomData; |
function GetAt(Index: Integer): TCustomData; |
|
function MakeAt(Index: Integer): PPointer; |
|
procedure PutAt(Index: Integer; Item: TCustomData); |
|
constructor Create(Quantum: TSPAQuantum); |
|
destructor Destroy; override; |
|
function ForAll(ApplyFunction: TSPAApply): Integer; |
|
procedure ResetHighBound; |
property HighBound: Integer read FHighBound; |
|
property SectionSize: Word read FSectionSize; |
|
property Items[Index:Integer]: TCustomData read GetAt write PutAt; |
secDir: TSecDirType; |
|
slotsInDir: Cardinal; |
|
indexMask: Word; |
|
secShift: Word; |
|
FHighBound: Integer; |
|
FSectionSize: Word; |
|
cachedIndex: Integer; |
|
cachedValue: TCustomData; |
|
function GetAt(Index: Integer): TCustomData; |
|
Return item[i], nil if slot outside defined section. |
function MakeAt(Index: Integer): PPointer; |
|
Return address of item[i], creating slot if necessary. |
procedure PutAt(Index: Integer; Item: TCustomData); |
|
Store item at item[i], creating slot if necessary. |
constructor Create(Quantum: TSPAQuantum); |
|
destructor Destroy; override; |
|
function ForAll(ApplyFunction: TSPAApply): Integer; |
|
Traverse SPA, calling apply function for each defined non-nil item. The traversal terminates if the apply function returns a value other than 0. NOTE: must be static method so that we can take its address in TSparseList.ForAll See TSPAApply |
procedure ResetHighBound; |
|
Ratchet down HighBound after a deletion |
property HighBound: Integer read FHighBound; |
|
property SectionSize: Word read FSectionSize; |
|
property Items[Index:Integer]: TCustomData read GetAt write PutAt; |
|