Class TGenericStructMap

DescriptionHierarchyInternal TypesFieldsMethodsProperties

Unit

Declaration

type generic TGenericStructMap<TKey,TData> = class(TFPSMap)

Description

Generic map of types, with keys compared by CompareByte.

This is equivalent to TFPGMap, except our KeyCompare doesn't use < or > or even = operators, instead it compares by CompareByte. So it works with types that do not have built-in < or > or even = operator in FPC, like records or class instances.

See also http://bugs.freepascal.org/view.php?id=15480 .

Hierarchy

  • TFPSMap
  • TGenericStructMap

Overview

Internal Types

Published TDataCompareFunc = function(const Data1, Data2: TData): Integer;
Published TKeyCompareFunc = function(const Key1, Key2: TKey): Integer;

Methods

Public constructor Create;
Public function Add(const AKey: TKey; const AData: TData): Integer;
Public function Add(const AKey: TKey): Integer;
Public function Find(const AKey: TKey; out Index: Integer): Boolean;
Public function IndexOf(const AKey: TKey): Integer;
Public function IndexOfData(const AData: TData): Integer;
Public procedure InsertKey(Index: Integer; const AKey: TKey);
Public procedure InsertKeyData(Index: Integer; const AKey: TKey; const AData: TData);
Public function Remove(const AKey: TKey): Integer;

Properties

Public property Keys[Index:Integer]: TKey read GetKey write PutKey;
Public property Data[Index:Integer]: TData read GetData write PutData;
Public property KeyData[constAKey:TKey]: TData read GetKeyData write PutKeyData;
Public property OnCompare: TKeyCompareFunc read FOnKeyCompare write SetOnKeyCompare;
Public property OnKeyCompare: TKeyCompareFunc read FOnKeyCompare write SetOnKeyCompare;
Public property OnDataCompare: TDataCompareFunc read FOnDataCompare write SetOnDataCompare;

Description

Internal Types

Published TDataCompareFunc = function(const Data1, Data2: TData): Integer;
 
Published TKeyCompareFunc = function(const Key1, Key2: TKey): Integer;
 

Methods

Public constructor Create;
 
Public function Add(const AKey: TKey; const AData: TData): Integer;
 
Public function Add(const AKey: TKey): Integer;
 
Public function Find(const AKey: TKey; out Index: Integer): Boolean;
 
Public function IndexOf(const AKey: TKey): Integer;
 
Public function IndexOfData(const AData: TData): Integer;
 
Public procedure InsertKey(Index: Integer; const AKey: TKey);
 
Public procedure InsertKeyData(Index: Integer; const AKey: TKey; const AData: TData);
 
Public function Remove(const AKey: TKey): Integer;
 

Properties

Public property Keys[Index:Integer]: TKey read GetKey write PutKey;
 
Public property Data[Index:Integer]: TData read GetData write PutData;
 
Public property KeyData[constAKey:TKey]: TData read GetKeyData write PutKeyData;
 
Public property OnCompare: TKeyCompareFunc read FOnKeyCompare write SetOnKeyCompare;
 
Public property OnKeyCompare: TKeyCompareFunc read FOnKeyCompare write SetOnKeyCompare;

deprecated;

Public property OnDataCompare: TDataCompareFunc read FOnDataCompare write SetOnDataCompare;
 

Generated by PasDoc 0.13.0 on 2013-08-17 21:27:12