Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Map_Manager.cpp

Go to the documentation of this file.
00001 // $Id: Map_Manager.cpp,v 1.1.1.3 2001/12/04 14:33:04 chad Exp $
00002 
00003 #ifndef ACE_MAP_MANAGER_C
00004 #define ACE_MAP_MANAGER_C
00005 
00006 #include "ace/Malloc.h"
00007 
00008 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00009 # pragma once
00010 #endif /* ACE_LACKS_PRAGMA_ONCE */
00011 
00012 #include "ace/Service_Config.h"
00013 #include "ace/Map_Manager.h"
00014 
00015 #if !defined (__ACE_INLINE__)
00016 #include "ace/Map_Manager.i"
00017 #endif /* __ACE_INLINE__ */
00018 
00019 ACE_RCSID(ace, Map_Manager, "$Id: Map_Manager.cpp,v 1.1.1.3 2001/12/04 14:33:04 chad Exp $")
00020 
00021 ACE_ALLOC_HOOK_DEFINE(ACE_Map_Entry)
00022 
00023 ACE_ALLOC_HOOK_DEFINE(ACE_Map_Manager)
00024 
00025 ACE_ALLOC_HOOK_DEFINE(ACE_Map_Const_Iterator_Base)
00026 
00027 ACE_ALLOC_HOOK_DEFINE(ACE_Map_Iterator_Base)
00028 
00029 ACE_ALLOC_HOOK_DEFINE(ACE_Map_Const_Iterator)
00030 
00031 ACE_ALLOC_HOOK_DEFINE(ACE_Map_Iterator)
00032 
00033 ACE_ALLOC_HOOK_DEFINE(ACE_Map_Reverse_Iterator)
00034 
00035 template <class EXT_ID, class INT_ID, class ACE_LOCK> int
00036 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::open (size_t size,
00037                                                  ACE_Allocator *alloc)
00038 {
00039   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00040 
00041   // Close old map (if any).
00042   this->close_i ();
00043 
00044   // Use the user specified allocator or the default singleton one.
00045   if (alloc == 0)
00046     alloc = ACE_Allocator::instance ();
00047 
00048   this->allocator_ = alloc;
00049 
00050   // This assertion is here to help track a situation that shouldn't
00051   // happen.
00052   ACE_ASSERT (size != 0);
00053 
00054   // Active_Map_Manager depends on the <slot_index_> being of fixed
00055   // size. It cannot be size_t because size_t is 64-bits on 64-bit
00056   // platform and 32-bits on 32-bit platforms. Size of the <slot_index_>
00057   // has to be consistent across platforms. ACE_UIN32 is chosen as
00058   // ACE_UIN32_MAX is big enough. The assert is to ensure that the user
00059   // doesn't open the ACE_Map_Manager with a bigger size than we can
00060   // handle.
00061   ACE_ASSERT (size <= ACE_UINT32_MAX);
00062 
00063   // Resize from 0 to <size>.  Note that this will also set up the
00064   // circular free list.
00065   return this->resize_i ((ACE_UINT32) size);
00066 }
00067 
00068 template <class EXT_ID, class INT_ID, class ACE_LOCK> int
00069 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::close_i (void)
00070 {
00071   // Free entries.
00072   this->free_search_structure ();
00073 
00074   // Reset sizes.
00075   this->total_size_ = 0;
00076   this->cur_size_ = 0;
00077 
00078   // Reset circular free list.
00079   this->free_list_.next (this->free_list_id ());
00080   this->free_list_.prev (this->free_list_id ());
00081 
00082   // Reset circular occupied list.
00083   this->occupied_list_.next (this->occupied_list_id ());
00084   this->occupied_list_.prev (this->occupied_list_id ());
00085 
00086   return 0;
00087 }
00088 
00089 template <class EXT_ID, class INT_ID, class ACE_LOCK> int
00090 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::bind_i (const EXT_ID &ext_id,
00091                                                    const INT_ID &int_id)
00092 {
00093   // Try to find the key.
00094   ACE_UINT32 slot = 0;
00095   int result = this->find_and_return_index (ext_id,
00096                                             slot);
00097 
00098   if (result == 0)
00099     // We found the key. Nothing to change.
00100     return 1;
00101   else
00102     // We didn't find the key.
00103     return this->shared_bind (ext_id,
00104                               int_id);
00105 }
00106 
00107 template <class EXT_ID, class INT_ID, class ACE_LOCK> int
00108 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::next_free (ACE_UINT32 &free_slot)
00109 {
00110   // Look in the free list for an empty slot.
00111   free_slot = this->free_list_.next ();
00112 
00113   // If we do find a free slot, return successfully.
00114   if (free_slot != this->free_list_id ())
00115     return 0;
00116 
00117 #if defined (ACE_HAS_LAZY_MAP_MANAGER)
00118 
00119   // Move any free slots from occupied list to free list.
00120   this->move_all_free_slots_from_occupied_list ();
00121 
00122   // Try again in case we found any free slots in the occupied list.
00123   free_slot = this->free_list_.next ();
00124 
00125   // If we do find a free slot, return successfully.
00126   if (free_slot != this->free_list_id ())
00127     return 0;
00128 
00129 #endif /* ACE_HAS_LAZY_MAP_MANAGER */
00130 
00131   // Resize the map.
00132   int result = this->resize_i (this->new_size ());
00133 
00134   // Check for errors.
00135   if (result == 0)
00136     // New free slot.
00137     free_slot = this->free_list_.next ();
00138 
00139   return result;
00140 }
00141 
00142 #if defined (ACE_HAS_LAZY_MAP_MANAGER)
00143 
00144 template <class EXT_ID, class INT_ID, class ACE_LOCK> void
00145 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::move_all_free_slots_from_occupied_list (void)
00146 {
00147   //
00148   // In the case of lazy map managers, the movement of free slots from
00149   // the occupied list to the free list is delayed until we run out of
00150   // free slots in the free list.
00151   //
00152 
00153   // Go through the entire occupied list, moving free slots to the
00154   // free list. Note that all free slots in the occupied list are
00155   // moved in this loop.
00156   for (ACE_UINT32 i = this->occupied_list_.next ();
00157        i != this->occupied_list_id ();
00158        )
00159     {
00160       //
00161       // Note the trick used here: Information about the current slot
00162       // is first noted; <i> then moves to the next occupied slot;
00163       // only after this is the slot (potentially) moved from the
00164       // occupied list to the free list.  This order of things, i.e.,
00165       // moving <i> before moving the free slot is necessary,
00166       // otherwise we'll forget which our next occupied slot is.
00167       //
00168 
00169       // Note information about current slot.
00170       ACE_Map_Entry<EXT_ID, INT_ID> &current_slot = this->search_structure_[i];
00171       ACE_UINT32 position_of_current_slot = i;
00172 
00173       // Move <i> to next occupied slot.
00174       i = this->search_structure_[i].next ();
00175 
00176       // If current slot is free
00177       if (current_slot.free_)
00178         {
00179           // Reset free flag to zero before moving to free list.
00180           current_slot.free_ = 0;
00181 
00182           // Move from occupied list to free list.
00183           this->move_from_occupied_list_to_free_list (position_of_current_slot);
00184         }
00185     }
00186 }
00187 
00188 #endif /* ACE_HAS_LAZY_MAP_MANAGER */
00189 
00190 template <class EXT_ID, class INT_ID, class ACE_LOCK> void
00191 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::shared_move (ACE_UINT32 slot,
00192                                                         ACE_Map_Entry<EXT_ID, INT_ID> &current_list,
00193                                                         ACE_UINT32 current_list_id,
00194                                                         ACE_Map_Entry<EXT_ID, INT_ID> &new_list,
00195                                                         ACE_UINT32 new_list_id)
00196 {
00197   // Grab the entry.
00198   ENTRY &entry = this->search_structure_[slot];
00199 
00200   // Remove from current list.
00201 
00202   // Fix the entry before us.
00203   ACE_UINT32 current_list_prev = entry.prev ();
00204 
00205   if (current_list_prev == current_list_id)
00206     current_list.next (entry.next ());
00207   else
00208     this->search_structure_[current_list_prev].next (entry.next ());
00209 
00210   // Fix the entry after us.
00211   ACE_UINT32 current_list_next = entry.next ();
00212 
00213   if (current_list_next == current_list_id)
00214     current_list.prev (entry.prev ());
00215   else
00216     this->search_structure_[current_list_next].prev (entry.prev ());
00217 
00218   // Add to new list.
00219 
00220   // Fix us.
00221   ACE_UINT32 new_list_next = new_list.next ();
00222   entry.next (new_list_next);
00223   entry.prev (new_list_id);
00224 
00225   // Fix entry before us.
00226   new_list.next (slot);
00227 
00228   // Fix entry after us.
00229   if (new_list_next == new_list_id)
00230     new_list.prev (slot);
00231   else
00232     this->search_structure_[new_list_next].prev (slot);
00233 }
00234 
00235 template <class EXT_ID, class INT_ID, class ACE_LOCK> int
00236 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::shared_bind (const EXT_ID &ext_id,
00237                                                         const INT_ID &int_id)
00238 {
00239   // This function assumes that the find() has already been done, and
00240   // therefore, simply adds to the map.
00241 
00242   // Find an empty slot.
00243   ACE_UINT32 slot = 0;
00244   int result = this->next_free (slot);
00245 
00246   if (result == 0)
00247     {
00248       // Copy key and value.
00249       this->search_structure_[slot].int_id_ = int_id;
00250       this->search_structure_[slot].ext_id_ = ext_id;
00251 
00252       // Move from free list to occupied list
00253       this->move_from_free_list_to_occupied_list (slot);
00254 
00255       // Update the current size.
00256       ++this->cur_size_;
00257     }
00258 
00259   return result;
00260 }
00261 
00262 template <class EXT_ID, class INT_ID, class ACE_LOCK> int
00263 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::rebind_i (const EXT_ID &ext_id,
00264                                                      const INT_ID &int_id,
00265                                                      EXT_ID &old_ext_id,
00266                                                      INT_ID &old_int_id)
00267 {
00268   // First try to find the key.
00269   ACE_UINT32 slot = 0;
00270   int result = this->find_and_return_index (ext_id,
00271                                             slot);
00272   if (result == 0)
00273     {
00274       // We found it, so make copies of the old entries and rebind
00275       // current entries.
00276       ENTRY &ss = this->search_structure_[slot];
00277       old_ext_id = ss.ext_id_;
00278       old_int_id = ss.int_id_;
00279       ss.ext_id_ = ext_id;
00280       ss.int_id_ = int_id;
00281 
00282       // Sync changed entry.
00283       this->allocator_->sync (&ss, sizeof ss);
00284 
00285       return 1;
00286     }
00287   else
00288     // We didn't find it, so let's add it.
00289     return this->shared_bind (ext_id,
00290                               int_id);
00291 }
00292 
00293 template <class EXT_ID, class INT_ID, class ACE_LOCK> int
00294 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::rebind_i (const EXT_ID &ext_id,
00295                                                      const INT_ID &int_id,
00296                                                      INT_ID &old_int_id)
00297 {
00298   // First try to find the key.
00299   ACE_UINT32 slot = 0;
00300   int result = this->find_and_return_index (ext_id,
00301                                             slot);
00302   if (result == 0)
00303     {
00304       // We found it, so make copies of the old entries and rebind
00305       // current entries.
00306       ENTRY &ss = this->search_structure_[slot];
00307       old_int_id = ss.int_id_;
00308       ss.ext_id_ = ext_id;
00309       ss.int_id_ = int_id;
00310 
00311       // Sync changed entry.
00312       this->allocator_->sync (&ss, sizeof ss);
00313 
00314       return 1;
00315     }
00316   else
00317     // We didn't find it, so let's add it.
00318     return this->shared_bind (ext_id,
00319                               int_id);
00320 }
00321 
00322 template <class EXT_ID, class INT_ID, class ACE_LOCK> int
00323 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::rebind_i (const EXT_ID &ext_id,
00324                                                      const INT_ID &int_id)
00325 {
00326   // First try to find the key.
00327   ACE_UINT32 slot = 0;
00328   int result = this->find_and_return_index (ext_id,
00329                                             slot);
00330   if (result == 0)
00331     {
00332       // We found it, so rebind current entries.
00333       ENTRY &ss = this->search_structure_[slot];
00334       ss.ext_id_ = ext_id;
00335       ss.int_id_ = int_id;
00336 
00337       // Sync changed entry.
00338       this->allocator_->sync (&ss, sizeof ss);
00339 
00340       return 1;
00341     }
00342   else
00343     // We didn't find it, so let's add it.
00344     return this->shared_bind (ext_id,
00345                               int_id);
00346 }
00347 
00348 template <class EXT_ID, class INT_ID, class ACE_LOCK> int
00349 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::trybind_i (const EXT_ID &ext_id,
00350                                                       INT_ID &int_id)
00351 {
00352   // Try to find the key.
00353   ACE_UINT32 slot = 0;
00354   int result = this->find_and_return_index (ext_id,
00355                                             slot);
00356   if (result == 0)
00357     {
00358       // Key was found.  Make a copy of value, but *don't* update
00359       // anything in the map!
00360       int_id = this->search_structure_[slot].int_id_;
00361       return 1;
00362     }
00363   else
00364     // We didn't find it, so let's bind it!
00365     return this->bind_i (ext_id,
00366                          int_id);
00367 }
00368 
00369 template <class EXT_ID, class INT_ID, class ACE_LOCK> int
00370 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::find_and_return_index (const EXT_ID &ext_id,
00371                                                                   ACE_UINT32 &slot)
00372 {
00373   // Go through the entire occupied list looking for the key.
00374   for (ACE_UINT32 i = this->occupied_list_.next ();
00375        i != this->occupied_list_id ();
00376        i = this->search_structure_[i].next ())
00377     {
00378 #if defined (ACE_HAS_LAZY_MAP_MANAGER)
00379       if (this->search_structure_[i].free_)
00380         continue;
00381 #endif /* ACE_HAS_LAZY_MAP_MANAGER */
00382 
00383       if (this->equal (this->search_structure_[i].ext_id_,
00384                        ext_id))
00385         {
00386           // If found, return slot.
00387           slot = i;
00388           return 0;
00389         }
00390     }
00391 
00392   // Key was not found.
00393   return -1;
00394 }
00395 
00396 template <class EXT_ID, class INT_ID, class ACE_LOCK> void
00397 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::unbind_all (void)
00398 {
00399   // Go through the entire occupied list.
00400   for (ACE_UINT32 i = this->occupied_list_.next ();
00401        i != this->occupied_list_id ();
00402        )
00403     {
00404       //
00405       // Note the trick used here: Information about the current slot
00406       // is first noted; <i> then moves to the next occupied slot;
00407       // only after this is the slot (potentially) moved from the
00408       // occupied list to the free list.  This order of things, i.e.,
00409       // moving <i> before moving the free slot is necessary,
00410       // otherwise we'll forget which our next occupied slot is.
00411       //
00412 
00413       // Note information about current slot.
00414       ACE_Map_Entry<EXT_ID, INT_ID> &current_slot =
00415         this->search_structure_[i];
00416       ACE_UINT32 position_of_current_slot = i;
00417 
00418       // Move <i> to next occupied slot.
00419       i = current_slot.next ();
00420 
00421 #if defined (ACE_HAS_LAZY_MAP_MANAGER)
00422       if (current_slot.free_)
00423         continue;
00424 #endif /* ACE_HAS_LAZY_MAP_MANAGER */
00425 
00426       this->unbind_slot (position_of_current_slot);
00427     }
00428 }
00429 
00430 template <class EXT_ID, class INT_ID, class ACE_LOCK> int
00431 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::find_i (const EXT_ID &ext_id,
00432                                                    INT_ID &int_id)
00433 {
00434   // Try to find the key.
00435   ACE_UINT32 slot = 0;
00436   int result = this->find_and_return_index (ext_id,
00437                                             slot);
00438   if (result == 0)
00439     // Key was found.  Make a copy of value.
00440     int_id = this->search_structure_[slot].int_id_;
00441 
00442   return result;
00443 }
00444 
00445 template <class EXT_ID, class INT_ID, class ACE_LOCK> int
00446 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::unbind_and_return_index (const EXT_ID &ext_id,
00447                                                                     ACE_UINT32 &slot)
00448 {
00449   // Try to find the key.
00450   int result = this->find_and_return_index (ext_id,
00451                                             slot);
00452 
00453   if (result == 0)
00454     this->unbind_slot (slot);
00455 
00456   return result;
00457 }
00458 
00459 template <class EXT_ID, class INT_ID, class ACE_LOCK> void
00460 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::unbind_slot (ACE_UINT32 slot)
00461 {
00462 
00463 #if defined (ACE_HAS_LAZY_MAP_MANAGER)
00464 
00465   //
00466   // In the case of lazy map managers, the movement of free slots
00467   // from the occupied list to the free list is delayed until we
00468   // run out of free slots in the free list.
00469   //
00470 
00471   this->search_structure_[slot].free_ = 1;
00472 
00473 #else
00474 
00475   // Move from occupied list to free list.
00476   this->move_from_occupied_list_to_free_list (slot);
00477 
00478 #endif /* ACE_HAS_LAZY_MAP_MANAGER */
00479 
00480   // Update the current size.
00481   --this->cur_size_;
00482 }
00483 
00484 template <class EXT_ID, class INT_ID, class ACE_LOCK> int
00485 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::unbind_i (const EXT_ID &ext_id,
00486                                                      INT_ID &int_id)
00487 {
00488   // Unbind the entry.
00489   ACE_UINT32 slot = 0;
00490   int result = this->unbind_and_return_index (ext_id,
00491                                               slot);
00492   if (result == 0)
00493     // If found, copy the value.
00494     int_id = this->search_structure_[slot].int_id_;
00495 
00496   return result;
00497 }
00498 
00499 template <class EXT_ID, class INT_ID, class ACE_LOCK> int
00500 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::resize_i (ACE_UINT32 new_size)
00501 {
00502   ACE_UINT32 i;
00503   ENTRY *temp = 0;
00504 
00505   // Allocate new memory.
00506   ACE_ALLOCATOR_RETURN (temp,
00507                         (ENTRY *) this->allocator_->malloc (new_size * sizeof (ENTRY)),
00508                         -1);
00509 
00510   // Copy over the occupied entires.
00511   for (i = this->occupied_list_.next ();
00512        i != this->occupied_list_id ();
00513        i = this->search_structure_[i].next ())
00514     // Call the copy constructor using operator placement new.
00515     new (&(temp[i])) ENTRY (this->search_structure_[i]);
00516 
00517   // Copy over the free entires.
00518   for (i = this->free_list_.next ();
00519        i != this->free_list_id ();
00520        i = this->search_structure_[i].next ())
00521     // Call the copy constructor using operator placement new.
00522     new (&(temp[i])) ENTRY (this->search_structure_[i]);
00523 
00524   // Construct the new elements.
00525   for (i = this->total_size_; i < new_size; i++)
00526     {
00527       // Call the constructor for each element in the array using
00528       // operator placement new.  Note that this requires a default
00529       // constructor for <EXT_ID> and <INT_ID>.
00530       new (&(temp[i])) ENTRY;
00531       temp[i].next (i + 1);
00532       temp[i].prev (i - 1);
00533 
00534 #if defined (ACE_HAS_LAZY_MAP_MANAGER)
00535 
00536       // Even though this slot is initially free, we need the <free_>
00537       // flag to be zero so that we don't have to set it when the slot
00538       // is moved to the occupied list.  In addition, this flag has no
00539       // meaning while this slot is in the free list.
00540       temp[i].free_ = 0;
00541 
00542 #endif /* ACE_HAS_LAZY_MAP_MANAGER */
00543 
00544     }
00545 
00546   // Add new entries to the free list.
00547   this->free_list_.next (this->total_size_);
00548   this->free_list_.prev (new_size - 1);
00549   temp[new_size - 1].next (this->free_list_id ());
00550   temp[this->total_size_].prev (this->free_list_id ());
00551 
00552   // Remove/free old elements, update the new totoal size.
00553   this->free_search_structure ();
00554   this->total_size_ = new_size;
00555 
00556   // Start using new elements.
00557   this->search_structure_ = temp;
00558 
00559   return 0;
00560 }
00561 
00562 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_UINT32
00563 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::new_size (void)
00564 {
00565   // Calculate the new size.
00566   ACE_UINT32 current_size = this->total_size_;
00567 
00568   if (current_size < MAX_EXPONENTIAL)
00569     // Exponentially increase if we haven't reached MAX_EXPONENTIAL.
00570     current_size *= 2;
00571   else
00572     // Linear increase if we have reached MAX_EXPONENTIAL.
00573     current_size += LINEAR_INCREASE;
00574 
00575   // This should be the new size.
00576   return current_size;
00577 }
00578 
00579 template <class EXT_ID, class INT_ID, class ACE_LOCK> void
00580 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::free_search_structure (void)
00581 {
00582   // Free up the structure.
00583   if (this->search_structure_ != 0)
00584     {
00585       for (ACE_UINT32 i = 0; i < this->total_size_; i++)
00586         // Explicitly call the destructor.
00587         {
00588           ENTRY *ss = &this->search_structure_[i];
00589           // The "if" second argument results in a no-op instead of
00590           // deallocation.
00591           ACE_DES_FREE_TEMPLATE2 (ss, ACE_NOOP,
00592                                   ACE_Map_Entry, EXT_ID, INT_ID);
00593         }
00594 
00595       // Actually free the memory.
00596       this->allocator_->free (this->search_structure_);
00597       this->search_structure_ = 0;
00598     }
00599 }
00600 
00601 template <class EXT_ID, class INT_ID> void
00602 ACE_Map_Entry<EXT_ID, INT_ID>::dump (void) const
00603 {
00604   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00605   ACE_DEBUG ((LM_DEBUG,  ACE_LIB_TEXT ("next_ = %d"), this->next_));
00606   ACE_DEBUG ((LM_DEBUG,  ACE_LIB_TEXT ("prev_ = %d"), this->prev_));
00607 
00608 #if defined (ACE_HAS_LAZY_MAP_MANAGER)
00609   ACE_DEBUG ((LM_DEBUG,  ACE_LIB_TEXT ("free_ = %d"), this->free_));
00610 #endif /* ACE_HAS_LAZY_MAP_MANAGER */
00611 
00612   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00613 }
00614 
00615 template <class EXT_ID, class INT_ID, class ACE_LOCK> void
00616 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::dump (void) const
00617 {
00618   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00619   ACE_DEBUG ((LM_DEBUG,  ACE_LIB_TEXT ("total_size_ = %d"), this->total_size_));
00620   ACE_DEBUG ((LM_DEBUG,  ACE_LIB_TEXT ("\ncur_size_ = %d"), this->cur_size_));
00621   this->allocator_->dump ();
00622   this->lock_.dump ();
00623   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00624 }
00625 
00626 template <class EXT_ID, class INT_ID, class ACE_LOCK> void
00627 ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::dump_i (void) const
00628 {
00629   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00630   ACE_DEBUG ((LM_DEBUG,  ACE_LIB_TEXT ("next_ = %d"), this->next_));
00631   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00632 }
00633 
00634 template <class EXT_ID, class INT_ID, class ACE_LOCK> void
00635 ACE_Map_Const_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::dump_i (void) const
00636 {
00637   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00638   ACE_DEBUG ((LM_DEBUG,  ACE_LIB_TEXT ("next_ = %d"), this->next_));
00639   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00640 }
00641 
00642 template <class EXT_ID, class INT_ID, class ACE_LOCK>
00643 ACE_Map_Entry<EXT_ID, INT_ID>&
00644 ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::operator* (void) const
00645 {
00646   // @@ This function should be inlined.  We moved it here to avoid a
00647   // compiler bug in SunCC 4.2.  Once we know the correct patch to fix
00648   // the compiler problem, it should be moved back to .i file again.
00649   ACE_Map_Entry<EXT_ID, INT_ID> *retv = 0;
00650 
00651   int result = this->next (retv);
00652   ACE_ASSERT (result != 0);
00653   ACE_UNUSED_ARG (result);
00654 
00655   return *retv;
00656 }
00657 
00658 template <class EXT_ID, class INT_ID, class ACE_LOCK>
00659 ACE_Map_Entry<EXT_ID, INT_ID>&
00660 ACE_Map_Const_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::operator* (void) const
00661 {
00662   // @@ This function should be inlined.  We moved it here to avoid a
00663   // compiler bug in SunCC 4.2.  Once we know the correct patch to fix
00664   // the compiler problem, it should be moved back to .i file again.
00665   ACE_Map_Entry<EXT_ID, INT_ID> *retv = 0;
00666 
00667   int result = this->next (retv);
00668   ACE_ASSERT (result != 0);
00669   ACE_UNUSED_ARG (result);
00670 
00671   return *retv;
00672 }
00673 
00674 template <class EXT_ID, class INT_ID, class ACE_LOCK> void
00675 ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>::dump (void) const
00676 {
00677   this->dump_i ();
00678 }
00679 
00680 template <class EXT_ID, class INT_ID, class ACE_LOCK> void
00681 ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK>::dump (void) const
00682 {
00683   this->dump_i ();
00684 }
00685 
00686 template <class EXT_ID, class INT_ID, class ACE_LOCK> void
00687 ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>::dump (void) const
00688 {
00689   this->dump_i ();
00690 }
00691 
00692 #endif /* ACE_MAP_MANAGER_C */

Generated on Mon Jun 16 11:20:08 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002