- 6


Array_Of_Access_Role_Type'(This_Array);

return;

end if;

for I in This_Array'Range loop

Valid := Is_Unique (Th1s_Access_Array.all. This_Array (I));

pragma Assert (Valid);

end loop;

-- Reuse any empty slots.

for I in This_Access_Array'Range loop

if This_Access_Array (I) = null then

This_Access_Array (I) := This_Array (Pos);

Pos := Pos + 1;

if Pos > Last then return;

end if;

end if;

end loop;

if Positive(This_Access_Array'Length + (Last - Pos + 1)) > Limit then raise

Constraint_Error;

end if;

-- For any remaining entries, combine by reallocating.

Temp_Access_Array := new Array_Of_Access_Role_Type'

(This_Access_Array.all & This_Array (Pos .. Last));

Free (This_Access_Array);

This_Access_Array := Temp_Access_Array;

end Set;

function Is_Unique (This_Array : Array_Of_Access_Role_Type;

This : Access_Role_Type) return Boolean is

begin

if This = null then return False;

end if;

for I in This_Array'Range loop

if This_Array (I) = This then return False;

end if;

end loop;

return True;

end Is_Unique;

function Unique (This_Array : in Array_Of_Access_Role_Type)

return Array_Of_Access_Ro1e_Type is

First : constant Index := This_Array'First;

Count : Index := First;

Temp_Array : Array_Of_Access_Role_Type (This_Array'Range);

begin

for I in This_Array'Range loop

if Is_Unique (Temp_Array (First .. Count - 1).

This_Array (I)) then

Temp_Array (Count) := This_Array (I);

Count :- Count + 1;

end if;

end loop;

return Temp_Array (First .. Count - 1);

end Unique:

end Generic_Tagged_Association;

package Role_0bject is new Generic_Tagged_Association

(Object,

Handle,

Positive,

Array_Of_Handle,

Access_Array_Of_Hand1e);

--##end module.associations

procedure Associate (This_Handle : in Handle: This_Handle

: in Handle) is

--#begin Associate%38099E7D0190.declarations preserve=no




- -  - -  - -