00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef ACE_HASH_MAP_MANAGER_T_H
00014 #define ACE_HASH_MAP_MANAGER_T_H
00015 #include "ace/pre.h"
00016
00017 #include "ace/config-all.h"
00018
00019 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00020 # pragma once
00021 #endif
00022
00023 #include "ace/Default_Constants.h"
00024 #include "ace/Functor_T.h"
00025 #include "ace/Log_Msg.h"
00026 #include <iterator>
00027
00028 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00029
00030
00031
00032
00033
00034
00035 template <class EXT_ID, class INT_ID>
00036 class ACE_Hash_Map_Entry
00037 {
00038 public:
00039
00040
00041 ACE_Hash_Map_Entry (const EXT_ID &ext_id,
00042 const INT_ID &int_id,
00043 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *next = 0,
00044 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *prev = 0);
00045
00046
00047 ACE_Hash_Map_Entry (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *next,
00048 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *prev);
00049
00050
00051 ~ACE_Hash_Map_Entry (void);
00052
00053
00054 EXT_ID& key (void);
00055
00056
00057 const EXT_ID& key (void) const;
00058
00059
00060 INT_ID& item (void);
00061
00062
00063 const INT_ID& item (void) const;
00064
00065
00066
00067 EXT_ID ext_id_;
00068
00069
00070
00071 INT_ID int_id_;
00072
00073
00074 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *next_;
00075
00076
00077 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *prev_;
00078
00079
00080 void dump (void) const;
00081 };
00082
00083
00084 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00085 class ACE_Hash_Map_Iterator_Base_Ex;
00086
00087
00088 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00089 class ACE_Hash_Map_Const_Iterator_Base_Ex;
00090
00091
00092 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00093 class ACE_Hash_Map_Iterator_Ex;
00094
00095
00096 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00097 class ACE_Hash_Map_Const_Iterator_Ex;
00098
00099
00100 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00101 class ACE_Hash_Map_Reverse_Iterator_Ex;
00102
00103
00104 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00105 class ACE_Hash_Map_Const_Reverse_Iterator_Ex;
00106
00107
00108 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00109 class ACE_Hash_Map_Bucket_Iterator;
00110
00111
00112 class ACE_Allocator;
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00129 class ACE_Hash_Map_Manager_Ex
00130 {
00131 public:
00132 friend class ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>;
00133 friend class ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>;
00134 friend class ACE_Hash_Map_Const_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>;
00135 friend class ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>;
00136 friend class ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>;
00137 friend class ACE_Hash_Map_Const_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>;
00138 friend class ACE_Hash_Map_Bucket_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>;
00139
00140 typedef EXT_ID
00141 KEY;
00142 typedef INT_ID
00143 VALUE;
00144 typedef ACE_LOCK lock_type;
00145 typedef ACE_Hash_Map_Entry<EXT_ID, INT_ID>
00146 ENTRY;
00147
00148
00149 typedef ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>
00150 ITERATOR;
00151 typedef ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>
00152 CONST_ITERATOR;
00153 typedef ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>
00154 REVERSE_ITERATOR;
00155 typedef ACE_Hash_Map_Const_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>
00156 CONST_REVERSE_ITERATOR;
00157
00158
00159 typedef ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>
00160 iterator;
00161 typedef ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>
00162 const_iterator;
00163 typedef ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>
00164 reverse_iterator;
00165 typedef ACE_Hash_Map_Const_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>
00166 const_reverse_iterator;
00167
00168
00169 typedef EXT_ID key_type;
00170 typedef INT_ID data_type;
00171 typedef ACE_Hash_Map_Entry<EXT_ID, INT_ID> value_type;
00172 typedef value_type & reference;
00173 typedef value_type const & const_reference;
00174 typedef value_type * pointer;
00175 typedef value_type const * const_pointer;
00176 typedef ptrdiff_t difference_type;
00177 typedef size_t size_type;
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193 ACE_Hash_Map_Manager_Ex (ACE_Allocator *table_alloc = 0,
00194 ACE_Allocator *entry_alloc = 0);
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208 ACE_Hash_Map_Manager_Ex (size_t size,
00209 ACE_Allocator *table_alloc = 0,
00210 ACE_Allocator *entry_alloc = 0);
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225 int open (size_t size = ACE_DEFAULT_MAP_SIZE,
00226 ACE_Allocator *table_alloc = 0,
00227 ACE_Allocator *entry_alloc = 0);
00228
00229
00230
00231 int close (void);
00232
00233
00234 int unbind_all (void);
00235
00236
00237 ~ACE_Hash_Map_Manager_Ex (void);
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247 int bind (const EXT_ID &item,
00248 const INT_ID &int_id);
00249
00250
00251
00252
00253
00254
00255 int bind (const EXT_ID &ext_id,
00256 const INT_ID &int_id,
00257 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry);
00258
00259
00260
00261
00262
00263
00264
00265
00266 int trybind (const EXT_ID &ext_id,
00267 INT_ID &int_id);
00268
00269
00270
00271
00272
00273
00274 int trybind (const EXT_ID &ext_id,
00275 INT_ID &int_id,
00276 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry);
00277
00278
00279
00280
00281
00282
00283
00284 int rebind (const EXT_ID &ext_id,
00285 const INT_ID &int_id);
00286
00287
00288
00289
00290
00291
00292 int rebind (const EXT_ID &ext_id,
00293 const INT_ID &int_id,
00294 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry);
00295
00296
00297
00298
00299
00300
00301
00302
00303 int rebind (const EXT_ID &ext_id,
00304 const INT_ID &int_id,
00305 INT_ID &old_int_id);
00306
00307
00308
00309
00310
00311
00312 int rebind (const EXT_ID &ext_id,
00313 const INT_ID &int_id,
00314 INT_ID &old_int_id,
00315 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry);
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327 int rebind (const EXT_ID &ext_id,
00328 const INT_ID &int_id,
00329 EXT_ID &old_ext_id,
00330 INT_ID &old_int_id);
00331
00332
00333
00334
00335
00336
00337 int rebind (const EXT_ID &ext_id,
00338 const INT_ID &int_id,
00339 EXT_ID &old_ext_id,
00340 INT_ID &old_int_id,
00341 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry);
00342
00343
00344
00345 int find (const EXT_ID &ext_id,
00346 INT_ID &int_id) const;
00347
00348
00349 int find (const EXT_ID &ext_id) const;
00350
00351
00352
00353 int find (const EXT_ID &ext_id,
00354 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry) const;
00355
00356
00357
00358
00359
00360
00361 void find (EXT_ID const & ext_id, iterator & pos) const;
00362
00363
00364
00365
00366
00367
00368 int unbind (const EXT_ID &ext_id);
00369
00370
00371
00372
00373 int unbind (const EXT_ID &ext_id,
00374 INT_ID &int_id);
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384 int unbind (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *entry);
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394 int unbind (iterator pos);
00395
00396
00397
00398 size_t current_size (void) const;
00399
00400
00401
00402 size_t total_size (void) const;
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412 ACE_LOCK &mutex (void);
00413
00414
00415 void dump (void) const;
00416
00417
00418
00419
00420 iterator begin (void);
00421 iterator end (void);
00422 const_iterator begin (void) const;
00423 const_iterator end (void) const;
00424
00425
00426 reverse_iterator rbegin (void);
00427 reverse_iterator rend (void);
00428 const_reverse_iterator rbegin (void) const;
00429 const_reverse_iterator rend (void) const;
00430
00431 protected:
00432
00433
00434
00435
00436 int equal (const EXT_ID &id1, const EXT_ID &id2);
00437
00438
00439
00440 u_long hash (const EXT_ID &ext_id);
00441
00442
00443
00444
00445 int bind_i (const EXT_ID &ext_id,
00446 const INT_ID &int_id);
00447
00448
00449 int bind_i (const EXT_ID &ext_id,
00450 const INT_ID &int_id,
00451 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry);
00452
00453
00454 int trybind_i (const EXT_ID &ext_id,
00455 INT_ID &int_id);
00456
00457
00458 int trybind_i (const EXT_ID &ext_id,
00459 INT_ID &int_id,
00460 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry);
00461
00462
00463 int rebind_i (const EXT_ID &ext_id,
00464 const INT_ID &int_id);
00465
00466
00467 int rebind_i (const EXT_ID &ext_id,
00468 const INT_ID &int_id,
00469 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry);
00470
00471
00472 int rebind_i (const EXT_ID &ext_id,
00473 const INT_ID &int_id,
00474 INT_ID &old_int_id);
00475
00476
00477 int rebind_i (const EXT_ID &ext_id,
00478 const INT_ID &int_id,
00479 INT_ID &old_int_id,
00480 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry);
00481
00482
00483 int rebind_i (const EXT_ID &ext_id,
00484 const INT_ID &int_id,
00485 EXT_ID &old_ext_id,
00486 INT_ID &old_int_id);
00487
00488
00489 int rebind_i (const EXT_ID &ext_id,
00490 const INT_ID &int_id,
00491 EXT_ID &old_ext_id,
00492 INT_ID &old_int_id,
00493 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry);
00494
00495
00496
00497 int find_i (const EXT_ID &ext_id,
00498 INT_ID &int_id);
00499
00500
00501
00502 int find_i (const EXT_ID &ext_id);
00503
00504
00505
00506 int find_i (const EXT_ID &ext_id,
00507 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry);
00508
00509
00510 int unbind_i (const EXT_ID &ext_id,
00511 INT_ID &int_id);
00512
00513
00514 int unbind_i (const EXT_ID &ext_id);
00515
00516
00517 int unbind_i (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *entry);
00518
00519
00520
00521
00522
00523
00524 int create_buckets (size_t size);
00525
00526
00527
00528 int close_i (void);
00529
00530
00531
00532 int unbind_all_i (void);
00533
00534
00535
00536 ACE_Allocator *table_allocator_;
00537
00538
00539
00540
00541 ACE_Allocator *entry_allocator_;
00542
00543
00544
00545 mutable ACE_LOCK lock_;
00546
00547
00548 HASH_KEY hash_key_;
00549
00550
00551 COMPARE_KEYS compare_keys_;
00552
00553 protected:
00554
00555 int shared_find (const EXT_ID &ext_id,
00556 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry,
00557 size_t &loc);
00558
00559
00560 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *table (void);
00561
00562 private:
00563
00564
00565
00566
00567
00568 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *table_;
00569
00570
00571 size_t total_size_;
00572
00573
00574
00575
00576 size_t cur_size_;
00577
00578
00579 ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &))
00580 ACE_UNIMPLEMENTED_FUNC (ACE_Hash_Map_Manager_Ex (const ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &))
00581 };
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00592 class ACE_Hash_Map_Iterator_Base_Ex
00593 {
00594 public:
00595
00596 typedef ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>
00597 container_type;
00598
00599
00600 typedef typename container_type::value_type value_type;
00601 typedef typename container_type::reference reference;
00602 typedef typename container_type::pointer pointer;
00603 typedef typename container_type::difference_type difference_type;
00604
00605
00606
00607
00608
00609
00610
00611
00612 ACE_Hash_Map_Iterator_Base_Ex (
00613 ACE_Hash_Map_Manager_Ex<EXT_ID,
00614 INT_ID,
00615 HASH_KEY,
00616 COMPARE_KEYS,
00617 ACE_LOCK> &mm,
00618 bool head);
00619
00620
00621
00622
00623
00624 ACE_Hash_Map_Iterator_Base_Ex (
00625 ACE_Hash_Map_Manager_Ex<EXT_ID,
00626 INT_ID,
00627 HASH_KEY,
00628 COMPARE_KEYS,
00629 ACE_LOCK> & mm,
00630 ACE_Hash_Map_Entry<EXT_ID, INT_ID> * entry,
00631 size_t index);
00632
00633
00634
00635
00636
00637 int next (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&next_entry) const;
00638
00639
00640 int done (void) const;
00641
00642
00643 ACE_Hash_Map_Entry<EXT_ID, INT_ID>& operator* (void) const;
00644
00645
00646 ACE_Hash_Map_Entry<EXT_ID, INT_ID>* operator-> (void) const;
00647
00648
00649
00650 ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>& map (void);
00651
00652
00653 bool operator== (const ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &) const;
00654 bool operator!= (const ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &) const;
00655
00656
00657 ACE_ALLOC_HOOK_DECLARE;
00658
00659 protected:
00660
00661
00662 int forward_i (void);
00663
00664
00665
00666 int reverse_i (void);
00667
00668
00669 void dump_i (void) const;
00670
00671
00672 ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *map_man_;
00673
00674
00675 ssize_t index_;
00676
00677
00678
00679 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *next_;
00680 };
00681
00682
00683
00684
00685
00686
00687
00688
00689
00690 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00691 class ACE_Hash_Map_Const_Iterator_Base_Ex
00692 {
00693 public:
00694
00695 typedef ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>
00696 container_type;
00697
00698
00699 typedef typename container_type::value_type value_type;
00700 typedef typename container_type::const_reference reference;
00701 typedef typename container_type::const_pointer pointer;
00702 typedef typename container_type::difference_type difference_type;
00703
00704
00705
00706
00707 ACE_Hash_Map_Const_Iterator_Base_Ex (const ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &mm,
00708 bool head);
00709
00710
00711
00712
00713
00714 int next (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&next_entry) const;
00715
00716
00717 int done (void) const;
00718
00719
00720 ACE_Hash_Map_Entry<EXT_ID, INT_ID>& operator* (void) const;
00721
00722
00723 ACE_Hash_Map_Entry<EXT_ID, INT_ID>* operator-> (void) const;
00724
00725
00726
00727 const ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>& map (void);
00728
00729
00730 bool operator== (const ACE_Hash_Map_Const_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &) const;
00731 bool operator!= (const ACE_Hash_Map_Const_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &) const;
00732
00733
00734 ACE_ALLOC_HOOK_DECLARE;
00735
00736 protected:
00737
00738
00739 int forward_i (void);
00740
00741
00742
00743 int reverse_i (void);
00744
00745
00746 void dump_i (void) const;
00747
00748
00749 const ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *map_man_;
00750
00751
00752 ssize_t index_;
00753
00754
00755
00756 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *next_;
00757 };
00758
00759
00760
00761
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00772 class ACE_Hash_Map_Iterator_Ex : public ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>
00773 {
00774 public:
00775
00776 typedef typename ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::container_type
00777 container_type;
00778
00779
00780 typedef std::bidirectional_iterator_tag iterator_category;
00781 typedef typename container_type::value_type value_type;
00782 typedef typename container_type::reference reference;
00783 typedef typename container_type::pointer pointer;
00784 typedef typename container_type::difference_type difference_type;
00785
00786
00787 ACE_Hash_Map_Iterator_Ex (ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &mm,
00788 int tail = 0);
00789
00790
00791
00792
00793
00794 ACE_Hash_Map_Iterator_Ex (
00795 ACE_Hash_Map_Manager_Ex<EXT_ID,
00796 INT_ID,
00797 HASH_KEY,
00798 COMPARE_KEYS,
00799 ACE_LOCK> & mm,
00800 ACE_Hash_Map_Entry<EXT_ID, INT_ID> * entry,
00801 size_t index);
00802
00803
00804
00805
00806 int advance (void);
00807
00808
00809 void dump (void) const;
00810
00811
00812
00813
00814 ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &operator++ (void);
00815
00816
00817 ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> operator++ (int);
00818
00819
00820 ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &operator-- (void);
00821
00822
00823 ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> operator-- (int);
00824
00825
00826 ACE_ALLOC_HOOK_DECLARE;
00827 };
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00842 class ACE_Hash_Map_Const_Iterator_Ex : public ACE_Hash_Map_Const_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>
00843 {
00844 public:
00845
00846 typedef typename ACE_Hash_Map_Const_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::container_type
00847 container_type;
00848
00849
00850 typedef std::bidirectional_iterator_tag iterator_category;
00851 typedef typename container_type::value_type value_type;
00852 typedef typename container_type::reference reference;
00853 typedef typename container_type::pointer pointer;
00854 typedef typename container_type::difference_type difference_type;
00855
00856
00857 ACE_Hash_Map_Const_Iterator_Ex (const ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &mm,
00858 int tail = 0);
00859
00860
00861
00862
00863 int advance (void);
00864
00865
00866 void dump (void) const;
00867
00868
00869
00870
00871 ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &operator++ (void);
00872
00873
00874 ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> operator++ (int);
00875
00876
00877 ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &operator-- (void);
00878
00879
00880 ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> operator-- (int);
00881
00882
00883 ACE_ALLOC_HOOK_DECLARE;
00884 };
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894
00895
00896
00897
00898
00899
00900
00901
00902
00903
00904
00905 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00906 class ACE_Hash_Map_Bucket_Iterator
00907 {
00908 public:
00909
00910 typedef ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>
00911 container_type;
00912
00913
00914 typedef std::bidirectional_iterator_tag iterator_category;
00915 typedef typename container_type::value_type value_type;
00916 typedef typename container_type::reference reference;
00917 typedef typename container_type::pointer pointer;
00918 typedef typename container_type::difference_type difference_type;
00919
00920
00921 ACE_Hash_Map_Bucket_Iterator (ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &mm,
00922 const EXT_ID &ext_id,
00923 int tail = 0);
00924
00925
00926
00927
00928 ACE_Hash_Map_Bucket_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &operator++ (void);
00929
00930
00931 ACE_Hash_Map_Bucket_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> operator++ (int);
00932
00933
00934 ACE_Hash_Map_Bucket_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &operator-- (void);
00935
00936
00937 ACE_Hash_Map_Bucket_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> operator-- (int);
00938
00939
00940 ACE_Hash_Map_Entry<EXT_ID, INT_ID>& operator* (void) const;
00941
00942
00943 ACE_Hash_Map_Entry<EXT_ID, INT_ID>* operator-> (void) const;
00944
00945
00946
00947 ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>& map (void);
00948
00949
00950 bool operator== (const ACE_Hash_Map_Bucket_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &) const;
00951 bool operator!= (const ACE_Hash_Map_Bucket_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &) const;
00952
00953 protected:
00954
00955
00956 int forward_i (void);
00957
00958
00959
00960 int reverse_i (void);
00961
00962
00963 ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *map_man_;
00964
00965
00966 ssize_t index_;
00967
00968
00969
00970 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *next_;
00971 };
00972
00973
00974
00975
00976
00977
00978
00979
00980
00981
00982
00983
00984
00985 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00986 class ACE_Hash_Map_Reverse_Iterator_Ex : public ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>
00987 {
00988 public:
00989
00990 typedef typename ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::container_type
00991 container_type;
00992
00993
00994 typedef std::bidirectional_iterator_tag iterator_category;
00995 typedef typename container_type::value_type value_type;
00996 typedef typename container_type::reference reference;
00997 typedef typename container_type::pointer pointer;
00998 typedef typename container_type::difference_type difference_type;
00999
01000
01001 ACE_Hash_Map_Reverse_Iterator_Ex (ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &mm,
01002 bool head = false);
01003
01004
01005
01006
01007 int advance (void);
01008
01009
01010 void dump (void) const;
01011
01012
01013
01014
01015 ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &operator++ (void);
01016
01017
01018 ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> operator++ (int);
01019
01020
01021 ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &operator-- (void);
01022
01023
01024 ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> operator-- (int);
01025
01026
01027 ACE_ALLOC_HOOK_DECLARE;
01028 };
01029
01030
01031
01032
01033
01034
01035
01036
01037
01038
01039
01040
01041
01042 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
01043 class ACE_Hash_Map_Const_Reverse_Iterator_Ex : public ACE_Hash_Map_Const_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>
01044 {
01045 public:
01046
01047 typedef typename ACE_Hash_Map_Const_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>::container_type
01048 container_type;
01049
01050
01051 typedef std::bidirectional_iterator_tag iterator_category;
01052 typedef typename container_type::value_type value_type;
01053 typedef typename container_type::reference reference;
01054 typedef typename container_type::pointer pointer;
01055 typedef typename container_type::difference_type difference_type;
01056
01057
01058 ACE_Hash_Map_Const_Reverse_Iterator_Ex (const ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &mm,
01059 bool head = false);
01060
01061
01062
01063
01064 int advance (void);
01065
01066
01067 void dump (void) const;
01068
01069
01070
01071
01072 ACE_Hash_Map_Const_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &operator++ (void);
01073
01074
01075 ACE_Hash_Map_Const_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> operator++ (int);
01076
01077
01078 ACE_Hash_Map_Const_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &operator-- (void);
01079
01080
01081 ACE_Hash_Map_Const_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> operator-- (int);
01082
01083
01084 ACE_ALLOC_HOOK_DECLARE;
01085 };
01086
01087
01088
01089
01090
01091
01092
01093
01094
01095
01096
01097
01098
01099
01100
01101
01102
01103
01104
01105
01106
01107
01108
01109
01110
01111
01112
01113
01114
01115
01116
01117
01118
01119
01120
01121
01122
01123
01124
01125
01126
01127 template <class EXT_ID, class INT_ID, class ACE_LOCK>
01128 class ACE_Hash_Map_Manager : public ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK>
01129 {
01130 public:
01131
01132
01133
01134
01135
01136
01137
01138
01139
01140
01141
01142
01143 ACE_Hash_Map_Manager (ACE_Allocator *table_alloc = 0,
01144 ACE_Allocator *entry_alloc = 0);
01145
01146
01147
01148
01149
01150
01151
01152
01153
01154
01155
01156
01157 ACE_Hash_Map_Manager (size_t size,
01158 ACE_Allocator *table_alloc = 0,
01159 ACE_Allocator *entry_alloc = 0);
01160
01161
01162
01163 int equal (const EXT_ID &id1, const EXT_ID &id2);
01164 u_long hash (const EXT_ID &ext_id);
01165 };
01166
01167
01168
01169
01170
01171
01172 template <class EXT_ID, class INT_ID, class ACE_LOCK>
01173 class ACE_Hash_Map_Iterator : public ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK>
01174 {
01175 public:
01176
01177 typedef typename ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK>::container_type
01178 container_type;
01179
01180 typedef typename ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK>::iterator_category
01181 iterator_category;
01182
01183 typedef typename ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK>::value_type
01184 value_type;
01185
01186 typedef typename ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK>::reference
01187 reference;
01188
01189 typedef typename ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK>::pointer
01190 pointer;
01191
01192 typedef typename ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK>::difference_type
01193 difference_type;
01194
01195
01196
01197 ACE_Hash_Map_Iterator (ACE_Hash_Map_Manager<EXT_ID, INT_ID, ACE_LOCK> &mm,
01198 int tail = 0);
01199
01200
01201 ACE_Hash_Map_Iterator (const ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK> &base);
01202
01203
01204 ACE_Hash_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> &
01205 operator= (const ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK> &base);
01206 };
01207
01208
01209
01210
01211
01212
01213 template <class EXT_ID, class INT_ID, class ACE_LOCK>
01214 class ACE_Hash_Map_Const_Iterator : public ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK>
01215 {
01216 public:
01217
01218 typedef typename ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK>::container_type
01219 container_type;
01220
01221
01222 typedef typename ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK>::iterator_category
01223 iterator_category;
01224
01225 typedef typename ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK>::value_type
01226 value_type;
01227
01228 typedef typename ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK>::reference
01229 reference;
01230
01231 typedef typename ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK>::pointer
01232 pointer;
01233
01234 typedef typename ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK>::difference_type
01235 difference_type;
01236
01237
01238
01239 ACE_Hash_Map_Const_Iterator (const ACE_Hash_Map_Manager<EXT_ID, INT_ID, ACE_LOCK> &mm,
01240 int tail = 0);
01241
01242
01243 ACE_Hash_Map_Const_Iterator (const ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK> &base);
01244
01245
01246 ACE_Hash_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK> &
01247 operator= (const ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK> &base);
01248 };
01249
01250
01251
01252
01253
01254
01255 template <class EXT_ID, class INT_ID, class ACE_LOCK>
01256 class ACE_Hash_Map_Reverse_Iterator : public ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK>
01257 {
01258 public:
01259
01260 typedef typename ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK>::container_type
01261 container_type;
01262
01263
01264 typedef typename ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK>::iterator_category
01265 iterator_category;
01266
01267 typedef typename ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK>::value_type
01268 value_type;
01269
01270 typedef typename ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK>::reference
01271 reference;
01272
01273 typedef typename ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK>::pointer
01274 pointer;
01275
01276 typedef typename ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK>::difference_type
01277 difference_type;
01278
01279
01280 ACE_Hash_Map_Reverse_Iterator (ACE_Hash_Map_Manager<EXT_ID, INT_ID, ACE_LOCK> &mm,
01281 bool head = false);
01282
01283
01284 ACE_Hash_Map_Reverse_Iterator (const ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK> &base);
01285
01286
01287 ACE_Hash_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> &
01288 operator= (const ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK> &base);
01289 };
01290
01291 ACE_END_VERSIONED_NAMESPACE_DECL
01292
01293 #if defined (__ACE_INLINE__)
01294 # include "ace/Hash_Map_Manager_T.inl"
01295 #endif
01296
01297 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
01298 #include "ace/Hash_Map_Manager_T.cpp"
01299 #endif
01300
01301 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
01302 #pragma implementation ("Hash_Map_Manager_T.cpp")
01303 #endif
01304
01305 #include "ace/post.h"
01306 #endif