aboutsummaryrefslogtreecommitdiffstats
path: root/src/dyn_maps.ads
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-12-28 16:38:19 +0100
committerTristan Gingold <tgingold@free.fr>2021-12-28 19:03:35 +0100
commitc2ab0b7be948f9dc16da8185232fcb621f075b9f (patch)
tree06424bd39ffccca269ed4c8f25064c86ff20bf08 /src/dyn_maps.ads
parentc5eb6d2df0f6d8689c2031661f8bd34cccd60219 (diff)
downloadghdl-c2ab0b7be948f9dc16da8185232fcb621f075b9f.tar.gz
ghdl-c2ab0b7be948f9dc16da8185232fcb621f075b9f.tar.bz2
ghdl-c2ab0b7be948f9dc16da8185232fcb621f075b9f.zip
dyn_maps: add Get_Index_Soft.
Diffstat (limited to 'src/dyn_maps.ads')
-rw-r--r--src/dyn_maps.ads15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/dyn_maps.ads b/src/dyn_maps.ads
index a663e67f0..bfebb2dab 100644
--- a/src/dyn_maps.ads
+++ b/src/dyn_maps.ads
@@ -19,7 +19,16 @@ with Hash; use Hash;
with Dyn_Tables;
-- This generic package provides a factory to build unique objects.
--- Get will return an existing object or create a new one.
+-- The container is iterable through the index.
+-- PARAMS_TYPE is the type used to find the key, and if the key does not
+-- exists, it is also used to build the new object.
+-- The key is of type OBJECT_TYPE.
+-- VALUE_TYPE is the value associated to the key.
+--
+-- FIXME: this is too confusing.
+-- Use the usual names KEY_TYPE and VALUE_TYPE.
+-- Use BUILD_TYPE instead of PARAMS_TYPE.
+
generic
-- Parameters of the object to be created.
type Params_Type (<>) is private;
@@ -62,6 +71,10 @@ package Dyn_Maps is
procedure Get_Index
(Inst : in out Instance; Params : Params_Type; Idx : out Index_Type);
+ -- Return No_Index if not found.
+ function Get_Index_Soft (Inst : Instance; Params : Params_Type)
+ return Index_Type;
+
-- Get the number of elements in the table.
function Last_Index (Inst : Instance) return Index_Type;