加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
DGL_Pointer.pas 2.82 KB
一键复制 编辑 原始数据 按行查看 历史
(*
* Copyright (c) 2004
* HouSisong@gmail.com
*
* 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.
*
*)
//------------------------------------------------------------------------------
// 具现化的Pointer类型的声明
// Create by HouSisong, 2004.09.04
//------------------------------------------------------------------------------
unit DGL_Pointer;
interface
uses
SysUtils;
{$I DGLCfg.inc_h}
type
_ValueType = Pointer;
const
_NULL_Value:pointer=nil;
{$define _DGL_NotHashFunction}
{$define _DGL_Compare} //是否需要比较函数,可选
function _IsEqual(const a,b :_ValueType):boolean; {$ifdef _DGL_Inline} inline; {$endif}//result:=(a=b);
function _IsLess(const a,b :_ValueType):boolean; {$ifdef _DGL_Inline} inline; {$endif} //result:=(a<b); 默认排序准则
{$I DGL.inc_h}
type
TPointerAlgorithms = _TAlgorithms;
IPointerIterator = _IIterator;
IPointerContainer = _IContainer;
IPointerSerialContainer = _ISerialContainer;
IPointerVector = _IVector;
IPointerList = _IList;
IPointerDeque = _IDeque;
IPointerStack = _IStack;
IPointerQueue = _IQueue;
IPointerPriorityQueue = _IPriorityQueue;
IPointerSet = _ISet;
IPointerMultiSet = _IMultiSet;
TPointerVector = _TVector;
TPointerDeque = _TDeque;
TPointerList = _TList;
IPointerVectorIterator = _IVectorIterator; //速度比_IIterator稍快一点:)
IPointerDequeIterator = _IDequeIterator; //速度比_IIterator稍快一点:)
IPointerListIterator = _IListIterator; //速度比_IIterator稍快一点:)
TPointerStack = _TStack;
TPointerQueue = _TQueue;
TPointerPriorityQueue = _TPriorityQueue;
//
IPointerMapIterator = _IMapIterator;
IPointerMap = _IMap;
IPointerMultiMap = _IMultiMap;
TPointerSet = _TSet;
TPointerMultiSet = _TMultiSet;
TPointerMap = _TMap;
TPointerMultiMap = _TMultiMap;
TPointerHashSet = _THashSet;
TPointerHashMultiSet = _THashMultiSet;
TPointerHashMap = _THashMap;
TPointerHashMultiMap = _THashMultiMap;
implementation
function _IsEqual(const a,b :_ValueType):boolean;
begin
result:=(a=b);
end;
function _IsLess(const a,b :_ValueType):boolean;
begin
result:=(_TNativeUInt(a)<_TNativeUInt(b));
end;
{$I DGL.inc_pas}
end.
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化