text stringlengths 0 234 |
|---|
begin |
-- Reset the output pointer to null so that if we don't find anything |
-- useful, the caller can check for it. |
To := null; |
Tags_Correct := ((( From.all'Tag = Multiple_Side) and then |
( Also.all'Tag = Single_Side)) |
or else ((( From.all'Tag = Single_Side) and then |
( Also.all'Tag = Multiple_Side)))) ; |
if Tags_Correct then |
if From.all'Tag = Multiple_Side then |
Multiple_Side_Source := From; |
Single_Side_Source := Also; |
else |
Multiple_Side_Source := Also; |
Single_Side_Source := From; |
end if; |
-- Do the navigations now, all is correct. |
-- Navigate from multiple side to associative side. |
Check_List_For_Multiple ( |
Multiple_Instance => Multiple_Side_Source, |
Associative_Instance => Temp_Associative_Multiple, |
Single_Instance => Temp_Single, |
Multiple_Instance_Found => Found); |
-- Navigate from single side to associative side. |
if Found then |
-- do the navigation |
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: function distance(p : in Position) return Natural is |
Function Body: begin |
return abs(p.x) + abs(p.y); |
end distance; |
function hash(p : in Position) return Ada.Containers.Hash_Type is |
begin |
return Ada.Strings.Hash(p.x'IMAGE & "," & p.y'IMAGE); |
end hash; |
function equivalent_positions(left, right: Position) return Boolean is |
begin |
return (left.x = right.x) and then (left.y = right.y); |
end equivalent_positions; |
-- function "=" (left : in Position; right : in Position) return Boolean is |
-- begin |
-- return (left.x = right.x) and (left.y = right.y); |
-- end "="; |
function to_string(wp : in Wire_Points.Set) return String is |
package Unbounded renames Ada.Strings.Unbounded; |
s : Unbounded.Unbounded_String; |
begin |
for elt of wp loop |
Unbounded.append(s, to_string(elt) & ", "); |
end loop; |
return Unbounded.to_string(s); |
end to_string; |
function to_string(ws : in Wire_Segment) return String is |
begin |
return to_string(ws.dir) & Integer'Image(ws.distance); |
end to_string; |
function to_string(w : in Wire.Vector) return String is |
package Unbounded renames Ada.Strings.Unbounded; |
s : Unbounded.Unbounded_String; |
begin |
for elt of w loop |
Unbounded.append(s, to_string(elt) & ", "); |
end loop; |
return Unbounded.to_string(s); |
end to_string; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.