Changeset 76 for Generics/TemplateGenerics/Generic/QueueImplementation.tpl
- Timestamp:
- Oct 29, 2010, 7:49:29 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Generics/TemplateGenerics/Generic/QueueImplementation.tpl
r73 r76 5 5 procedure TGQueue.Enqueue(Value: TQueueItem); 6 6 begin 7 Add(Value);7 FList.Add(Value); 8 8 end; 9 9 10 10 function TGQueue.Peek: TQueueItem; 11 11 begin 12 Result := First; 12 Result := FList.First; 13 end; 14 15 constructor TGQueue.Create; 16 begin 17 FList := TGList.Create; 18 end; 19 20 destructor TGQueue.Destroy; 21 begin 22 FList.Free; 23 inherited Destroy; 13 24 end; 14 25 15 26 function TGQueue.Dequeue: TQueueItem; 16 27 begin 17 Result := Extract(First);28 Result := FList.Extract(FList.First); 18 29 end; 19 30
Note:
See TracChangeset
for help on using the changeset viewer.