diff options
-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; |