lace.event_connector.destruct: Revamp 'all_Connectors_are_idle'.

This commit is contained in:
Rod Kay
2024-09-04 20:29:08 +10:00
parent 90051c141c
commit f93efaaa7c

View File

@@ -30,6 +30,8 @@ is
procedure add (new_Connector : in Connector_view); procedure add (new_Connector : in Connector_view);
procedure get ( a_Connector : out Connector_view); procedure get ( a_Connector : out Connector_view);
function Length return ada.Containers.Count_type;
private private
all_Connectors : connector_Vector; all_Connectors : connector_Vector;
end safe_Connectors; end safe_Connectors;
@@ -143,18 +145,20 @@ is
function all_Connectors_are_idle return Boolean function all_Connectors_are_idle return Boolean
is is
Result : Boolean := True; use type ada.Containers.Count_type;
-- Result : Boolean := True;
begin begin
for Each of all_Connectors return all_Connectors.Length = idle_Connectors.Length;
loop -- for Each of all_Connectors
if not Each'Callable -- loop
then -- if not Each'Callable
Result := False; -- then
exit; -- Result := False;
end if; -- exit;
end loop; -- end if;
-- end loop;
return Result; --
-- return Result;
end all_Connectors_are_idle; end all_Connectors_are_idle;
@@ -292,8 +296,8 @@ is
------------------ --------------------
--- Safe emitters. --- Safe connectors.
-- --
protected body safe_Connectors protected body safe_Connectors
@@ -320,6 +324,13 @@ is
end get; end get;
function Length return ada.Containers.Count_type
is
begin
return all_Connectors.Length;
end Length;
end safe_Connectors; end safe_Connectors;