Class TCustomDictionary

Unit

Declaration

type TCustomDictionary<TKey,TValue,THashFactory> = class abstract(TObject)

Description

bug #24283 and #24097 (forward declaration) - should be: TCustomDictionary<CUSTOM_DICTIONARY_CONSTRAINTS> = class(TEnumerable<TPair<TKey, TValue> >);

Hierarchy

  • TObject
  • TCustomDictionary

Overview

Internal Types

Public PDictionaryPair = ˆTDictionaryPair;
Public PKey = ˆTKey;
Public PValue = ˆTValue;
Public TDictionaryPair = TPair<TKey, TValue>;
Public THashFactoryClass = THashFactory;

Fields

Protected FEqualityComparer: IEqualityComparer<TKey>;
Protected FKeys: TEnumerable<TKey>;
Protected FValues: TEnumerable<TValue>;
Protected FMaxLoadFactor: single;
Private FOnKeyNotify: TCollectionNotifyEvent<TKey>;
Private FOnValueNotify: TCollectionNotifyEvent<TValue>;
Protected FItemsLength: SizeInt;

Methods

Protected procedure SetCapacity(ACapacity: SizeInt); virtual; abstract;
Protected function DoGetEnumerator: TEnumerator<TDictionaryPair>; virtual; abstract;
Protected procedure SetMaxLoadFactor(AValue: single); virtual; abstract;
Protected function GetLoadFactor: single; virtual; abstract;
Protected function GetCapacity: SizeInt; virtual; abstract;
Public procedure Clear; virtual; abstract;
Public procedure Add(constref APair: TPair<TKey, TValue>); virtual; abstract;
Public function ToArray: TArray<TDictionaryPair>; virtual; final; overload;
Public constructor Create; virtual; overload;
Public constructor Create(ACapacity: SizeInt); virtual; overload;
Public constructor Create(ACapacity: SizeInt; const AComparer: IEqualityComparer<TKey>); virtual; overload;
Public constructor Create(const AComparer: IEqualityComparer<TKey>); overload;
Public constructor Create(ACollection: TEnumerable<TDictionaryPair>); virtual; overload;
Public constructor Create(ACollection: TEnumerable<TDictionaryPair>; const AComparer: IEqualityComparer<TKey>); virtual; overload;
Public destructor Destroy; override;
Protected procedure UpdateItemsThreshold(ASize: SizeInt); virtual; abstract;
Protected procedure KeyNotify(constref AKey: TKey; ACollectionNotification: TCollectionNotification); virtual;
Protected procedure ValueNotify(constref AValue: TValue; ACollectionNotification: TCollectionNotification); virtual;
Protected procedure PairNotify(constref APair: TDictionaryPair; ACollectionNotification: TCollectionNotification); inline;
Protected procedure SetValue(var AValue: TValue; constref ANewValue: TValue);

Properties

Public property MaxLoadFactor: single read FMaxLoadFactor write SetMaxLoadFactor;
Public property LoadFactor: single read GetLoadFactor;
Public property Capacity: SizeInt read GetCapacity write SetCapacity;
Public property OnKeyNotify: TCollectionNotifyEvent<TKey> read FOnKeyNotify write FOnKeyNotify;
Public property OnValueNotify: TCollectionNotifyEvent<TValue> read FOnValueNotify write FOnValueNotify;
Public property Count: SizeInt read FItemsLength;

Description

Internal Types

Public PDictionaryPair = ˆTDictionaryPair;
 
Public PKey = ˆTKey;
 
Public PValue = ˆTValue;
 
Public TDictionaryPair = TPair<TKey, TValue>;

workaround... no generics types in generics types

Public THashFactoryClass = THashFactory;
 

Fields

Protected FEqualityComparer: IEqualityComparer<TKey>;
 
Protected FKeys: TEnumerable<TKey>;
 
Protected FValues: TEnumerable<TValue>;
 
Protected FMaxLoadFactor: single;
 
Private FOnKeyNotify: TCollectionNotifyEvent<TKey>;
 
Private FOnValueNotify: TCollectionNotifyEvent<TValue>;
 
Protected FItemsLength: SizeInt;

FItemsLength must be declared at the end of TCustomDictionary

Methods

Protected procedure SetCapacity(ACapacity: SizeInt); virtual; abstract;
 
Protected function DoGetEnumerator: TEnumerator<TDictionaryPair>; virtual; abstract;

bug #24283. workaround for this class because can't inherit from TEnumerable

Protected procedure SetMaxLoadFactor(AValue: single); virtual; abstract;

override;

Protected function GetLoadFactor: single; virtual; abstract;
 
Protected function GetCapacity: SizeInt; virtual; abstract;
 
Public procedure Clear; virtual; abstract;
 
Public procedure Add(constref APair: TPair<TKey, TValue>); virtual; abstract;
 
Public function ToArray: TArray<TDictionaryPair>; virtual; final; overload;
 
Public constructor Create; virtual; overload;

override; final; // bug #24283

Public constructor Create(ACapacity: SizeInt); virtual; overload;
 
Public constructor Create(ACapacity: SizeInt; const AComparer: IEqualityComparer<TKey>); virtual; overload;
 
Public constructor Create(const AComparer: IEqualityComparer<TKey>); overload;
 
Public constructor Create(ACollection: TEnumerable<TDictionaryPair>); virtual; overload;
 
Public constructor Create(ACollection: TEnumerable<TDictionaryPair>; const AComparer: IEqualityComparer<TKey>); virtual; overload;
 
Public destructor Destroy; override;
 
Protected procedure UpdateItemsThreshold(ASize: SizeInt); virtual; abstract;
 
Protected procedure KeyNotify(constref AKey: TKey; ACollectionNotification: TCollectionNotification); virtual;
 
Protected procedure ValueNotify(constref AValue: TValue; ACollectionNotification: TCollectionNotification); virtual;
 
Protected procedure PairNotify(constref APair: TDictionaryPair; ACollectionNotification: TCollectionNotification); inline;
 
Protected procedure SetValue(var AValue: TValue; constref ANewValue: TValue);
 

Properties

Public property MaxLoadFactor: single read FMaxLoadFactor write SetMaxLoadFactor;
 
Public property LoadFactor: single read GetLoadFactor;
 
Public property Capacity: SizeInt read GetCapacity write SetCapacity;
 
Public property OnKeyNotify: TCollectionNotifyEvent<TKey> read FOnKeyNotify write FOnKeyNotify;
 
Public property OnValueNotify: TCollectionNotifyEvent<TValue> read FOnValueNotify write FOnValueNotify;
 
Public property Count: SizeInt read FItemsLength;
 

Generated by PasDoc 0.15.0.