text
stringlengths
0
234
declare
Input_List : Root_Object.Object_List.List_Header_Access_Type;
begin
Input_List := Root_Object.Object_List.Initialise;
Root_Object.Object_List.Clear(Assoc_Set);
Root_Object.Object_List.Insert (
New_Item => Single_Side_Source,
On_To => Input_List);
Navigate(
From => Input_List,
Class => Class,
To => Assoc_Set);
Root_Object.Object_List.Destroy_List(Input_List);
Function Definition: procedure Remove_Node is new Ada.Unchecked_Deallocation (Node_Type, Node_Access_Type);
Function Body: procedure Remove_List is new Ada.Unchecked_Deallocation (List_Header_Type, List_Header_Access_Type);
---------------------------------------------------------------------
function Initialise return List_Header_Access_Type is
Temp_Entry: List_Header_Access_Type;
begin
--
-- allocate new memory for the header information
--
Temp_Entry := new List_Header_Type;
--
-- and set the fields up. These could be replaced by default values in the
-- record declaration.
--
Temp_Entry.First_Entry := null;
Temp_Entry.Count := 0;
Temp_Entry.Free_List := null;
Temp_Entry.Free_List_Count := 0;
-- DEFECT 262 set Stepping_Pointer to null.
Temp_Entry.Stepping_Pointer := null;
return Temp_Entry;
end Initialise;
---------------------------------------------------------------------
function Count_Of (Target_List : List_Header_Access_Type) return Application_Types.Base_Integer_Type is
begin
return Target_List.Count;
end Count_Of;
---------------------------------------------------------------------
function Count_Of_Free_List (Target_List : List_Header_Access_Type) return Application_Types.Base_Integer_Type is
begin
return Target_List.Free_List_Count;
end Count_Of_Free_List;
---------------------------------------------------------------------
function Max_Count_Of (Target_List : List_Header_Access_Type) return Application_Types.Base_Integer_Type is
begin
return Target_List.Max_Count;
end Max_Count_Of;
---------------------------------------------------------------------
function First_Entry_Of (Target_List : List_Header_Access_Type) return Node_Access_Type is
begin
Target_List.Stepping_Pointer := Target_List.First_Entry;
return Target_List.Stepping_Pointer;
end First_Entry_Of;
---------------------------------------------------------------------
function Next_Entry_Of (Target_List : List_Header_Access_Type) return Node_Access_Type is
begin
Target_List.Stepping_Pointer := Target_List.Stepping_Pointer.Next;
return Target_List.Stepping_Pointer;
end Next_Entry_Of;
---------------------------------------------------------------------
procedure Insert (New_Item : in Element_Type;
On_To : in List_Header_Access_Type) is
New_Cell: Node_Access_Type;
begin
if On_To.Free_List = null then
--
-- there are no 'old' entries available for reuse
--
begin
New_Cell:= new Node_Type;