Changeset 90 for trunk/Packages/TemplateGenerics/Generic/GenericQueue.inc
- Timestamp:
- Sep 7, 2012, 6:45:53 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/TemplateGenerics/Generic/GenericQueue.inc
r84 r90 11 11 {$I 'GenericList.inc'} 12 12 13 // TGQueue<T SetIndex, TSetItem> = class(TGList)13 // TGQueue<TQueueIndex, TQueueItem> = class(TGList) 14 14 TGQueue = class 15 15 private 16 16 FList: TGList; 17 function GetCount: TGQueueIndex; 17 18 public 18 19 procedure Enqueue(Value: TGQueueItem); 20 procedure EnqueueArray(Values: array of TGQueueItem); 21 procedure EnqueueList(List: TGList); 19 22 function Dequeue: TGQueueItem; 20 23 function Peek: TGQueueItem; … … 22 25 destructor Destroy; override; 23 26 property List: TGList read FList; 27 property Count: TGQueueIndex read GetCount; 24 28 end; 25 29 … … 54 58 end; 55 59 60 procedure TGQueue.EnqueueArray(Values: array of TGQueueItem); 61 begin 62 FList.AddArray(Values); 63 end; 64 65 procedure TGQueue.EnqueueList(List: TGList); 66 begin 67 FList.AddList(List); 68 end; 69 56 70 function TGQueue.Peek: TGQueueItem; 57 71 begin … … 75 89 end; 76 90 91 function TGQueue.GetCount: TGQueueIndex; 92 begin 93 Result := FList.Count; 94 end; 95 77 96 {$UNDEF IMPLEMENTATION} 78 97 {$ENDIF}
Note:
See TracChangeset
for help on using the changeset viewer.