@@ -890,7 +890,10 @@ It also defines five non-overridable procedures:
890
890
* ` num_slots ` - returns the number of slots in the map; and
891
891
892
892
* ` slots_bits ` - returns the number of bits used to address the slots;
893
- and eleven deferred procedures:
893
+
894
+ and ten deferred procedures:
895
+
896
+ * ` get_all_keys ` - gets all the keys presented in a map;
894
897
895
898
* ` get_other_data ` - gets the other map data associated with the key;
896
899
@@ -932,6 +935,7 @@ The type's definition is below:
932
935
procedure, non_overridable, pass(map) :: map_probes
933
936
procedure, non_overridable, pass(map) :: slots_bits
934
937
procedure, non_overridable, pass(map) :: num_slots
938
+ procedure(get_all_keys), deferred, pass(map) :: get_all_keys
935
939
procedure(get_other), deferred, pass(map) :: get_other_data
936
940
procedure(init_map), deferred, pass(map) :: init
937
941
procedure(key_test), deferred, pass(map) :: key_test
@@ -1026,6 +1030,7 @@ as follows:
1026
1030
type(chaining_map_entry_ptr), allocatable :: inverse(:)
1027
1031
type(chaining_map_entry_ptr), allocatable :: slots(:)
1028
1032
contains
1033
+ procedure :: get_all_keys => get_all_chaining_keys
1029
1034
procedure :: get_other_data => get_other_chaining_data
1030
1035
procedure :: init => init_chaining_map
1031
1036
procedure :: key => chaining_key_test
@@ -1103,6 +1108,7 @@ as follows:
1103
1108
type(open_map_entry_ptr), allocatable :: inverse(:)
1104
1109
integer(int_index), allocatable :: slots(:)
1105
1110
contains
1111
+ procedure :: get_all_keys => get_all_open_keys
1106
1112
procedure :: get_other_data => get_other_open_data
1107
1113
procedure :: init => init_open_map
1108
1114
procedure :: key_test => open_key_test
@@ -1148,6 +1154,9 @@ Procedures to modify the content of a map:
1148
1154
1149
1155
Procedures to report the content of a map:
1150
1156
1157
+ * ` map % get_all_keys( all_keys ) ` - Returns all the keys
1158
+ presented in the map;
1159
+
1151
1160
* ` map % get_other_data( key, other, exists ) ` - Returns the other data
1152
1161
associated with the ` key ` ;
1153
1162
@@ -1251,6 +1260,41 @@ The result will be the number of entries in the hash map.
1251
1260
```
1252
1261
1253
1262
1263
+ #### ` get_all_keys ` - Returns all the keys presented in a map
1264
+
1265
+ ##### Status
1266
+
1267
+ Experimental
1268
+
1269
+ ##### Description
1270
+
1271
+ Returns all the keys presented in a map.
1272
+
1273
+ ##### Syntax
1274
+
1275
+ ` call map % [[hashmap_type(type):get_all_keys(bound)]]( all_keys ) `
1276
+
1277
+ ##### Class
1278
+
1279
+ Subroutine
1280
+
1281
+ ##### Arguments
1282
+
1283
+ ` map ` (pass): shall be a scalar variable of class
1284
+ ` chaining_hashmap_type ` or ` open_hashmap_type ` . It is an
1285
+ ` intent(in) ` argument. It will be
1286
+ the hash map used to store and access the other data.
1287
+
1288
+ ` all_keys ` : shall be a rank-1 allocatable array of type ` key_type ` .
1289
+ It is an ` intent(out) ` argument.
1290
+
1291
+ ##### Example
1292
+
1293
+ ``` fortran
1294
+ {!example/hashmaps/example_hashmaps_get_all_keys.f90!}
1295
+ ```
1296
+
1297
+
1254
1298
#### ` get_other_data ` - Returns other data associated with the ` key `
1255
1299
1256
1300
##### Status
0 commit comments