summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--design_notes.txt10
-rw-r--r--src/ada-containers-directed_graphs.ads69
2 files changed, 74 insertions, 5 deletions
diff --git a/design_notes.txt b/design_notes.txt
index 1da9414..08993b8 100644
--- a/design_notes.txt
+++ b/design_notes.txt
@@ -20,14 +20,14 @@ Ada.Containers.Directed_Graphs
List of types:
Extended_Node_Type
Edge_Type
- Edge_Type_Array
+ Edge_Array_Type
Path (derived from the node array type)
Graph
Cursor
- Node_Label_Reference
- Constant_Node_Label_Reference
- Edge_Label_Reference
- Constant_Edge_Label_Reference
+ Node_Label_Reference_Type
+ Constant_Node_Label_Reference_Type
+ Edge_Label_Reference_Type
+ Constant_Edge_Label_Reference_Type
Constants:
No_Node (of Extended_Node_Type)
diff --git a/src/ada-containers-directed_graphs.ads b/src/ada-containers-directed_graphs.ads
new file mode 100644
index 0000000..6d0a2b0
--- /dev/null
+++ b/src/ada-containers-directed_graphs.ads
@@ -0,0 +1,69 @@
+
+
+with
+
+ Ada.Iterator_Interfaces;
+
+private with
+
+ Ada.Containers.Helpers,
+ Ada.Finalization,
+ Ada.Streams;
+ -- maps? sets?
+
+
+generic
+ with Node_Type is (<>);
+ with Node_Array_Type is array (Positive) of Node_Type;
+
+ with Node_Label_Type is private;
+ with Edge_Label_Type is private;
+
+package Ada.Containers.Directed_Graphs is
+
+
+ subtype Extended_Node_Type is Node_Type'Base
+ range Node_Type'First - 1 ..
+ Node_Type'Min (Node_Type'Base'Last - 1, Node_Type'Last) + 1;
+
+ subtype Path is Node_Array_Type;
+
+ type Edge_Type is record
+ From : Node_Type;
+ To : Node_Type;
+ end record;
+
+ type Edge_Array_Type is array (Positive) of Edge_Type;
+
+ type Graph is tagged private;
+
+ type Cursor is private;
+
+
+
+
+ type Node_Label_Constant_Reference_Type
+ (Element : not null access constant Node_Label_Type) is private
+ with
+ Implicit_Dereference => Element;
+
+ type Node_Label_Reference_Type (Element : not null access Node_Label_Type) is private
+ with
+ Implicit_Dereference => Element;
+
+ type Edge_Label_Constant_Reference_Type
+ (Element : not null access constant Edge_Label_Type) is private
+ with
+ Implicit_Dereference => Element;
+
+ type Edge_Label_Reference_Type (Element : not null access Edge_Label_Type) is private
+ with
+ Implicit_Dereference => Element;
+
+
+private
+
+
+end Ada.Containers.Directed_Graphs;
+
+