diff options
author | Jed Barber <jjbarber@y7mail.com> | 2020-04-24 13:54:52 +1000 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2020-04-24 13:54:52 +1000 |
commit | d8337f648d6b81157008143c9dfb0d35d496f5e8 (patch) | |
tree | 2bac6629c5bc6e97baf3690b332c67c2f1c260d4 | |
parent | 46010b309ea6be1c233779a90df0e39e98240118 (diff) |
Iterator portion of spec
-rw-r--r-- | src/ada-containers-directed_graphs.ads | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/src/ada-containers-directed_graphs.ads b/src/ada-containers-directed_graphs.ads index cc1c39c..83ab249 100644 --- a/src/ada-containers-directed_graphs.ads +++ b/src/ada-containers-directed_graphs.ads @@ -733,7 +733,59 @@ private - -- Define Iterators for general iteration and subgraph iteration here + type Iterator is new Ada.Finalization.Limited_Controlled and + Graph_Iterator_Interfaces.Reversible_Iterator with + record + Container : Graph_Access; + Node : Extended_Node_Type; + end record + with Disable_Controlled => not Impl.T_Check; + + overriding procedure Finalize + (Object : in out Iterator); + + overriding function First + (Object : in Iterator) + return Cursor; + + overriding function Last + (Object : in Iterator) + return Cursor; + + overriding function Next + (Object : in Iterator; + Position : in Cursor) + return Cursor; + + overriding function Previous + (Object : in Iterator; + Position : in Cursor) + return Cursor; + + + + + type Subgraph_Iterator is new Ada.Finalization.Limited_Controlled and + Graph_Iterator_Interfaces.Forward_Iterator with + record + Container : Graph_Access; + Root_Node : Node_Type; + Visited : Node_Vectors.Vector; + Current : Extended_Node_Type; + end record + with Disable_Controlled => not Impl.T_Check; + + overriding procedure Finalize + (Object : in out Subgraph_Iterator); + + overriding function First + (Object : in Subgraph_Iterator) + return Cursor; + + overriding function Next + (Object : in Subgraph_Iterator; + Position : in Subgraph_Iterator) + return Cursor; end Ada.Containers.Directed_Graphs; |