Hosted by
|
generic
type Content_Type is private;
with function To_String
(Item : in Content_Type)
return String
is <>;
with function "<"
(A, B : in Content_Type)
return Boolean
is <>;
package Heaps is
type Heap is private;
Empty_Heap : constant Heap;
procedure Resize
(This : in out Heap;
New_Size : in Positive);
procedure Deallocate
(This : in out Heap);
function Count
(This : in Heap)
return Natural;
procedure Debug
(This : in Heap);
procedure Insert
(This : in out Heap;
Item : in Content_Type);
function Extract
(This : in Heap)
return Content_Type;
private
type Content_Type_Array is array(Positive range <>) of Content_Type;
type Heap_Record(Size : Positive) is record
Count : Natural := 0;
Items : Content_Type_Array(1 .. Size);
end record;
type Heap is access Heap_Record;
Empty_Heap : constant Heap := null;
end Heaps;
|