Hash_Map_Manager_T.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Hash_Map_Manager_T.h
00006  *
00007  *  Hash_Map_Manager_T.h,v 4.51 2006/06/09 14:09:14 schmidt Exp
00008  *
00009  *  @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
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 /* ACE_LACKS_PRAGMA_ONCE */
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  * @class ACE_Hash_Map_Entry
00031  *
00032  * @brief Define an entry in the hash table.
00033  */
00034 template <class EXT_ID, class INT_ID>
00035 class ACE_Hash_Map_Entry
00036 {
00037 public:
00038   // = Initialization and termination methods.
00039   /// Constructor.
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   /// Constructor.
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   # if ! defined (ACE_HAS_BROKEN_NOOP_DTORS)
00050   /// Destructor.
00051   ~ACE_Hash_Map_Entry (void);
00052   #endif /* ! defined (ACE_HAS_BROKEN_NOOP_DTORS) */
00053 
00054   /// Key accessor.
00055   EXT_ID& key (void);
00056 
00057   /// Item accessor.
00058   INT_ID& item (void);
00059 
00060   /// Key used to look up an entry.
00061   /// @deprecated Use key()
00062   EXT_ID ext_id_;
00063 
00064   /// The contents of the entry itself.
00065   /// @deprecated Use item()
00066   INT_ID int_id_;
00067 
00068   /// Pointer to the next item in the bucket of overflow nodes.
00069   ACE_Hash_Map_Entry<EXT_ID, INT_ID> *next_;
00070 
00071   /// Pointer to the prev item in the bucket of overflow nodes.
00072   ACE_Hash_Map_Entry<EXT_ID, INT_ID> *prev_;
00073 
00074   /// Dump the state of an object.
00075   void dump (void) const;
00076 };
00077 
00078 // Forward decl.
00079 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00080 class ACE_Hash_Map_Iterator_Base_Ex;
00081 
00082 // Forward decl.
00083 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00084 class ACE_Hash_Map_Const_Iterator_Base_Ex;
00085 
00086 // Forward decl.
00087 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00088 class ACE_Hash_Map_Iterator_Ex;
00089 
00090 // Forward decl.
00091 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00092 class ACE_Hash_Map_Const_Iterator_Ex;
00093 
00094 // Forward decl.
00095 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00096 class ACE_Hash_Map_Reverse_Iterator_Ex;
00097 
00098 // Forward decl.
00099 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00100 class ACE_Hash_Map_Bucket_Iterator;
00101 
00102 // Forward decl.
00103 class ACE_Allocator;
00104 
00105 /**
00106  * @class ACE_Hash_Map_Manager_Ex
00107  *
00108  * @brief Define a map abstraction that efficiently associates
00109  * <EXT_ID>s with <INT_ID>s.
00110  *
00111  * This implementation of a map uses a hash table.  Key hashing
00112  * is achieved through the HASH_KEY object and key comparison is
00113  * achieved through the COMPARE_KEYS object.
00114  * This class uses an ACE_Allocator to allocate memory.  The
00115  * user can make this a persistent class by providing an
00116  * ACE_Allocator with a persistable memory pool.
00117  */
00118 
00119 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00120 class ACE_Hash_Map_Manager_Ex
00121 {
00122 public:
00123   friend class ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>;
00124   friend class ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>;
00125   friend class ACE_Hash_Map_Const_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>;
00126   friend class ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>;
00127   friend class ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>;
00128   friend class ACE_Hash_Map_Bucket_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>;
00129 
00130   typedef EXT_ID
00131           KEY;
00132   typedef INT_ID
00133           VALUE;
00134   typedef ACE_LOCK lock_type;
00135   typedef ACE_Hash_Map_Entry<EXT_ID, INT_ID>
00136           ENTRY;
00137 
00138   // = ACE-style iterator typedefs.
00139   typedef ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>
00140           ITERATOR;
00141   typedef ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>
00142           CONST_ITERATOR;
00143   typedef ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>
00144           REVERSE_ITERATOR;
00145 
00146   // = STL-style iterator typedefs.
00147   typedef ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>
00148           iterator;
00149   typedef ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>
00150           const_iterator;
00151   typedef ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>
00152           reverse_iterator;
00153 
00154   // = Initialization and termination methods.
00155 
00156   /** 
00157    * Initialize a @c Hash_Map_Manager_Ex with default size elements.
00158    * @param table_alloc is a pointer to a memory allocator used for
00159    *        table_, so it should supply size*sizeof (ACE_Hash_Map_Entry<EXT_ID, INT_ID>).
00160    * @param entry_alloc is a pointer to an additional allocator for
00161    *        entries, so it should be able to allocate 'size' / chunks
00162    *        of sizeof(ACE_Hash_Map_Entry<EXT_ID, INT_ID>) bytes each.
00163    * If @c table_alloc is 0 it defaults to @c ACE_Allocator::instance().
00164    * If @c entry_alloc is 0 then it defaults to the same allocator as
00165    * @c table_alloc.
00166    */
00167   ACE_Hash_Map_Manager_Ex (ACE_Allocator *table_alloc = 0,
00168                            ACE_Allocator *entry_alloc = 0);
00169 
00170   /** 
00171    * Initialize a @c Hash_Map_Manager_Ex with @c size elements.
00172    * @param table_alloc is a pointer to a memory allocator used for
00173    *        table_, so it should supply size*sizeof (ACE_Hash_Map_Entry<EXT_ID, INT_ID>).
00174    * @param entry_alloc is a pointer to an additional allocator for
00175    *        entries, so it should be able to allocate 'size' / chunks
00176    *        of sizeof(ACE_Hash_Map_Entry<EXT_ID, INT_ID>) bytes each.
00177    * If @c table_alloc is 0 it defaults to @c ACE_Allocator::instance().
00178    * If @c entry_alloc is 0 then it defaults to the same allocator as
00179    * @c table_alloc.
00180    */
00181   ACE_Hash_Map_Manager_Ex (size_t size,
00182                            ACE_Allocator *table_alloc = 0,
00183                            ACE_Allocator *entry_alloc = 0);
00184 
00185   /** 
00186    * Initialize a @c Hash_Map_Manager_Ex with @c size elements.
00187    * @param table_alloc is a pointer to a memory allocator used for
00188    *        table_, so it should supply size*sizeof (ACE_Hash_Map_Entry<EXT_ID, INT_ID>).
00189    * @param entry_alloc is a pointer to an additional allocator for
00190    *        entries, so it should be able to allocate 'size' / chunks
00191    *        of sizeof(ACE_Hash_Map_Entry<EXT_ID, INT_ID>) bytes each.
00192    * If @c table_alloc is 0 it defaults to @c ACE_Allocator::instance().
00193    * If @c entry_alloc is 0 then it defaults to the same allocator as
00194    * @c table_alloc.
00195    * @return -1 on failure, 0 on success
00196    */
00197 
00198   int open (size_t size = ACE_DEFAULT_MAP_SIZE,
00199             ACE_Allocator *table_alloc = 0,
00200             ACE_Allocator *entry_alloc = 0);
00201 
00202   /// Close down a <Hash_Map_Manager_Ex> and release dynamically allocated
00203   /// resources.
00204   int close (void);
00205 
00206   /// Removes all the entries in <Map_Manager_Ex>.
00207   int unbind_all (void);
00208 
00209   /// Cleanup the <Hash_Map_Manager_Ex>.
00210   ~ACE_Hash_Map_Manager_Ex (void);
00211 
00212   /**
00213    * Associate <ext_id> with <int_id>.  If <ext_id> is already in the
00214    * map then the <ACE_Hash_Map_Entry> is not changed.  Returns 0 if a
00215    * new entry is bound successfully, returns 1 if an attempt is made
00216    * to bind an existing entry, and returns -1 if failures occur.
00217    */
00218   int bind (const EXT_ID &item,
00219             const INT_ID &int_id);
00220 
00221   /**
00222    * Same as a normal bind, except the map entry is also passed back
00223    * to the caller.  The entry in this case will either be the newly
00224    * created entry, or the existing one.
00225    */
00226   int bind (const EXT_ID &ext_id,
00227             const INT_ID &int_id,
00228             ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry);
00229 
00230   /**
00231    * Associate <ext_id> with <int_id> if and only if <ext_id> is not
00232    * in the map.  If <ext_id> is already in the map then the <int_id>
00233    * parameter is assigned the existing value in the map.  Returns 0
00234    * if a new entry is bound successfully, returns 1 if an attempt is
00235    * made to bind an existing entry, and returns -1 if failures occur.
00236    */
00237   int trybind (const EXT_ID &ext_id,
00238                INT_ID &int_id);
00239 
00240   /**
00241    * Same as a normal trybind, except the map entry is also passed
00242    * back to the caller.  The entry in this case will either be the
00243    * newly created entry, or the existing one.
00244    */
00245   int trybind (const EXT_ID &ext_id,
00246                INT_ID &int_id,
00247                ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry);
00248 
00249   /**
00250    * Reassociate <ext_id> with <int_id>.  If <ext_id> is not in the
00251    * map then behaves just like <bind>.  Returns 0 if a new entry is
00252    * bound successfully, returns 1 if an existing entry was rebound,
00253    * and returns -1 if failures occur.
00254    */
00255   int rebind (const EXT_ID &ext_id,
00256               const INT_ID &int_id);
00257 
00258   /**
00259    * Same as a normal rebind, except the map entry is also passed back
00260    * to the caller.  The entry in this case will either be the newly
00261    * created entry, or the existing one.
00262    */
00263   int rebind (const EXT_ID &ext_id,
00264               const INT_ID &int_id,
00265               ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry);
00266 
00267   /**
00268    * Associate <ext_id> with <int_id>.  If <ext_id> is not in the map
00269    * then behaves just like <bind>.  Otherwise, store the old value of
00270    * <int_id> into the "out" parameter and rebind the new parameters.
00271    * Returns 0 if a new entry is bound successfully, returns 1 if an
00272    * existing entry was rebound, and returns -1 if failures occur.
00273    */
00274   int rebind (const EXT_ID &ext_id,
00275               const INT_ID &int_id,
00276               INT_ID &old_int_id);
00277 
00278   /**
00279    * Same as a normal rebind, except the map entry is also passed back
00280    * to the caller.  The entry in this case will either be the newly
00281    * created entry, or the existing one.
00282    */
00283   int rebind (const EXT_ID &ext_id,
00284               const INT_ID &int_id,
00285               INT_ID &old_int_id,
00286               ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry);
00287 
00288   /**
00289    * Associate <ext_id> with <int_id>.  If <ext_id> is not in the map
00290    * then behaves just like <bind>.  Otherwise, store the old values
00291    * of <ext_id> and <int_id> into the "out" parameters and rebind the
00292    * new parameters.  This is very useful if you need to have an
00293    * atomic way of updating <ACE_Hash_Map_Entrys> and you also need
00294    * full control over memory allocation.  Returns 0 if a new entry is
00295    * bound successfully, returns 1 if an existing entry was rebound,
00296    * and returns -1 if failures occur.
00297    */
00298   int rebind (const EXT_ID &ext_id,
00299               const INT_ID &int_id,
00300               EXT_ID &old_ext_id,
00301               INT_ID &old_int_id);
00302 
00303   /**
00304    * Same as a normal rebind, except the map entry is also passed back
00305    * to the caller.  The entry in this case will either be the newly
00306    * created entry, or the existing one.
00307    */
00308   int rebind (const EXT_ID &ext_id,
00309               const INT_ID &int_id,
00310               EXT_ID &old_ext_id,
00311               INT_ID &old_int_id,
00312               ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry);
00313 
00314   /// Locate <ext_id> and pass out parameter via <int_id>.
00315   /// Return 0 if found, returns -1 if not found.
00316   int find (const EXT_ID &ext_id,
00317             INT_ID &int_id) const;
00318 
00319   /// Returns 0 if the <ext_id> is in the mapping, otherwise -1.
00320   int find (const EXT_ID &ext_id) const;
00321 
00322   /// Locate <ext_id> and pass out parameter via <entry>.  If found,
00323   /// return 0, returns -1 if not found.
00324   int find (const EXT_ID &ext_id,
00325             ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry) const;
00326 
00327   /**
00328    * Unbind (remove) the <ext_id> from the map.  Don't return the
00329    * <int_id> to the caller (this is useful for collections where the
00330    * <int_id>s are *not* dynamically allocated...)
00331    */
00332   int unbind (const EXT_ID &ext_id);
00333 
00334   /// Break any association of <ext_id>.  Returns the value of <int_id>
00335   /// in case the caller needs to deallocate memory. Return 0 if the
00336   /// unbind was successfully, and returns -1 if failures occur.
00337   int unbind (const EXT_ID &ext_id,
00338               INT_ID &int_id);
00339 
00340   /// Remove entry from map. Return 0 if the unbind was successfully,
00341   /// and returns -1 if failures occur.
00342   int unbind (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *entry);
00343 
00344   /// Returns the current number of ACE_Hash_Map_Entry objects in the
00345   /// hash table.
00346   size_t current_size (void) const;
00347 
00348   /// Return the size of the array that's used to point to the
00349   /// linked lists of ACE_Hash_Map_Entry objects in the hash table.
00350   size_t total_size (void) const;
00351 
00352   /**
00353    * Returns a reference to the underlying <ACE_LOCK>.  This makes it
00354    * possible to acquire the lock explicitly, which can be useful in
00355    * some cases if you instantiate the ACE_Atomic_Op with an
00356    * ACE_Recursive_Mutex or ACE_Process_Mutex, or if you need to
00357    * guard the state of an iterator.
00358    * @note The right name would be <lock>, but HP/C++ will choke on that!
00359    */
00360   ACE_LOCK &mutex (void);
00361 
00362   /// Dump the state of an object.
00363   void dump (void) const;
00364 
00365   // = STL styled iterator factory functions.
00366 
00367   /// Return forward iterator.
00368   ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> begin (void);
00369   ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> end (void);
00370 
00371   /// Return reverse iterator.
00372   ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> rbegin (void);
00373   ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> rend (void);
00374 
00375 protected:
00376   // = The following methods do the actual work.
00377 
00378   /// Returns 1 if <id1> == <id2>, else 0.  This is defined as a
00379   /// separate method to facilitate template specialization.
00380   int equal (const EXT_ID &id1, const EXT_ID &id2);
00381 
00382   /// Compute the hash value of the <ext_id>.  This is defined as a
00383   /// separate method to facilitate template specialization.
00384   u_long hash (const EXT_ID &ext_id);
00385 
00386   // = These methods assume locks are held by private methods.
00387 
00388   /// Performs bind.  Must be called with locks held.
00389   int bind_i (const EXT_ID &ext_id,
00390               const INT_ID &int_id);
00391 
00392   /// Performs bind.  Must be called with locks held.
00393   int bind_i (const EXT_ID &ext_id,
00394               const INT_ID &int_id,
00395               ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry);
00396 
00397   /// Performs trybind.  Must be called with locks held.
00398   int trybind_i (const EXT_ID &ext_id,
00399                  INT_ID &int_id);
00400 
00401   /// Performs trybind.  Must be called with locks held.
00402   int trybind_i (const EXT_ID &ext_id,
00403                  INT_ID &int_id,
00404                  ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry);
00405 
00406   /// Performs rebind.  Must be called with locks held.
00407   int rebind_i (const EXT_ID &ext_id,
00408                 const INT_ID &int_id);
00409 
00410   /// Performs rebind.  Must be called with locks held.
00411   int rebind_i (const EXT_ID &ext_id,
00412                 const INT_ID &int_id,
00413                 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry);
00414 
00415   /// Performs rebind.  Must be called with locks held.
00416   int rebind_i (const EXT_ID &ext_id,
00417                 const INT_ID &int_id,
00418                 INT_ID &old_int_id);
00419 
00420   /// Performs rebind.  Must be called with locks held.
00421   int rebind_i (const EXT_ID &ext_id,
00422                 const INT_ID &int_id,
00423                 INT_ID &old_int_id,
00424                 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry);
00425 
00426   /// Performs rebind.  Must be called with locks held.
00427   int rebind_i (const EXT_ID &ext_id,
00428                 const INT_ID &int_id,
00429                 EXT_ID &old_ext_id,
00430                 INT_ID &old_int_id);
00431 
00432   /// Performs rebind.  Must be called with locks held.
00433   int rebind_i (const EXT_ID &ext_id,
00434                 const INT_ID &int_id,
00435                 EXT_ID &old_ext_id,
00436                 INT_ID &old_int_id,
00437                 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry);
00438 
00439   /// Performs a find of <int_id> using <ext_id> as the key.  Must be
00440   /// called with locks held.
00441   int find_i (const EXT_ID &ext_id,
00442               INT_ID &int_id);
00443 
00444   /// Performs a find using <ext_id> as the key.  Must be called with
00445   /// locks held.
00446   int find_i (const EXT_ID &ext_id);
00447 
00448   /// Performs a find using <ext_id> as the key.  Must be called with
00449   /// locks held.
00450   int find_i (const EXT_ID &ext_id,
00451               ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry);
00452 
00453   /// Performs unbind.  Must be called with locks held.
00454   int unbind_i (const EXT_ID &ext_id,
00455                 INT_ID &int_id);
00456 
00457   /// Performs unbind.  Must be called with locks held.
00458   int unbind_i (const EXT_ID &ext_id);
00459 
00460   /// Performs unbind.  Must be called with locks held.
00461   int unbind_i (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *entry);
00462 
00463   /**
00464    * Resize the map.  Must be called with locks held.
00465    * @note This method should never be called more than once or else all the
00466    * hashing will get screwed up as the size will change.
00467    */
00468   int create_buckets (size_t size);
00469 
00470   /// Close down a <Map_Manager_Ex>.  Must be called with
00471   /// locks held.
00472   int close_i (void);
00473 
00474   /// Removes all the entries in <Map_Manager_Ex>.  Must be called with
00475   /// locks held.
00476   int unbind_all_i (void);
00477 
00478   /// Pointer to a memory allocator used for table_, so it should
00479   /// supply size*sizeof (ACE_Hash_Map_Entry<EXT_ID, INT_ID>),
00480   ACE_Allocator *table_allocator_;
00481 
00482   /// Addidtional allocator for entries, so it should be able to
00483   /// allocate 'size' / chunks of sizeof(ACE_Hash_Map_Entry<EXT_ID,
00484   /// INT_ID>) bytes each.
00485   ACE_Allocator *entry_allocator_;
00486 
00487   /// Synchronization variable for the MT_SAFE
00488   /// @c ACE_Hash_Map_Manager_Ex.
00489   ACE_LOCK lock_;
00490 
00491   /// Function object used for hashing keys.
00492   HASH_KEY hash_key_;
00493 
00494   /// Function object used for comparing keys.
00495   COMPARE_KEYS compare_keys_;
00496 
00497 protected:
00498   /// Returns the <ACE_Hash_Map_Entry> that corresponds to <ext_id>.
00499   int shared_find (const EXT_ID &ext_id,
00500                    ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry,
00501                    size_t &loc);
00502 
00503   /// Accessor of the underlying table
00504   ACE_Hash_Map_Entry<EXT_ID, INT_ID> *table (void);
00505 
00506   /// Accessor of the current size attribute
00507   size_t cur_size (void) const;
00508 
00509 private:
00510   /**
00511    * Array of <ACE_Hash_Map_Entry> *s, each of which points to an
00512    * <ACE_Hash_Map_Entry> that serves as the beginning of a linked
00513    * list of <EXT_ID>s that hash to that bucket.
00514    */
00515   ACE_Hash_Map_Entry<EXT_ID, INT_ID> *table_;
00516 
00517   /// Total size of the hash table.
00518   size_t total_size_;
00519 
00520   /// Current number of entries in the table
00521   /// @note That this can be larger than <total_size_> due to the
00522   /// bucket chaining).
00523   size_t cur_size_;
00524 
00525   // = Disallow these operations.
00526   ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID,  HASH_KEY, COMPARE_KEYS, ACE_LOCK> &))
00527   ACE_UNIMPLEMENTED_FUNC (ACE_Hash_Map_Manager_Ex (const ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID,  HASH_KEY, COMPARE_KEYS, ACE_LOCK> &))
00528 };
00529 
00530 /**
00531  * @class ACE_Hash_Map_Iterator_Base_Ex
00532  *
00533  * @brief Base iterator for the <ACE_Hash_Map_Manager_Ex>
00534  *
00535  * This class factors out common code from its templatized
00536  * subclasses.
00537  */
00538 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00539 class ACE_Hash_Map_Iterator_Base_Ex
00540 {
00541 public:
00542   // = Initialization method.
00543   /// Contructor.  If head != 0, the iterator constructed is positioned
00544   /// at the head of the map, it is positioned at the end otherwise.
00545   ACE_Hash_Map_Iterator_Base_Ex (ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &mm,
00546                                  int head);
00547 
00548   // = ITERATION methods.
00549 
00550   /// Pass back the next <entry> that hasn't been seen in the Set.
00551   /// Returns 0 when all items have been seen, else 1.
00552   int next (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&next_entry) const;
00553 
00554   /// Returns 1 when all items have been seen, else 0.
00555   int done (void) const;
00556 
00557   /// Returns a reference to the interal element <this> is pointing to.
00558   ACE_Hash_Map_Entry<EXT_ID, INT_ID>& operator* (void) const;
00559 
00560   /// Returns a pointer to the interal element <this> is pointing to.
00561   ACE_Hash_Map_Entry<EXT_ID, INT_ID>* operator-> (void) const;
00562 
00563   /// Returns reference the Hash_Map_Manager_Ex that is being iterated
00564   /// over.
00565   ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>& map (void);
00566 
00567   /// Check if two iterators point to the same position
00568   bool operator== (const ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &) const;
00569   bool operator!= (const ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &) const;
00570 
00571   /// Declare the dynamic allocation hooks.
00572   ACE_ALLOC_HOOK_DECLARE;
00573 
00574 protected:
00575   /// Move forward by one element in the set.  Returns 0 when there's
00576   /// no more item in the set after the current items, else 1.
00577   int forward_i (void);
00578 
00579   /// Move backward by one element in the set.  Returns 0 when there's
00580   /// no more item in the set before the current item, else 1.
00581   int reverse_i (void);
00582 
00583   /// Dump the state of an object.
00584   void dump_i (void) const;
00585 
00586   /// Map we are iterating over.
00587   ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *map_man_;
00588 
00589   /// Keeps track of how far we've advanced in the table.
00590   ssize_t index_;
00591 
00592   /// Keeps track of how far we've advanced in a linked list in each
00593   /// table slot.
00594   ACE_Hash_Map_Entry<EXT_ID, INT_ID> *next_;
00595 };
00596 
00597 /**
00598  * @class ACE_Hash_Map_Const_Iterator_Base_Ex
00599  *
00600  * @brief Base const iterator for the <ACE_Hash_Map_Manager_Ex>
00601  *
00602  * This class factors out common code from its templatized
00603  * subclasses.
00604  */
00605 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00606 class ACE_Hash_Map_Const_Iterator_Base_Ex
00607 {
00608 public:
00609   // = Initialization method.
00610   /// Contructor.  If head != 0, the iterator constructed is positioned
00611   /// at the head of the map, it is positioned at the end otherwise.
00612   ACE_Hash_Map_Const_Iterator_Base_Ex (const ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &mm,
00613                                        int head);
00614 
00615   // = ITERATION methods.
00616 
00617   /// Pass back the next <entry> that hasn't been seen in the Set.
00618   /// Returns 0 when all items have been seen, else 1.
00619   int next (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&next_entry) const;
00620 
00621   /// Returns 1 when all items have been seen, else 0.
00622   int done (void) const;
00623 
00624   /// Returns a reference to the interal element <this> is pointing to.
00625   ACE_Hash_Map_Entry<EXT_ID, INT_ID>& operator* (void) const;
00626 
00627   /// Returns a pointer to the interal element <this> is pointing to.
00628   ACE_Hash_Map_Entry<EXT_ID, INT_ID>* operator-> (void) const;
00629 
00630   /// Returns reference the Hash_Map_Manager_Ex that is being iterated
00631   /// over.
00632   const ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>& map (void);
00633 
00634   /// Check if two iterators point to the same position
00635   bool operator== (const ACE_Hash_Map_Const_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &) const;
00636   bool operator!= (const ACE_Hash_Map_Const_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &) const;
00637 
00638   /// Declare the dynamic allocation hooks.
00639   ACE_ALLOC_HOOK_DECLARE;
00640 
00641 protected:
00642   /// Move forward by one element in the set.  Returns 0 when there's
00643   /// no more item in the set after the current items, else 1.
00644   int forward_i (void);
00645 
00646   /// Move backward by one element in the set.  Returns 0 when there's
00647   /// no more item in the set before the current item, else 1.
00648   int reverse_i (void);
00649 
00650   /// Dump the state of an object.
00651   void dump_i (void) const;
00652 
00653   /// Map we are iterating over.
00654   const ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *map_man_;
00655 
00656   /// Keeps track of how far we've advanced in the table.
00657   ssize_t index_;
00658 
00659   /// Keeps track of how far we've advanced in a linked list in each
00660   /// table slot.
00661   ACE_Hash_Map_Entry<EXT_ID, INT_ID> *next_;
00662 };
00663 
00664 /**
00665  * @class ACE_Hash_Map_Iterator_Ex
00666  *
00667  * @brief Forward iterator for the <ACE_Hash_Map_Manager_Ex>.
00668  *
00669  * This class does not perform any internal locking of the
00670  * <ACE_Hash_Map_Manager_Ex> it is iterating upon since locking is
00671  * inherently inefficient and/or error-prone within an STL-style
00672  * iterator.  If you require locking, you can explicitly use an
00673  * ACE_Guard or ACE_Read_Guard on the <ACE_Hash_Map_Manager_Ex>'s
00674  * internal lock, which is accessible via its <mutex> method.
00675  */
00676 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00677 class ACE_Hash_Map_Iterator_Ex : public ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>
00678 {
00679 public:
00680   // = Initialization method.
00681   ACE_Hash_Map_Iterator_Ex (ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &mm,
00682                             int tail = 0);
00683 
00684   // = Iteration methods.
00685   /// Move forward by one element in the set.  Returns 0 when all the
00686   /// items in the set have been seen, else 1.
00687   int advance (void);
00688 
00689   /// Dump the state of an object.
00690   void dump (void) const;
00691 
00692   // = STL styled iteration, compare, and reference functions.
00693 
00694   /// Prefix advance.
00695   ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &operator++ (void);
00696 
00697   /// Postfix advance.
00698   ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> operator++ (int);
00699 
00700   /// Prefix reverse.
00701   ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &operator-- (void);
00702 
00703   /// Postfix reverse.
00704   ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> operator-- (int);
00705 
00706   /// Declare the dynamic allocation hooks.
00707   ACE_ALLOC_HOOK_DECLARE;
00708 };
00709 
00710 /**
00711  * @class ACE_Hash_Map_Const_Iterator_Ex
00712  *
00713  * @brief Const forward iterator for the <ACE_Hash_Map_Manager_Ex>.
00714  *
00715  * This class does not perform any internal locking of the
00716  * <ACE_Hash_Map_Manager_Ex> it is iterating upon since locking is
00717  * inherently inefficient and/or error-prone within an STL-style
00718  * iterator.  If you require locking, you can explicitly use an
00719  * ACE_Guard or ACE_Read_Guard on the <ACE_Hash_Map_Manager_Ex>'s
00720  * internal lock, which is accessible via its <mutex> method.
00721  */
00722 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00723 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>
00724 {
00725 public:
00726   // = Initialization method.
00727   ACE_Hash_Map_Const_Iterator_Ex (const ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &mm,
00728                                   int tail = 0);
00729 
00730   // = Iteration methods.
00731   /// Move forward by one element in the set.  Returns 0 when all the
00732   /// items in the set have been seen, else 1.
00733   int advance (void);
00734 
00735   /// Dump the state of an object.
00736   void dump (void) const;
00737 
00738   // = STL styled iteration, compare, and reference functions.
00739 
00740   /// Prefix advance.
00741   ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &operator++ (void);
00742 
00743   /// Postfix advance.
00744   ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> operator++ (int);
00745 
00746   /// Prefix reverse.
00747   ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &operator-- (void);
00748 
00749   /// Postfix reverse.
00750   ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> operator-- (int);
00751 
00752   /// Declare the dynamic allocation hooks.
00753   ACE_ALLOC_HOOK_DECLARE;
00754 };
00755 
00756 /**
00757  * @class ACE_Hash_Map_Bucket_Iterator
00758  *
00759  * @brief Forward iterator for the <ACE_Hash_Map_Manager_Ex> which
00760  * only traverses a particular bucket.  The particular bucket is
00761  * specified by the <EXT_ID> parameter specified in the constructor.
00762  *
00763  * This class does not perform any internal locking of the
00764  * <ACE_Hash_Map_Manager_Ex> it is iterating upon since locking is
00765  * inherently inefficient and/or error-prone within an STL-style
00766  * iterator.  If you require locking, you can explicitly use an
00767  * ACE_Guard or ACE_Read_Guard on the <ACE_Hash_Map_Manager_Ex>'s
00768  * internal lock, which is accessible via its <mutex> method.
00769  *
00770  * Note that a creation method for this new iterator cannot be added
00771  * to the hash map, since this would require adding explicit template
00772  * instantiations for bucket iterators on platforms with broken
00773  * templates.
00774  */
00775 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00776 class ACE_Hash_Map_Bucket_Iterator
00777 {
00778 public:
00779   // = Initialization method.
00780   ACE_Hash_Map_Bucket_Iterator (ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &mm,
00781                                 const EXT_ID &ext_id,
00782                                 int tail = 0);
00783 
00784   // = STL styled iteration, compare, and reference functions.
00785 
00786   /// Prefix advance.
00787   ACE_Hash_Map_Bucket_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &operator++ (void);
00788 
00789   /// Postfix advance.
00790   ACE_Hash_Map_Bucket_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> operator++ (int);
00791 
00792   /// Prefix reverse.
00793   ACE_Hash_Map_Bucket_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &operator-- (void);
00794 
00795   /// Postfix reverse.
00796   ACE_Hash_Map_Bucket_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> operator-- (int);
00797 
00798   /// Returns a reference to the interal element <this> is pointing to.
00799   ACE_Hash_Map_Entry<EXT_ID, INT_ID>& operator* (void) const;
00800 
00801   /// Returns a pointer to the interal element <this> is pointing to.
00802   ACE_Hash_Map_Entry<EXT_ID, INT_ID>* operator-> (void) const;
00803 
00804   /// Returns reference the Hash_Map_Manager_Ex that is being iterated
00805   /// over.
00806   ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>& map (void);
00807 
00808   /// Check if two iterators point to the same position
00809   bool operator== (const ACE_Hash_Map_Bucket_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &) const;
00810   bool operator!= (const ACE_Hash_Map_Bucket_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &) const;
00811 
00812 protected:
00813   /// Move forward by one element in the set.  Returns 0 when there's
00814   /// no more item in the set after the current items, else 1.
00815   int forward_i (void);
00816 
00817   /// Move backward by one element in the set.  Returns 0 when there's
00818   /// no more item in the set before the current item, else 1.
00819   int reverse_i (void);
00820 
00821   /// Map we are iterating over.
00822   ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *map_man_;
00823 
00824   /// Keeps track of how far we've advanced in the table.
00825   ssize_t index_;
00826 
00827   /// Keeps track of how far we've advanced in a linked list in each
00828   /// table slot.
00829   ACE_Hash_Map_Entry<EXT_ID, INT_ID> *next_;
00830 };
00831 
00832 /**
00833  * @class ACE_Hash_Map_Reverse_Iterator_Ex
00834  *
00835  * @brief Reverse iterator for the <ACE_Hash_Map_Manager_Ex>.
00836  *
00837  * This class does not perform any internal locking of the
00838  * <ACE_Hash_Map_Manager_Ex> it is iterating upon since locking is
00839  * inherently inefficient and/or error-prone within an STL-style
00840  * iterator.  If you require locking, you can explicitly use an
00841  * ACE_Guard or ACE_Read_Guard on the <ACE_Hash_Map_Manager_Ex>'s
00842  * internal lock, which is accessible via its <mutex> method.
00843  */
00844 template <class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
00845 class ACE_Hash_Map_Reverse_Iterator_Ex : public ACE_Hash_Map_Iterator_Base_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK>
00846 {
00847 public:
00848   // = Initialization method.
00849   ACE_Hash_Map_Reverse_Iterator_Ex (ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &mm,
00850                                     int head = 0);
00851 
00852   // = Iteration methods.
00853   /// Move forward by one element in the set.  Returns 0 when all the
00854   /// items in the set have been seen, else 1.
00855   int advance (void);
00856 
00857   /// Dump the state of an object.
00858   void dump (void) const;
00859 
00860   // = STL styled iteration, compare, and reference functions.
00861 
00862   /// Prefix reverse.
00863   ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &operator++ (void);
00864 
00865   /// Postfix reverse.
00866   ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> operator++ (int);
00867 
00868   /// Prefix advance.
00869   ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> &operator-- (void);
00870 
00871   /// Postfix advance.
00872   ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> operator-- (int);
00873 
00874   /// Declare the dynamic allocation hooks.
00875   ACE_ALLOC_HOOK_DECLARE;
00876 };
00877 
00878 /**
00879  * @class ACE_Hash_Map_Manager
00880  *
00881  * @brief Wrapper for backward compatibility.
00882  *
00883  * This implementation of a map uses a hash table.  This class
00884  * expects that the <EXT_ID> contains a method called <hash>.
00885  * In addition, the <EXT_ID> must support <operator==>.  Both of
00886  * these constraints can be alleviated via template
00887  * specialization, as shown in the $ACE_ROOT/tests/Conn_Test.cpp
00888  * test.
00889  *
00890  * <b> Requirements and Performance Characteristics</b>
00891  *   - Internal Structure
00892  *       Hash Table
00893  *   - Duplicates allowed?
00894  *       No
00895  *   - Random access allowed?
00896  *       Yes
00897  *   - Search speed
00898  *       O(1)
00899  *   - Insert/replace speed
00900  *       O(1), can be longer if the hash map has to resize
00901  *   - Iterator still valid after change to container?
00902  *       Yes
00903  *   - Frees memory for removed elements?
00904  *       Yes
00905  *   - Items inserted by
00906  *       Value
00907  *   - Requirements for key type
00908  *       -# Default constructor
00909  *       -# Copy constructor
00910  *       -# operator=
00911  *       -# operator==
00912  *   - Requirements for object type
00913  *       -# Default constructor
00914  *       -# Copy constructor
00915  *       -# operator=
00916  *       -# operator<
00917  */
00918 template <class EXT_ID, class INT_ID, class ACE_LOCK>
00919 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>
00920 {
00921 public:
00922 
00923   /** 
00924    * Initialize a @c Hash_Map_Manager with default size elements.
00925    * @param table_alloc is a pointer to a memory allocator used for
00926    *        table_, so it should supply size*sizeof (ACE_Hash_Map_Entry<EXT_ID, INT_ID>).
00927    * @param entry_alloc is a pointer to an additional allocator for
00928    *        entries, so it should be able to allocate 'size' / chunks
00929    *        of sizeof(ACE_Hash_Map_Entry<EXT_ID, INT_ID>) bytes each.
00930    * If @c table_alloc is 0 it defaults to @c ACE_Allocator::instance().
00931    * If @c entry_alloc is 0 then it defaults to the same allocator as
00932    * @c table_alloc.
00933    */
00934   ACE_Hash_Map_Manager (ACE_Allocator *table_alloc = 0,
00935                         ACE_Allocator *entry_alloc = 0);
00936 
00937   /** 
00938    * Initialize a @c Hash_Map_Manager with @c size elements.
00939    * @param table_alloc is a pointer to a memory allocator used for
00940    *        table_, so it should supply size*sizeof (ACE_Hash_Map_Entry<EXT_ID, INT_ID>).
00941    * @param entry_alloc is a pointer to an additional allocator for
00942    *        entries, so it should be able to allocate 'size' / chunks
00943    *        of sizeof(ACE_Hash_Map_Entry<EXT_ID, INT_ID>) bytes each.
00944    * If @c table_alloc is 0 it defaults to @c ACE_Allocator::instance().
00945    * If @c entry_alloc is 0 then it defaults to the same allocator as
00946    * @c table_alloc.
00947    */
00948   ACE_Hash_Map_Manager (size_t size,
00949                         ACE_Allocator *table_alloc = 0,
00950                         ACE_Allocator *entry_alloc = 0);
00951 
00952   // = The following two are necessary for template specialization of
00953   // ACE_Hash_Map_Manager to work.
00954   int equal (const EXT_ID &id1, const EXT_ID &id2);
00955   u_long hash (const EXT_ID &ext_id);
00956 };
00957 
00958 /**
00959  * @class ACE_Hash_Map_Iterator
00960  *
00961  * @brief Wrapper for backward compatibility.
00962  */
00963 template <class EXT_ID, class INT_ID, class ACE_LOCK>
00964 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>
00965 {
00966 public:
00967   // = Initialization method.
00968   /// Construct from map
00969   ACE_Hash_Map_Iterator (ACE_Hash_Map_Manager<EXT_ID, INT_ID, ACE_LOCK> &mm,
00970                          int tail = 0);
00971 
00972   /// Construct from base
00973   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);
00974 
00975   /// Assignment from base
00976   ACE_Hash_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> &
00977   operator= (const ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK> &base);
00978 };
00979 
00980 /**
00981  * @class ACE_Hash_Map_Const_Iterator
00982  *
00983  * @brief Wrapper for backward compatibility.
00984  */
00985 template <class EXT_ID, class INT_ID, class ACE_LOCK>
00986 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>
00987 {
00988 public:
00989   // = Initialization method.
00990   /// Construct from map
00991   ACE_Hash_Map_Const_Iterator (const ACE_Hash_Map_Manager<EXT_ID, INT_ID, ACE_LOCK> &mm,
00992                                int tail = 0);
00993 
00994   /// Construct from base
00995   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);
00996 
00997   /// Assignment from base
00998   ACE_Hash_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK> &
00999   operator= (const ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK> &base);
01000 };
01001 
01002 /**
01003  * @class ACE_Hash_Map_Reverse_Iterator
01004  *
01005  * @brief Wrapper for backward compatibility.
01006  */
01007 template <class EXT_ID, class INT_ID, class ACE_LOCK>
01008 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>
01009 {
01010 public:
01011   // = Initialization method.
01012   ACE_Hash_Map_Reverse_Iterator (ACE_Hash_Map_Manager<EXT_ID, INT_ID, ACE_LOCK> &mm,
01013                                  int head = 0);
01014 
01015   /// Construct from base
01016   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);
01017 
01018   /// Assignment from base
01019   ACE_Hash_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> &
01020   operator= (const ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_LOCK> &base);
01021 };
01022 
01023 ACE_END_VERSIONED_NAMESPACE_DECL
01024 
01025 #if defined (__ACE_INLINE__)
01026 #  include "ace/Hash_Map_Manager_T.inl"
01027 #endif /* __ACE_INLINE__ */
01028 
01029 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
01030 #include "ace/Hash_Map_Manager_T.cpp"
01031 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
01032 
01033 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
01034 #pragma implementation ("Hash_Map_Manager_T.cpp")
01035 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
01036 
01037 #include /**/ "ace/post.h"
01038 #endif /* ACE_HASH_MAP_MANAGER_T_H */

Generated on Thu Nov 9 09:41:52 2006 for ACE by doxygen 1.3.6