代码拉取完成,页面将自动刷新
(*
* DGL(The Delphi Generic Library)
*
* 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.
*
*)
//------------------------------------------------------------------------------
// _TStack的声明
// Create by HouSisong, 2004.09.08
//------------------------------------------------------------------------------
{$ifndef __Stack_inc_h_}
{$define __Stack_inc_h_}
{$I DGLIntf.inc_h}
{$I Deque.inc_h}
_TDefaultStackBaseContainer = _TDeque; //默认使用_TDeque
//_TStack
//----------------------------------------------------------------------------
// 作用描述: 实现_IStack接口 ,内部使用_TDeque来实现
// 主要方法:参见_IStack接口的说明
//----------------------------------------------------------------------------
_TStack = class(TInterfacedObject,_IStack)
private
FBaseContainer : _TDefaultStackBaseContainer;
public
//实现_IStack接口
procedure Push(const Value: _ValueType); {$ifdef _DGL_Inline} inline; {$endif}
procedure Pop(); {$ifdef _DGL_Inline} inline; {$endif}
function GetTopValue():_ValueType; {$ifdef _DGL_Inline} inline; {$endif}
procedure SetTopValue(const aValue:_ValueType); {$ifdef _DGL_Inline} inline; {$endif}
property Top: _ValueType read GetTopValue write SetTopValue;
procedure Clear(); {$ifdef _DGL_Inline} inline; {$endif}
function Size(): _TNativeInt; {$ifdef _DGL_Inline} inline; {$endif}
function IsEmpty(): Boolean; {$ifdef _DGL_Inline} inline; {$endif}
function IsEquals(const AContainer: _IStack): Boolean; {$ifdef _DGL_Inline} inline; {$endif}
function Clone():_IStack; {$ifdef _DGL_Inline} inline; {$endif}
procedure Assign(const num:_TNativeInt;const Value: _ValueType);overload; {$ifdef _DGL_Inline} inline; {$endif}
procedure Assign(const ItBegin,ItEnd:_IIterator);overload; //todo: Warning inline on if _ValueType if "object" then error!!!
function GetSelfObj():TObject; {$ifdef _DGL_Inline} inline; {$endif}
public
constructor Create(); overload;
constructor Create(const num:_TNativeInt);overload;
constructor Create(const num:_TNativeInt;const Value:_ValueType);overload;
constructor Create(const ItBegin,ItEnd:_IIterator);overload;
constructor Create(const AStack:_TStack);overload;
destructor Destroy(); override;
end;
{$endif } // __Stack_inc_h_
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。