package body List_Polymorphic_Cntl.Iterators is procedure Null_Proc (Object : in out Holder_Class_Ptr; Continue: in out boolean) is begin -- Null_Proc null; end Null_Proc; ------------------------------------------------ procedure Front_To_Rear (List : in List_Type; Process: Process_Type) is begin -- Front_To_Rear Round_Trip (List, Process, Null_Proc'Access); end Front_To_Rear; ------------------------------------------------ procedure Rear_To_Front (List : in List_Type; Process: Process_Type) is begin -- Rear_To_Front Round_Trip (List, Null_Proc'Access, Process); end Rear_To_Front; ------------------------------------------------ procedure Round_Trip (List : in List_Type; Down_Proc, Up_Proc : Process_Type) is Continue: boolean := true; Next_One: Holder_Class_Ptr; procedure Rec_Iter (Point : in out Holder_Class_Ptr) is begin -- Rec_Iter if Point /= null then Next_One:= Point.Next; Down_Proc (Point, Continue); Point.Next:= Next_One; if Continue then Rec_Iter (Point.Next); if Continue then Next_One:= Point.Next; Up_Proc (Point, Continue); Point.Next:= Next_One; end if; end if; end if; end Rec_Iter; --------------------------------------------- begin -- Round_Trip Rec_Iter (List.Actual.all); end Round_Trip; ------------------------------------------------ end List_Polymorphic_Cntl.Iterators;