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