text stringlengths 0 234 |
|---|
-- Compare results of the two sets from the above navigations. |
-- A nice simple find operation on a set would be appropriate here, but |
-- there isn't one available, so do it the hard way. |
-- Outer loop |
declare |
use type Root_Object.Object_List.Node_Access_Type; |
Temp_Entry : Root_Object.Object_List.Node_Access_Type; |
Matched : boolean := FALSE; |
begin |
-- Grab the first entry of the set |
Temp_Entry := Root_Object.Object_List.First_Entry_Of(Assoc_Set_One); |
-- While the set is not empty and the entry does not match the |
-- assoc instance already found, burn rubber |
while (not Matched) and (Temp_Entry /= null) loop |
Temp_Associative_One := Temp_Entry.Item; |
-- Compare this entry against the other set. |
-- Inner loop |
declare |
use type Root_Object.Object_List.Node_Access_Type; |
Inner_Temp_Entry : Root_Object.Object_List.Node_Access_Type; |
begin |
-- Grab the first entry of the set |
Inner_Temp_Entry := Root_Object.Object_List.First_Entry_Of(Assoc_Set_Two); |
-- While the set is not empty and the entry does not match the |
-- assoc instance already found, smoke 'em |
while (not matched) and (Inner_Temp_Entry /= null) loop |
Temp_Associative_Two := Inner_Temp_Entry.Item; |
-- If M-M:M associative was ever implemented, |
-- it would be easy to add the matched instance into a set for |
-- return from this procedure. |
Matched := Temp_Associative_One = Temp_Associative_Two; |
if not Matched then |
Inner_Temp_Entry := Root_Object.Object_List.Next_Entry_Of(Assoc_Set_Two); |
end if; |
end loop; -- end of (Temp_Entry /= null) or else Matched loop |
Function Definition: procedure Remove_Pair is new Ada.Unchecked_Deallocation ( |
Function Body: Relationship_Pair_Type, Relationship_Pair_Access_Type); |
-- |
-- 'Major' element |
-- |
type Relationship_Entry_Type; |
type Relationship_Entry_Access_Type is access all Relationship_Entry_Type; |
type Relationship_Entry_Type is record |
Single : Root_Object.Object_Access; |
Completion_List : Relationship_Pair_Access_Type; |
Next : Relationship_Entry_Access_Type; |
Previous : Relationship_Entry_Access_Type; |
end record; |
procedure Remove_Entry is new Ada.Unchecked_Deallocation ( |
Relationship_Entry_Type, Relationship_Entry_Access_Type); |
------------------------------------------------------------------------ |
The_Relationship_List: Relationship_Entry_Access_Type; |
subtype Role_Phrase_Type is string (1 .. Application_Types.Maximum_Number_Of_Characters_In_String); |
Multiple_Side : Ada.Tags.Tag; |
Multiple_Side_Role : Role_Phrase_Type; |
Multiple_Side_Role_Length : Natural; |
Single_Side : Ada.Tags.Tag; |
Single_Side_Role : Role_Phrase_Type; |
Single_Side_Role_Length : Natural; |
Associative_Side : Ada.Tags.Tag; |
Associative_Side_Role : Role_Phrase_Type; |
Associative_Side_Role_Length : Natural; |
-- |
-- A = LEFT = MULTIPLE |
-- B = RIGHT = SINGLE |
-- |
------------------------------------------------------------------------ |
procedure Check_List_For_Multiple ( |
Multiple_Instance : in Root_Object.Object_Access; |
Associative_Instance : out Root_Object.Object_Access; |
Single_Instance : out Root_Object.Object_Access; |
Multiple_Instance_Found : out Boolean) is |
Temp_Minor_Pointer : Relationship_Pair_Access_Type; |
Temp_Major_Pointer : Relationship_Entry_Access_Type; |
begin |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.