{%MainUnit generics.collections.pas} { This file is part of the Free Pascal run time library. Copyright (c) 2014 by Maciej Izak (hnb) member of the Free Sparta development team (http://freesparta.com) Copyright(c) 2004-2014 DaThoX It contains the Free Pascal generics library See the file COPYING.FPC, included in this distribution, for details about the copyright. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Acknowledgment Thanks to Sphere 10 Software (http://sphere10.com) for sponsoring many new types and major refactoring of entire library Thanks to mORMot (http://synopse.info) project for the best implementations of hashing functions like crc32c and xxHash32 :) **********************************************************************} {$WARNINGS OFF} type TEmptyRecord = record // special record for Dictionary TValue (Dictionary as Set) end; { TPair } TPair = record public Key: TKey; Value: TValue; class function Create(AKey: TKey; AValue: TValue): TPair; static; end; { TCustomDictionary } // bug #24283 and #24097 (forward declaration) - should be: // TCustomDictionary = class(TEnumerable >); TCustomDictionary = class abstract public type // workaround... no generics types in generics types TDictionaryPair = TPair; PDictionaryPair = ^TDictionaryPair; PKey = ^TKey; PValue = ^TValue; THashFactoryClass = THashFactory; protected FEqualityComparer: IEqualityComparer; FKeys: TEnumerable; FValues: TEnumerable; FMaxLoadFactor: single; protected procedure SetCapacity(ACapacity: SizeInt); virtual; abstract; // bug #24283. workaround for this class because can't inherit from TEnumerable function DoGetEnumerator: TEnumerator; virtual; abstract; {override;} procedure SetMaxLoadFactor(AValue: single); virtual; abstract; function GetLoadFactor: single; virtual; abstract; function GetCapacity: SizeInt; virtual; abstract; public property MaxLoadFactor: single read FMaxLoadFactor write SetMaxLoadFactor; property LoadFactor: single read GetLoadFactor; property Capacity: SizeInt read GetCapacity write SetCapacity; procedure Clear; virtual; abstract; procedure Add(constref APair: TPair); virtual; abstract; strict private // bug #24283. workaround for this class because can't inherit from TEnumerable function ToArray(ACount: SizeInt): TArray; overload; public function ToArray: TArray; virtual; final; {override; final; // bug #24283} overload; constructor Create; virtual; overload; constructor Create(ACapacity: SizeInt); virtual; overload; constructor Create(ACapacity: SizeInt; const AComparer: IEqualityComparer); virtual; overload; constructor Create(const AComparer: IEqualityComparer); overload; constructor Create(ACollection: TEnumerable); virtual; overload; constructor Create(ACollection: TEnumerable; const AComparer: IEqualityComparer); virtual; overload; {$IFDEF ENABLE_METHODS_WITH_TEnumerableWithPointers} constructor Create(ACollection: TEnumerableWithPointers); virtual; overload; constructor Create(ACollection: TEnumerableWithPointers; const AComparer: IEqualityComparer); virtual; overload; {$ENDIF} destructor Destroy; override; private FOnKeyNotify: TCollectionNotifyEvent; FOnValueNotify: TCollectionNotifyEvent; protected procedure UpdateItemsThreshold(ASize: SizeInt); virtual; abstract; procedure KeyNotify(constref AKey: TKey; ACollectionNotification: TCollectionNotification); virtual; procedure ValueNotify(constref AValue: TValue; ACollectionNotification: TCollectionNotification); virtual; procedure PairNotify(constref APair: TDictionaryPair; ACollectionNotification: TCollectionNotification); inline; procedure SetValue(var AValue: TValue; constref ANewValue: TValue); public property OnKeyNotify: TCollectionNotifyEvent read FOnKeyNotify write FOnKeyNotify; property OnValueNotify: TCollectionNotifyEvent read FOnValueNotify write FOnValueNotify; protected // FItemsLength must be declared at the end of TCustomDictionary FItemsLength: SizeInt; public property Count: SizeInt read FItemsLength; end; { TCustomDictionaryEnumerator } TCustomDictionaryEnumerator = class abstract(TEnumerator< T >) private FDictionary: TCustomDictionary; FIndex: SizeInt; protected function DoGetCurrent: T; override; function GetCurrent: T; virtual; abstract; public constructor Create(ADictionary: TCustomDictionary); end; { TDictionaryEnumerable } TDictionaryEnumerable = class abstract(TEnumerableWithPointers) private FDictionary: TCustomDictionary; function GetCount: SizeInt; protected function GetPtrEnumerator: TEnumerator; override; function DoGetEnumerator: TDictionaryEnumerator; override; public constructor Create(ADictionary: TCustomDictionary); function ToArray: TArray; override; final; property Count: SizeInt read GetCount; end; // more info : http://en.wikipedia.org/wiki/Open_addressing { TOpenAddressingEnumerator } TOpenAddressingEnumerator = class abstract(TCustomDictionaryEnumerator) protected function DoMoveNext: Boolean; override; end; TOpenAddressingPointersEnumerator = class abstract(TEnumerator) private var FItems: ^TArray; FIndex: SizeInt; protected function DoMoveNext: boolean; override; function DoGetCurrent: PDictionaryPair; override; function GetCurrent: PDictionaryPair; virtual; public constructor Create(var AItems); end; TOpenAddressingPointersCollection = record private type PArray = ^TArray; function Items: PArray; inline; function GetCount: SizeInt; inline; public function GetEnumerator: TPointersEnumerator; function ToArray: TArray; property Count: SizeInt read GetCount; end; TOnGetMemoryLayoutKeyPosition = procedure(Sender: TObject; AKeyPos: UInt32) of object; TOpenAddressing = class abstract(TCustomDictionary) private type PItem = ^TItem; TItem = record Hash: UInt32; Pair: TPair; end; TItemsArray = array of TItem; TPointersEnumerator = class(TOpenAddressingPointersEnumerator); TPointersCollection = TOpenAddressingPointersCollection; public type PPointersCollection = ^TPointersCollection; private var // FItems must be declared as first field FItems: TItemsArray; FItemsThreshold: SizeInt; procedure Resize(ANewSize: SizeInt); procedure PrepareAddingItem; protected function RealItemsLength: SizeInt; virtual; function Rehash(ASizePow2: SizeInt; AForce: Boolean = False): boolean; virtual; function FindBucketIndex(constref AKey: TKey): SizeInt; overload; inline; function FindBucketIndex(constref AItems: TArray; constref AKey: TKey; out AHash: UInt32): SizeInt; virtual; abstract; overload; public type // Enumerators TPairEnumerator = class(TOpenAddressingEnumerator) protected function GetCurrent: TPair; override; end; TValueEnumerator = class(TOpenAddressingEnumerator) protected function GetCurrent: TValue; override; end; TPValueEnumerator = class(TOpenAddressingEnumerator) protected function GetCurrent: PValue; override; end; TKeyEnumerator = class(TOpenAddressingEnumerator) protected function GetCurrent: TKey; override; end; TPKeyEnumerator = class(TOpenAddressingEnumerator) protected function GetCurrent: PKey; override; end; // Collections TValueCollection = class(TDictionaryEnumerable); TKeyCollection = class(TDictionaryEnumerable); // bug #24283 - workaround related to lack of DoGetEnumerator function GetEnumerator: TPairEnumerator; reintroduce; private function GetKeys: TKeyCollection; function GetValues: TValueCollection; function GetPointers: PPointersCollection; inline; private function GetItem(const AKey: TKey): TValue; inline; procedure SetItem(const AKey: TKey; const AValue: TValue); inline; procedure AddItem(var AItem: TItem; constref AKey: TKey; constref AValue: TValue; const AHash: UInt32); inline; protected // useful for using dictionary as array function DoRemove(AIndex: SizeInt; ACollectionNotification: TCollectionNotification): TValue; virtual; function DoAdd(constref AKey: TKey; constref AValue: TValue): SizeInt; virtual; procedure UpdateItemsThreshold(ASize: SizeInt); override; procedure SetCapacity(ACapacity: SizeInt); override; // bug #24283 - can't descadent from TEnumerable function DoGetEnumerator: TEnumerator; override; procedure SetMaxLoadFactor(AValue: single); override; function GetLoadFactor: single; override; function GetCapacity: SizeInt; override; public // many constructors because bug #25607 constructor Create(ACapacity: SizeInt; const AComparer: IEqualityComparer); override; overload; procedure Add(constref APair: TPair); override; overload; procedure Add(constref AKey: TKey; constref AValue: TValue); overload; inline; procedure Remove(constref AKey: TKey); function ExtractPair(constref AKey: TKey): TPair; procedure Clear; override; procedure TrimExcess; function TryGetValue(constref AKey: TKey; out AValue: TValue): Boolean; procedure AddOrSetValue(constref AKey: TKey; constref AValue: TValue); function ContainsKey(constref AKey: TKey): Boolean; inline; function ContainsValue(constref AValue: TValue): Boolean; overload; function ContainsValue(constref AValue: TValue; const AEqualityComparer: IEqualityComparer): Boolean; virtual; overload; property Items[Index: TKey]: TValue read GetItem write SetItem; default; property Keys: TKeyCollection read GetKeys; property Values: TValueCollection read GetValues; property Ptr: PPointersCollection read GetPointers; procedure GetMemoryLayout(const AOnGetMemoryLayoutKeyPosition: TOnGetMemoryLayoutKeyPosition); end; TOpenAddressingLP = class(TOpenAddressing) private type // for workaround Lazarus bug #25613 _TItem = record Hash: UInt32; Pair: TPair; end; protected procedure NotifyIndexChange(AFrom, ATo: SizeInt); virtual; function DoRemove(AIndex: SizeInt; ACollectionNotification: TCollectionNotification): TValue; override; function FindBucketIndex(constref AItems: TArray; constref AKey: TKey; out AHash: UInt32): SizeInt; override; overload; end; // More info and TODO // https://github.com/OpenHFT/UntitledCollectionsProject/wiki/Tombstones-purge-from-hashtable:-theory-and-practice TOpenAddressingTombstones = class abstract(TOpenAddressing) private FTombstonesCount: SizeInt; protected function Rehash(ASizePow2: SizeInt; AForce: Boolean = False): boolean; override; function RealItemsLength: SizeInt; override; function FindBucketIndexOrTombstone(constref AItems: TArray; constref AKey: TKey; out AHash: UInt32): SizeInt; virtual; abstract; function DoRemove(AIndex: SizeInt; ACollectionNotification: TCollectionNotification): TValue; override; function DoAdd(constref AKey: TKey; constref AValue: TValue): SizeInt; override; public property TombstonesCount: SizeInt read FTombstonesCount; procedure ClearTombstones; virtual; procedure Clear; override; end; TOpenAddressingSH = class(TOpenAddressingTombstones) private type // for workaround Lazarus bug #25613 _TItem = record Hash: UInt32; Pair: TPair; end; protected function FindBucketIndex(constref AItems: TArray; constref AKey: TKey; out AHash: UInt32): SizeInt; override; overload; function FindBucketIndexOrTombstone(constref AItems: TArray; constref AKey: TKey; out AHash: UInt32): SizeInt; override; end; TOpenAddressingQP = class(TOpenAddressingSH) private FPrimaryNumberAsSizeApproximation: SizeInt; protected procedure UpdateItemsThreshold(ASize: SizeInt); override; function FindBucketIndex(constref AItems: TArray; constref AKey: TKey; out AHash: UInt32): SizeInt; override; overload; function FindBucketIndexOrTombstone(constref AItems: TArray; constref AKey: TKey; out AHash: UInt32): SizeInt; override; end; TOpenAddressingDH = class(TOpenAddressingTombstones) private type // for workaround Lazarus bug #25613 _TItem = record Hash: UInt32; Pair: TPair; end; private R: UInt32; protected procedure UpdateItemsThreshold(ASize: SizeInt); override; function FindBucketIndex(constref AItems: TArray; constref AKey: TKey; out AHash: UInt32): SizeInt; override; overload; function FindBucketIndexOrTombstone(constref AItems: TArray; constref AKey: TKey; out AHash: UInt32): SizeInt; override; strict protected constructor Create(ACapacity: SizeInt; const AComparer: IEqualityComparer); override; overload; constructor Create(const AComparer: IEqualityComparer); reintroduce; overload; constructor Create(ACollection: TEnumerable; const AComparer: IEqualityComparer); override; overload; {$IFDEF ENABLE_METHODS_WITH_TEnumerableWithPointers} constructor Create(ACollection: TEnumerableWithPointers; const AComparer: IEqualityComparer); override; overload; {$ENDIF} public // bug #26181 (redundancy of constructors) constructor Create(ACapacity: SizeInt); override; overload; constructor Create(ACollection: TEnumerable); override; overload; {$IFDEF ENABLE_METHODS_WITH_TEnumerableWithPointers} constructor Create(ACollection: TEnumerableWithPointers); override; overload; {$ENDIF} constructor Create(ACapacity: SizeInt; const AComparer: IExtendedEqualityComparer); virtual; overload; constructor Create(const AComparer: IExtendedEqualityComparer); overload; constructor Create(ACollection: TEnumerable; const AComparer: IExtendedEqualityComparer); virtual; overload; {$IFDEF ENABLE_METHODS_WITH_TEnumerableWithPointers} constructor Create(ACollection: TEnumerableWithPointers; const AComparer: IExtendedEqualityComparer); virtual; overload; {$ENDIF} end; TDeamortizedDArrayCuckooMapEnumerator = class abstract(TCustomDictionaryEnumerator) private type // for workaround Lazarus bug #25613 TItem = record Hash: UInt32; Pair: TPair; end; TItemsArray = array of TItem; private FMainIndex: SizeInt; protected function DoMoveNext: Boolean; override; public constructor Create(ADictionary: TCustomDictionary); end; TDeamortizedDArrayPointersEnumerator = class abstract(TEnumerator) private var // FItems must be declared as first field and FQueue as second FItems: ^TItemsDArray; FQueue: TQueueDictionary; FIndex: SizeInt; FMainIndex: SizeInt; protected function DoMoveNext: boolean; override; function DoGetCurrent: PDictionaryPair; override; function GetCurrent: PDictionaryPair; virtual; public constructor Create(var AItems; AQueue: TQueueDictionary; ACount: SizeInt); end; TDeamortizedDArrayPointersCollection = record private type PArray = ^TItemsDArray; function Items: PArray; inline; function GetCount: SizeInt; inline; function GetQueue: TQueueDictionary; inline; public function GetEnumerator: TPointersEnumerator; function ToArray: TArray; property Count: SizeInt read GetCount; end; // more info : // http://arxiv.org/abs/0903.0391 TDeamortizedDArrayCuckooMap = class(TCustomDictionary) private const // Lookup Result LR_NIL = -1; LR_QUEUE = -2; private type PItem = ^TItem; TItem = record Hash: UInt32; Pair: TPair; end; TValueForQueue = TItem; TQueueDictionary = class(TOpenAddressingLP) private type // for workaround Lazarus bug #25613 _TItem = record Hash: UInt32; Pair: TPair; end; private FIdx: TList; // list to keep order protected procedure NotifyIndexChange(AFrom, ATo: SizeInt); override; function Rehash(ASizePow2: SizeInt; AForce: Boolean = False): Boolean; override; public procedure InsertIntoBack(AItem: Pointer); procedure InsertIntoHead(AItem: Pointer); function IsEmpty: Boolean; function Pop: Pointer; constructor Create(ACapacity: SizeInt; const AComparer: IEqualityComparer); override; overload; destructor Destroy; override; end; // cycle-detection mechanism class TCDM = class(TOpenAddressingSH); TItemsArray = array of TItem; TItemsDArray = array[0..Pred(TCuckooCfg.D)] of TItemsArray; TPointersEnumerator = class(TDeamortizedDArrayPointersEnumerator); TPointersCollection = TDeamortizedDArrayPointersCollection; public type PPointersCollection = ^TPointersCollection; private var FItems: TItemsDArray; FQueue: TQueueDictionary; // probably can be optimized - hash TItem give information from TItem.Hash for cuckoo ... // currently is kept in "TQueueDictionary = class(TOpenAddressingSH" FCDM: TCDM; // cycle-detection mechanism FItemsThreshold: SizeInt; // sadly there is bug #24848 for class var ... {class} var CUCKOO_SIGN, CUCKOO_INDEX_SIZE, CUCKOO_HASH_SIGN: UInt32; // CUCKOO_MAX_ITEMS_LENGTH: <- to do : calc max length for items based on CUCKOO sign // maybe some CDM bloom filter? procedure Resize(ANewSize: SizeInt); procedure Rehash(ASizePow2: SizeInt); procedure PrepareAddingItem; protected procedure UpdateItemsThreshold(ASize: SizeInt); override; function Lookup(constref AKey: TKey; var AHashListOrIndex: PUInt32): SizeInt; inline; overload; function Lookup(constref AItems: TItemsDArray; constref AKey: TKey; var AHashListOrIndex: PUInt32): SizeInt; virtual; overload; public type // Enumerators TPairEnumerator = class(TDeamortizedDArrayCuckooMapEnumerator) protected function GetCurrent: TPair; override; end; TValueEnumerator = class(TDeamortizedDArrayCuckooMapEnumerator) protected function GetCurrent: TValue; override; end; TPValueEnumerator = class(TDeamortizedDArrayCuckooMapEnumerator) protected function GetCurrent: PValue; override; end; TKeyEnumerator = class(TDeamortizedDArrayCuckooMapEnumerator) protected function GetCurrent: TKey; override; end; TPKeyEnumerator = class(TDeamortizedDArrayCuckooMapEnumerator) protected function GetCurrent: PKey; override; end; // Collections TValueCollection = class(TDictionaryEnumerable); TKeyCollection = class(TDictionaryEnumerable); // bug #24283 - workaround related to lack of DoGetEnumerator function GetEnumerator: TPairEnumerator; reintroduce; private function GetKeys: TKeyCollection; function GetValues: TValueCollection; function GetPointers: PPointersCollection; inline; private function GetItem(const AKey: TKey): TValue; inline; procedure SetItem(const AKey: TKey; const AValue: TValue); overload; inline; procedure SetItem(constref AValue: TValue; const AHashListOrIndex: PUInt32; ALookupResult: SizeInt); overload; procedure AddItem(constref AItems: TItemsDArray; constref AKey: TKey; constref AValue: TValue; const AHashList: PUInt32); overload; procedure DoAdd(const AKey: TKey; const AValue: TValue; const AHashList: PUInt32); overload; inline; function DoRemove(const AHashListOrIndex: PUInt32; ALookupResult: SizeInt; ACollectionNotification: TCollectionNotification): TValue; function GetQueueCount: SizeInt; protected procedure SetCapacity(ACapacity: SizeInt); override; // bug #24283 - can't descadent from TEnumerable function DoGetEnumerator: TEnumerator; override; procedure SetMaxLoadFactor(AValue: single); override; function GetLoadFactor: single; override; function GetCapacity: SizeInt; override; strict protected // bug #26181 constructor Create(ACapacity: SizeInt; const AComparer: IEqualityComparer); override; overload; constructor Create(const AComparer: IEqualityComparer); reintroduce; overload; constructor Create(ACollection: TEnumerable; const AComparer: IEqualityComparer); override; overload; {$IFDEF ENABLE_METHODS_WITH_TEnumerableWithPointers} constructor Create(ACollection: TEnumerableWithPointers; const AComparer: IEqualityComparer); override; overload; {$ENDIF} public // TODO: function TryFlushQueue(ACount: SizeInt): SizeInt; constructor Create; override; overload; constructor Create(ACapacity: SizeInt); override; overload; constructor Create(ACollection: TEnumerable); override; overload; {$IFDEF ENABLE_METHODS_WITH_TEnumerableWithPointers} constructor Create(ACollection: TEnumerableWithPointers); override; overload; {$ENDIF} constructor Create(ACapacity: SizeInt; const AComparer: IExtendedEqualityComparer); virtual; overload; constructor Create(const AComparer: IExtendedEqualityComparer); overload; constructor Create(ACollection: TEnumerable; const AComparer: IExtendedEqualityComparer); virtual; overload; {$IFDEF ENABLE_METHODS_WITH_TEnumerableWithPointers} constructor Create(ACollection: TEnumerableWithPointers; const AComparer: IExtendedEqualityComparer); virtual; overload; {$ENDIF} destructor Destroy; override; procedure Add(constref APair: TPair); override; overload; procedure Add(constref AKey: TKey; constref AValue: TValue); overload; procedure Remove(constref AKey: TKey); function ExtractPair(constref AKey: TKey): TPair; procedure Clear; override; procedure TrimExcess; function TryGetValue(constref AKey: TKey; out AValue: TValue): Boolean; procedure AddOrSetValue(constref AKey: TKey; constref AValue: TValue); function ContainsKey(constref AKey: TKey): Boolean; inline; function ContainsValue(constref AValue: TValue): Boolean; overload; function ContainsValue(constref AValue: TValue; const AEqualityComparer: IEqualityComparer): Boolean; virtual; overload; property Items[Index: TKey]: TValue read GetItem write SetItem; default; property Keys: TKeyCollection read GetKeys; property Values: TValueCollection read GetValues; property Ptr: PPointersCollection read GetPointers; property QueueCount: SizeInt read GetQueueCount; procedure GetMemoryLayout(const AOnGetMemoryLayoutKeyPosition: TOnGetMemoryLayoutKeyPosition); end; TDictionaryOwnerships = set of (doOwnsKeys, doOwnsValues); TObjectDeamortizedDArrayCuckooMap = class(TDeamortizedDArrayCuckooMap) private FOwnerships: TDictionaryOwnerships; protected procedure KeyNotify(constref AKey: TKey; ACollectionNotification: TCollectionNotification); override; procedure ValueNotify(constref AValue: TValue; ACollectionNotification: TCollectionNotification); override; public // can't be as "Create(AOwnerships: TDictionaryOwnerships; ACapacity: SizeInt = 0)" // because bug #25607 constructor Create(AOwnerships: TDictionaryOwnerships); overload; constructor Create(AOwnerships: TDictionaryOwnerships; ACapacity: SizeInt); overload; constructor Create(AOwnerships: TDictionaryOwnerships; const AComparer: IExtendedEqualityComparer); overload; constructor Create(AOwnerships: TDictionaryOwnerships; ACapacity: SizeInt; const AComparer: IExtendedEqualityComparer); overload; end; TObjectOpenAddressingLP = class(TOpenAddressingLP) private FOwnerships: TDictionaryOwnerships; protected procedure KeyNotify(constref AKey: TKey; ACollectionNotification: TCollectionNotification); override; procedure ValueNotify(constref AValue: TValue; ACollectionNotification: TCollectionNotification); override; public // can't be as "Create(AOwnerships: TDictionaryOwnerships; ACapacity: SizeInt = 0)" // because bug #25607 constructor Create(AOwnerships: TDictionaryOwnerships); overload; constructor Create(AOwnerships: TDictionaryOwnerships; ACapacity: SizeInt); overload; constructor Create(AOwnerships: TDictionaryOwnerships; const AComparer: IEqualityComparer); overload; constructor Create(AOwnerships: TDictionaryOwnerships; ACapacity: SizeInt; const AComparer: IEqualityComparer); overload; end; // useful generics overloads TOpenAddressingLP = class(TOpenAddressingLP); TOpenAddressingLP = class(TOpenAddressingLP); TObjectOpenAddressingLP = class(TObjectOpenAddressingLP); TObjectOpenAddressingLP = class(TObjectOpenAddressingLP); // Linear Probing with Tombstones (LPT) TOpenAddressingLPT = class(TOpenAddressingSH); TOpenAddressingLPT = class(TOpenAddressingSH); TOpenAddressingQP = class(TOpenAddressingQP); TOpenAddressingQP = class(TOpenAddressingQP); TOpenAddressingDH = class(TOpenAddressingDH); TOpenAddressingDH = class(TOpenAddressingDH); TCuckooD2 = class(TDeamortizedDArrayCuckooMap); TCuckooD2 = class(TDeamortizedDArrayCuckooMap); TCuckooD4 = class(TDeamortizedDArrayCuckooMap); TCuckooD4 = class(TDeamortizedDArrayCuckooMap); TCuckooD6 = class(TDeamortizedDArrayCuckooMap); TCuckooD6 = class(TDeamortizedDArrayCuckooMap); TObjectCuckooD2 = class(TObjectDeamortizedDArrayCuckooMap); TObjectCuckooD2 = class(TObjectDeamortizedDArrayCuckooMap); TObjectCuckooD4 = class(TObjectDeamortizedDArrayCuckooMap); TObjectCuckooD4 = class(TObjectDeamortizedDArrayCuckooMap); TObjectCuckooD6 = class(TObjectDeamortizedDArrayCuckooMap); TObjectCuckooD6 = class(TObjectDeamortizedDArrayCuckooMap); // for normal programmers to normal use =) TDictionary = class(TOpenAddressingLP); TObjectDictionary = class(TObjectOpenAddressingLP); TFastHashMap = class(TCuckooD2); TFastObjectHashMap = class(TObjectCuckooD2); THashMap = class(TCuckooD4); TObjectHashMap = class(TObjectCuckooD4);