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