mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-30 11:00:28 +02:00
* added ForEachCall
git-svn-id: trunk@2781 -
This commit is contained in:
parent
33bd5edc31
commit
48d7cfb2a5
@ -25,6 +25,9 @@ uses
|
||||
|
||||
|
||||
Type
|
||||
TObjectListCallback = procedure(data:TObject;arg:pointer) of object;
|
||||
TObjectListStaticCallback = procedure(data:TObject;arg:pointer);
|
||||
|
||||
TFPObjectList = class(TObject)
|
||||
private
|
||||
FFreeObjects : Boolean;
|
||||
@ -56,6 +59,8 @@ Type
|
||||
procedure Assign(Obj:TFPObjectList);
|
||||
procedure Pack;
|
||||
procedure Sort(Compare: TListSortCompare);
|
||||
procedure ForEachCall(proc2call:TObjectListCallback;arg:pointer);
|
||||
procedure ForEachCall(proc2call:TObjectListStaticCallback;arg:pointer);
|
||||
property Capacity: Integer read GetCapacity write SetCapacity;
|
||||
property Count: Integer read GetCount write SetCount;
|
||||
property OwnsObjects: Boolean read FFreeObjects write FFreeObjects;
|
||||
@ -436,6 +441,17 @@ begin
|
||||
Result := TObject(FList.Last);
|
||||
end;
|
||||
|
||||
procedure TFPObjectList.ForEachCall(proc2call:TObjectListCallback;arg:pointer);
|
||||
begin
|
||||
FList.ForEachCall(TListCallBack(proc2call),arg);
|
||||
end;
|
||||
|
||||
procedure TFPObjectList.ForEachCall(proc2call:TObjectListStaticCallback;arg:pointer);
|
||||
begin
|
||||
FList.ForEachCall(TListStaticCallBack(proc2call),arg);
|
||||
end;
|
||||
|
||||
|
||||
{ TObjectList }
|
||||
|
||||
constructor tobjectlist.create(freeobjects : boolean);
|
||||
|
Loading…
Reference in New Issue
Block a user