⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 _dglmap_string_integer.pas

📁 delphi的范型代码库
💻 PAS
字号:
(*
 * DGL(The Delphi Generic Library)
 *
 * Copyright (c) 2004                                                          
 * HouSisong@263.net                                                           
 *
 * This material is provided "as is", with absolutely no warranty expressed    
 * or implied. Any use is at your own risk.                                    
 *                                                                             
 * Permission to use or copy this software for any purpose is hereby granted   
 * without fee, provided the above notices are retained on all copies.         
 * Permission to modify the code and to distribute modified code is granted,   
 * provided the above notices are retained, and a notice that the code was
 * modified is included with the above copyright notice.                       
 *
 *)

//------------------------------------------------------------------------------
//TStrIntMap
//例子
//具现化String<->integer的map容器和其迭代器
// Create by HouSisong, 2004.09.13
//------------------------------------------------------------------------------
unit _DGLMap_String_Integer;

interface
uses
  SysUtils;

{$I DGLCfg.inc_h}

type
  _KeyType     = string;
  _ValueType   = integer;

const
  _NULL_Value:integer=0;
  function _HashValue(const Key: _KeyType):Cardinal;{$ifdef _DGL_Inline} inline; {$endif}//Hash函数

{$I HashMap.inc_h} //"类"模版的声明文件
{$I Map.inc_h} //"类"模版的声明文件
{$I Algorithms.inc_h}

//out
type
  IStrIntMapIterator  = _IMapIterator;
  IStrIntMap          = _IMap;
  IStrIntMultiMap     = _IMultiMap;

  TStrIntHashMap          = _THashMap;
  TStrIntHashMultiMap     = _THashMultiMap;

  TStrIntMap          = _TMap;
  TStrIntMultiMap     = _TMultiMap;

implementation
uses
  HashFunctions;

{$I HashMap.inc_pas} //"类"模版的实现文件
{$I Map.inc_pas} //"类"模版的实现文件
{$I Algorithms.inc_pas}

function _HashValue(const Key :_KeyType):Cardinal; overload;
begin
  result:=HashValue_Str(Key);
end;

end.





⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -