Commit e1e20ecd authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Use dictionaries to store interfaces

parent b775161f
......@@ -671,9 +671,11 @@ package body Parser_Utils is
Iface := Parse_Interface (PI_Or_RI);
Iface.Parent_Function := Result.Name;
if AIN.Is_Provided (PI_Or_RI) then
Result.Provided := Result.Provided & Iface;
Result.Provided.Insert (Key => To_String (Iface.Name),
New_Item => Iface);
else
Result.Required := Result.Required & Iface;
Result.Required.Insert (Key => To_String (Iface.Name),
New_Item => Iface);
end if;
PI_Or_RI := AIN.Next_Node (PI_Or_RI);
end loop;
......@@ -761,6 +763,7 @@ package body Parser_Utils is
V1 : Remote_Entities.Vector := Empty_Vector;
V2 : Remote_Entities.Vector := Empty_Vector;
Corr : Taste_Terminal_Function;
PI : Taste_Interface;
begin
Put (" ... RI " & To_String (RI.Name) & " ---> ");
Put (To_String (Remote.Function_Name) & ".");
......@@ -769,14 +772,11 @@ package body Parser_Utils is
V1 := RI.Remote_Interfaces.Value_Or (V1);
V1.Append (Remote);
Corr := Functions.Element (To_String (Remote.Function_Name));
for PI of Corr.Provided loop -- TODO: replace with a Map
if PI.Name = Remote.Interface_Name then
V2 := PI.Remote_Interfaces.Value_Or (V2);
V2.Append (Remote_Entity'(Function_Name => Each.Name,
Interface_Name => RI.Name));
end if;
exit when PI.Name = Remote.Interface_Name;
end loop;
PI := Corr.Provided.Element
(To_String (Remote.Interface_Name));
V2 := PI.Remote_Interfaces.Value_Or (V2);
V2.Append (Remote_Entity'(Function_Name => Each.Name,
Interface_Name => RI.Name));
end if;
end;
end loop;
......
......@@ -153,6 +153,8 @@ package Parser_Utils is
end record;
package Interfaces is new Indefinite_Vectors (Natural, Taste_Interface);
package Interfaces_Maps is new Indefinite_Ordered_Maps (String,
Taste_Interface);
type Context_Parameter is
record
......@@ -175,8 +177,8 @@ package Parser_Utils is
Context_Params : Ctxt_Params.Vector;
User_Properties : Property_Maps.Map;
Timers : String_Vectors.Vector;
Provided : Interfaces.Vector;
Required : Interfaces.Vector;
Provided : Interfaces_Maps.Map;
Required : Interfaces_Maps.Map;
end record;
-- package Functions is new Indefinite_Vectors (Natural,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment