text stringlengths 0 234 |
|---|
Right_Instance : in Root_Object.Object_Access) is |
Temp_Minor_Pointer : Relationship_Pair_Access_Type; |
Temp_Major_Pointer : Relationship_Entry_Access_Type; |
Delete_List : Boolean := False; |
begin |
Temp_Major_Pointer := The_Relationship_List; |
Major_Loop: |
while Temp_Major_Pointer /= null loop |
if Temp_Major_Pointer.Single = Left_Instance then |
Temp_Minor_Pointer := Temp_Major_Pointer.Completion_List; |
Minor_Loop: |
while Temp_Minor_Pointer /= null loop |
if Temp_Minor_Pointer.Multiple = Right_Instance then |
if Temp_Minor_Pointer.Previous = null then |
-- |
-- first instance in list |
-- |
Temp_Major_Pointer.Completion_List := Temp_Minor_Pointer.Next; |
-- |
-- it's also the last and only instance in list |
-- So we're going to delete the whole relationship instance |
-- (but not just yet) |
-- |
Delete_List := (Temp_Minor_Pointer.Next = null); |
end if; |
if Temp_Minor_Pointer.Next /= null then |
-- |
-- there are more instances following in the list |
-- |
Temp_Minor_Pointer.Next.Previous := Temp_Minor_Pointer.Previous; |
end if; |
if Temp_Minor_Pointer.Previous /= null then |
-- |
-- there are more instances previous in the list |
-- |
Temp_Minor_Pointer.Previous.Next := Temp_Minor_Pointer.Next; |
end if; |
Remove_Pair (Temp_Minor_Pointer); |
exit Major_Loop; |
end if; |
Temp_Minor_Pointer := Temp_Minor_Pointer.Next; |
end loop Minor_Loop; |
end if; |
Temp_Major_Pointer := Temp_Major_Pointer.Next; |
end loop Major_Loop; |
-- |
-- if needed, now delete the list |
-- the same logic applies |
-- |
if Delete_List then |
if Temp_Major_Pointer.Previous = null then |
-- |
-- first instance in list |
-- |
The_Relationship_List := Temp_Major_Pointer.Next; |
end if; |
if Temp_Major_Pointer.Next /= null then |
-- |
-- there are more instances following in the list |
-- |
Temp_Major_Pointer.Next.Previous := Temp_Major_Pointer.Previous; |
end if; |
if Temp_Major_Pointer.Previous /= null then |
-- |
-- there are more instances previous in the list |
-- |
Temp_Major_Pointer.Previous.Next := Temp_Major_Pointer.Next; |
end if; |
Remove_Entry (Temp_Major_Pointer); |
end if; |
end Do_Unlink; |
------------------------------------------------------------------------- |
procedure Register_Multiple_End_Class (Multiple_Instance : in Ada.Tags.Tag) is |
begin |
Multiple_Side := Multiple_Instance; |
end Register_Multiple_End_Class; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.