Changeset 102 for Generics


Ignore:
Timestamp:
Dec 29, 2010, 9:27:59 AM (14 years ago)
Author:
george
Message:
  • Added: TListMethod class.
Location:
Generics/TemplateGenerics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Generics/TemplateGenerics/Specialized/SpecializedList.pas

    r101 r102  
    8484{$DEFINE TGListObjectIndex := Integer}
    8585{$DEFINE TGListObjectItem := TObject}
    86 {$DEFINE TGListObjectList := TObjectListListObject}
     86{$DEFINE TGListObjectList := TListObjectList}
    8787{$DEFINE TGListObject := TListObject}
    88 {$DEFINE TGListObjectSortCompare := TObjectListSortCompareObject}
    89 {$DEFINE TGListObjectToStringConverter := TObjectListToStringConverterObject}
    90 {$DEFINE TGListObjectFromStringConverter := TObjectListFromStringConverterObject}
     88{$DEFINE TGListObjectSortCompare := TListObjectSortCompare}
     89{$DEFINE TGListObjectToStringConverter := TListObjectToStringConverter}
     90{$DEFINE TGListObjectFromStringConverter := TListObjectFromStringConverter}
    9191{$DEFINE INTERFACE}
    9292{$I 'GenericListObject.inc'}
     
    104104end;
    105105
     106// TListMethodBase<Integer, TMethod>
     107{$DEFINE TGListIndex := Integer}
     108{$DEFINE TGListItem := TMethod}
     109{$DEFINE TGList := TListMethodBase}
     110{$DEFINE TGListSortCompare := TListMethodSortCompare}
     111{$DEFINE TGListToStringConverter := TListMethodToStringConverter}
     112{$DEFINE TGListFromStringConverter := TListMethodFromStringConverter}
     113{$DEFINE INTERFACE}
     114{$I 'GenericList.inc'}
     115
     116// TListMethod<Integer, TMethod>
     117TListMethod = class(TListMethodBase)
     118  procedure CallAll;
     119  procedure CallNotifyEvents(Sender: TObject);
     120end;
     121
    106122function StrToStr(Value: string): string;
    107123
     
    184200{$DEFINE TGListObjectIndex := Integer}
    185201{$DEFINE TGListObjectItem := TObject}
    186 {$DEFINE TGListObjectList := TObjectListListObject}
     202{$DEFINE TGListObjectList := TListObjectList}
    187203{$DEFINE TGListObject := TListObject}
    188 {$DEFINE TGListObjectSortCompare := TObjectListSortCompareObject}
    189 {$DEFINE TGListObjectToStringConverter := TObjectListToStringConverterObject}
    190 {$DEFINE TGListObjectFromStringConverter := TObjectListFromStringConverterObject}
     204{$DEFINE TGListObjectSortCompare := TListObjectSortCompare}
     205{$DEFINE TGListObjectToStringConverter := TListObjectToStringConverter}
     206{$DEFINE TGListObjectFromStringConverter := TListObjectFromStringConverter}
    191207{$DEFINE IMPLEMENTATION}
    192208{$I 'GenericListObject.inc'}
    193209
     210// TListMethod<Integer, TMethod>
     211{$DEFINE TGListIndex := Integer}
     212{$DEFINE TGListItem := TMethod}
     213{$DEFINE TGList := TListMethodBase}
     214{$DEFINE TGListSortCompare := TListMethodSortCompare}
     215{$DEFINE TGListToStringConverter := TListMethodToStringConverter}
     216{$DEFINE TGListFromStringConverter := TListMethodFromStringConverter}
     217{$DEFINE IMPLEMENTATION}
     218{$I 'GenericList.inc'}
    194219
    195220
     
    247272end;
    248273
     274procedure TListMethod.CallAll;
     275var
     276  I: TGListIndex;
     277begin
     278  I := 0;
     279  while (I < Count) do begin
     280    Items[I];
     281    I := I + 1;
     282  end;
     283end;
     284
     285procedure TListMethod.CallNotifyEvents(Sender: TObject);
     286var
     287  I: TGListIndex;
     288begin
     289  I := 0;
     290  while (I < Count) do begin
     291    TNotifyEvent(Items[I])(Sender);
     292    I := I + 1;
     293  end;
     294end;
     295
    249296end.
  • Generics/TemplateGenerics/TemplateGenerics.lpk

    r101 r102  
    1818    </CompilerOptions>
    1919    <Description Value="Generic classes implemented as templates."/>
    20     <Version Minor="2"/>
     20    <Version Minor="3"/>
    2121    <Files Count="16">
    2222      <Item1>
     
    9292    </RequiredPkgs>
    9393    <UsageOptions>
    94       <IncludePath Value="Generic\"/>
    95       <UnitPath Value="$(PkgOutDir)\"/>
     94      <IncludePath Value="Generic"/>
     95      <UnitPath Value="$(PkgOutDir)"/>
    9696    </UsageOptions>
    9797    <PublishOptions>
Note: See TracChangeset for help on using the changeset viewer.