Castle Game Engine: CastleGenericLists: Class TGenericStructMap

# Class TGenericStructMap
Description | Hierarchy | Internal Types | Fields | Methods | Properties
## Unit CastleGenericLists ## 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
| `TDataCompareFunc = function(const Data1, Data2: TData): Integer;`
| `TKeyCompareFunc = function(const Key1, Key2: TKey): Integer;`
### Fields
| `var FOnKeyCompare: TKeyCompareFunc;`
| `FOnDataCompare: TDataCompareFunc;`
### Methods
| `procedure CopyItem(Src, Dest: Pointer); override;`
| `procedure CopyKey(Src, Dest: Pointer); override;`
| `procedure CopyData(Src, Dest: Pointer); override;`
| `procedure Deref(Item: Pointer); override;`
| `procedure InitOnPtrCompare; override;`
| `function GetKey(Index: Integer): TKey;`
| `function GetKeyData(const AKey: TKey): TData;`
| `function GetData(Index: Integer): TData;`
| `function KeyCompare(Key1, Key2: Pointer): Integer;`
| `function KeyCustomCompare(Key1, Key2: Pointer): Integer;`
| `function DataCustomCompare(Data1, Data2: Pointer): Integer;`
| `procedure PutKey(Index: Integer; const NewKey: TKey);`
| `procedure PutKeyData(const AKey: TKey; const NewData: TData);`
| `procedure PutData(Index: Integer; const NewData: TData);`
| `procedure SetOnKeyCompare(NewCompare: TKeyCompareFunc);`
| `procedure SetOnDataCompare(NewCompare: TDataCompareFunc);`
| `constructor Create;`
| `function Add(const AKey: TKey; const AData: TData): Integer;`
| `function Add(const AKey: TKey): Integer;`
| `function Find(const AKey: TKey; out Index: Integer): Boolean;`
| `function IndexOf(const AKey: TKey): Integer;`
| `function IndexOfData(const AData: TData): Integer;`
| `procedure InsertKey(Index: Integer; const AKey: TKey);`
| `procedure InsertKeyData(Index: Integer; const AKey: TKey; const AData: TData);`
| `function Remove(const AKey: TKey): Integer;`
### Properties
| `property Keys[Index:Integer]: TKey read GetKey write PutKey;`
| `property Data[Index:Integer]: TData read GetData write PutData;`
| `property KeyData[constAKey:TKey]: TData read GetKeyData write PutKeyData;`
| `property OnCompare: TKeyCompareFunc read FOnKeyCompare write SetOnKeyCompare;`
| `property OnKeyCompare: TKeyCompareFunc read FOnKeyCompare write SetOnKeyCompare;`
| `property OnDataCompare: TDataCompareFunc read FOnDataCompare write SetOnDataCompare;`
## Description ### Internal Types
| `TDataCompareFunc = function(const Data1, Data2: TData): Integer;`
| `TKeyCompareFunc = function(const Key1, Key2: TKey): Integer;`
### Fields
| `var FOnKeyCompare: TKeyCompareFunc;`
| `FOnDataCompare: TDataCompareFunc;`
### Methods
| `procedure CopyItem(Src, Dest: Pointer); override;`
| `procedure CopyKey(Src, Dest: Pointer); override;`
| `procedure CopyData(Src, Dest: Pointer); override;`
| `procedure Deref(Item: Pointer); override;`
| `procedure InitOnPtrCompare; override;`
| `function GetKey(Index: Integer): TKey;`
| `function GetKeyData(const AKey: TKey): TData;`
| `function GetData(Index: Integer): TData;`
| `function KeyCompare(Key1, Key2: Pointer): Integer;`
| `function KeyCustomCompare(Key1, Key2: Pointer): Integer;`
| `function DataCustomCompare(Data1, Data2: Pointer): Integer;`
function DataCompare(Data1, Data2: Pointer): Integer;
| `procedure PutKey(Index: Integer; const NewKey: TKey);`
| `procedure PutKeyData(const AKey: TKey; const NewData: TData);`
| `procedure PutData(Index: Integer; const NewData: TData);`
| `procedure SetOnKeyCompare(NewCompare: TKeyCompareFunc);`
| `procedure SetOnDataCompare(NewCompare: TDataCompareFunc);`
| `constructor Create;`
| `function Add(const AKey: TKey; const AData: TData): Integer;`
| `function Add(const AKey: TKey): Integer;`
| `function Find(const AKey: TKey; out Index: Integer): Boolean;`
| `function IndexOf(const AKey: TKey): Integer;`
| `function IndexOfData(const AData: TData): Integer;`
| `procedure InsertKey(Index: Integer; const AKey: TKey);`
| `procedure InsertKeyData(Index: Integer; const AKey: TKey; const AData: TData);`
| `function Remove(const AKey: TKey): Integer;`
### Properties
| `property Keys[Index:Integer]: TKey read GetKey write PutKey;`
| `property Data[Index:Integer]: TData read GetData write PutData;`
| `property KeyData[constAKey:TKey]: TData read GetKeyData write PutKeyData;`
| `property OnCompare: TKeyCompareFunc read FOnKeyCompare write SetOnKeyCompare;`
| `property OnKeyCompare: TKeyCompareFunc read FOnKeyCompare write SetOnKeyCompare;`
deprecated;
| `property OnDataCompare: TDataCompareFunc read FOnDataCompare write SetOnDataCompare;`
Generated by PasDoc 0.13.0 on 2015-06-15 04:43:09