Hosted by
|
generic
type Content_Type is limited private;
package Limited_Lists is
type List is limited private;
type List_Access is access List;
type Item;
type Item_Access is access Item;
type Item is limited record
Next : Item_Access := null;
Content : Content_Type;
end record;
function Create
return List_Access;
procedure Append
(This : access List;
Tail : access List);
function Push
(This : access List)
return Item_Access;
function Unshift
(This : access List)
return Item_Access;
function Pop
(This : access List)
return Item_Access;
function Shift
(This : access List)
return Item_Access;
function Count
(This : access List)
return Natural;
function Empty
(This : access List)
return Boolean;
function Index
(This : access List)
return Natural;
function First
(This : access List)
return Content_Type;
function Last
(This : access List)
return Content_Type;
procedure Reset
(This : access List);
procedure Next
(This : access List);
function Next
(This : access List)
return Boolean;
function Next_Available
(This : access List)
return Boolean;
function Next_Content
(This : access List)
return Content_Type;
function End_Of_List
(This : access List)
return Boolean;
function Current
(This : access List)
return Content_Type;
procedure Remove_Current
(This : access List);
function Insert_Before_Current
(This : access List)
return Item_Access;
function Insert_After_Current
(This : access List)
return Item_Access;
function First_Item
(This : access List)
return Item_Access;
function Last_Item
(This : access List)
return Item_Access;
function Current_Item
(This : access List)
return Item_Access;
procedure Next_Item
(This : in out Item_Access);
function Next_Item
(This : access Item)
return Item_Access;
function Item_Invalid
(This : in Item_Access)
return Boolean;
function Item_Equals
(This : in Item_Access;
Other : in Item_Access)
return Boolean;
function Item_Content
(This : access Item)
return Content_Type;
procedure Remove_Item
(Previous : in Item_Access;
This : in out Item_Access;
Context : access List);
private
type List is record
Count : Natural := 0;
Index : Natural := 0;
First : Item_Access;
Last : Item_Access;
Prev : Item_Access;
Current : Item_Access;
Next : Item_Access;
end record;
end Limited_Lists;
|