@@ -94,6 +94,7 @@ module stdlib_hashmaps
94
94
procedure , non_overridable, pass(map) :: map_probes
95
95
procedure , non_overridable, pass(map) :: num_slots
96
96
procedure , non_overridable, pass(map) :: slots_bits
97
+ procedure (get_all_keys), deferred, pass(map) :: get_all_keys
97
98
procedure (get_other), deferred, pass(map) :: get_other_data
98
99
procedure (init_map), deferred, pass(map) :: init
99
100
procedure (key_test), deferred, pass(map) :: key_test
@@ -109,6 +110,21 @@ module stdlib_hashmaps
109
110
110
111
abstract interface
111
112
113
+ subroutine get_all_keys (map , all_keys )
114
+ ! ! Version: Experimental
115
+ ! !
116
+ ! ! Returns the all keys contained in a hash map
117
+ ! ! ([Specifications](../page/specs/stdlib_hashmaps.html#get_all_keys-returns-all-the-keys-contained-in-a-map))
118
+ ! !
119
+ ! ! Arguments:
120
+ ! ! map - a hash map
121
+ ! ! all_keys - all the keys contained in a hash map
122
+ !
123
+ import hashmap_type, key_type
124
+ class(hashmap_type), intent (in ) :: map
125
+ type (key_type), allocatable , intent (out ) :: all_keys(:)
126
+ end subroutine get_all_keys
127
+
112
128
subroutine get_other ( map , key , other , exists )
113
129
! ! Version: Experimental
114
130
! !
@@ -319,6 +335,7 @@ end function total_depth
319
335
type (chaining_map_entry_ptr), allocatable :: slots(:)
320
336
! ! Array of bucket lists Note # slots=size(slots)
321
337
contains
338
+ procedure :: get_all_keys = > get_all_chaining_keys
322
339
procedure :: get_other_data = > get_other_chaining_data
323
340
procedure :: init = > init_chaining_map
324
341
procedure :: loading = > chaining_loading
@@ -345,6 +362,19 @@ module subroutine free_chaining_map( map )
345
362
end subroutine free_chaining_map
346
363
347
364
365
+ module subroutine get_all_chaining_keys (map , all_keys )
366
+ ! ! Version: Experimental
367
+ ! !
368
+ ! ! Returns all the keys contained in a hashmap
369
+ ! ! Arguments:
370
+ ! ! map - an chaining hash map
371
+ ! ! all_keys - all the keys contained in a hash map
372
+ !
373
+ class(chaining_hashmap_type), intent (in ) :: map
374
+ type (key_type), allocatable , intent (out ) :: all_keys(:)
375
+ end subroutine get_all_chaining_keys
376
+
377
+
348
378
module subroutine get_other_chaining_data ( map , key , other , exists )
349
379
! ! Version: Experimental
350
380
! !
@@ -556,6 +586,7 @@ end function total_chaining_depth
556
586
integer (int_index), allocatable :: slots(:)
557
587
! ! Array of indices to the inverse Note # slots=size(slots)
558
588
contains
589
+ procedure :: get_all_keys = > get_all_open_keys
559
590
procedure :: get_other_data = > get_other_open_data
560
591
procedure :: init = > init_open_map
561
592
procedure :: loading = > open_loading
@@ -581,6 +612,19 @@ module subroutine free_open_map( map )
581
612
end subroutine free_open_map
582
613
583
614
615
+ module subroutine get_all_open_keys (map , all_keys )
616
+ ! ! Version: Experimental
617
+ ! !
618
+ ! ! Returns all the keys contained in a hashmap
619
+ ! ! Arguments:
620
+ ! ! map - an open hash map
621
+ ! ! all_keys - all the keys contained in a hash map
622
+ !
623
+ class(open_hashmap_type), intent (in ) :: map
624
+ type (key_type), allocatable , intent (out ) :: all_keys(:)
625
+ end subroutine get_all_open_keys
626
+
627
+
584
628
module subroutine get_other_open_data ( map , key , other , exists )
585
629
! ! Version: Experimental
586
630
! !
0 commit comments