Changeset 84 for Generics/TemplateGenerics/Generic/GenericStack.inc
- Timestamp:
- Oct 31, 2010, 3:14:23 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Generics/TemplateGenerics/Generic/GenericStack.inc
r83 r84 1 1 {$IFDEF INTERFACE} 2 2 3 TListIndex = TStackIndex; 4 TListItem = TStackItem; 5 {$DEFINE INTERFACE} 6 {$INCLUDE 'GenericList.inc'} 3 {$DEFINE TGListIndex := TGStackIndex} 4 {$DEFINE TGListItem := TGStackItem} 5 {$DEFINE TGList := TGStackList} 6 {$DEFINE TGListSortCompare := TGStackSortCompare} 7 {$DEFINE TGListStringConverter := TGStackStringConverter} 8 {$DEFINE INTERFACE} 9 {$INCLUDE 'GenericList.inc'} 7 10 8 11 // TGStack<TStackIndex, TStackItem> = class(TGList) … … 11 14 FList: TGList; 12 15 public 13 procedure Push(Value: T StackItem);14 function Pop: T StackItem;16 procedure Push(Value: TGStackItem); 17 function Pop: TGStackItem; 15 18 constructor Create; 16 19 destructor Destroy; override; … … 21 24 {$ENDIF} 22 25 26 {$IFDEF IMPLEMENTATION_USES} 27 28 {$DEFINE IMPLEMENTATION_USES} 29 {$INCLUDE '..\Generic\GenericList.inc'} 30 31 {$UNDEF IMPLEMENTATION_USES} 32 {$ENDIF} 33 23 34 {$IFDEF IMPLEMENTATION} 24 35 36 {$DEFINE TGListIndex := TGStackIndex} 37 {$DEFINE TGListItem := TGStackItem} 38 {$DEFINE TGList := TGStackList} 39 {$DEFINE TGListSortCompare := TGStackSortCompare} 40 {$DEFINE TGListStringConverter := TGStackStringConverter} 25 41 {$DEFINE IMPLEMENTATION} 26 42 {$INCLUDE 'GenericList.inc'} … … 28 44 { TGStack } 29 45 30 procedure TGStack.Push(Value: T StackItem);46 procedure TGStack.Push(Value: TGStackItem); 31 47 begin 32 48 FList.Add(Value); 33 49 end; 34 50 35 function TGStack.Pop: T StackItem;51 function TGStack.Pop: TGStackItem; 36 52 begin 37 53 Result := FList.Extract(FList.Last); … … 49 65 end; 50 66 67 {$UNDEF IMPLEMENTATION} 51 68 {$ENDIF}
Note:
See TracChangeset
for help on using the changeset viewer.