2
This file is part of the Free Component Library (FCL)
3
Copyright (c) 2002 by the Free Pascal development team
5
See the file COPYING.FPC, included in this distribution,
6
for details about the copyright.
8
This program is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
**********************************************************************}
14
constructor TInterfaceList.Create;
17
FList:=TThreadList.Create;
21
destructor TInterfaceList.Destroy;
29
function TInterfaceList.Get(i : Integer) : IUnknown;
33
if (i<0) or (i>=FList.FList.Count) then
34
FList.FList.Error(SListIndexError,i);
35
result:=IUnknown(FList.FList.List^[i]);
42
function TInterfaceList.GetCapacity : Integer;
46
result:=FList.FList.Capacity;
53
function TInterfaceList.GetCount : Integer;
57
result:=FList.FList.Count;
64
procedure TInterfaceList.Put(i : Integer;item : IUnknown);
68
if (i<0) or (i>=FList.FList.Count) then
69
FList.FList.Error(SListIndexError,i);
70
IUnknown(FList.FList.List^[i]):=item;
77
procedure TInterfaceList.SetCapacity(NewCapacity : Integer);
81
FList.FList.Capacity:=NewCapacity;
88
procedure TInterfaceList.SetCount(NewCount : Integer);
92
FList.FList.Count:=NewCount;
99
procedure TInterfaceList.Clear;
105
for i:=0 to FList.FList.Count-1 do
106
IUnknown(FList.FList.List^[i]):=nil;
114
procedure TInterfaceList.Delete(index : Integer);
118
if (index<0) or (index>=FList.FList.Count) then
119
FList.FList.Error(SListIndexError,index);
120
IUnknown(FList.FList.List^[index]):=nil;
121
FList.FList.Delete(index);
128
procedure TInterfaceList.Exchange(index1,index2 : Integer);
132
FList.FList.Exchange(index1,index2);
139
function TInterfaceList.First : IUnknown;
145
function TInterfaceList.IndexOf(item : IUnknown) : Integer;
149
result:=FList.FList.IndexOf(Pointer(Item));
156
function TInterfaceList.Add(item : IUnknown) : Integer;
160
result:=FList.FList.Add(nil);
161
IUnknown(FList.FList.List^[result]):=item;
168
procedure TInterfaceList.Insert(i : Integer;item : IUnknown);
172
FList.FList.Insert(i,nil);
173
IUnknown(FList.FList.List^[i]):=item;
180
function TInterfaceList.Last : IUnknown;
182
result:=Get(Count-1);
186
function TInterfaceList.Remove(item : IUnknown): Integer;
190
result:=FList.FList.IndexOf(item);
193
IUnknown(FList.FList.List^[result]):=nil;
194
FList.FList.Delete(result);
202
procedure TInterfaceList.Lock;
208
procedure TInterfaceList.Unlock;
214
function TInterfaceList.Expand : TInterfaceList;