Map_Manager.inl

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Map_Manager.inl,v 4.2 2005/10/28 16:14:53 ossama Exp
00004 
00005 #include "ace/Guard_T.h"
00006 #include "ace/Log_Msg.h"
00007 
00008 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00009 
00010 # if ! defined (ACE_HAS_BROKEN_NOOP_DTORS)
00011 template <class EXT_ID, class INT_ID> ACE_INLINE
00012 ACE_Map_Entry<EXT_ID, INT_ID>::~ACE_Map_Entry (void)
00013 {
00014   // No-op just to keep some compilers happy...
00015 }
00016 #endif /* ! defined (ACE_HAS_BROKEN_NOOP_DTORS) */
00017 
00018 template <class EXT_ID, class INT_ID> ACE_INLINE ACE_UINT32
00019 ACE_Map_Entry<EXT_ID, INT_ID>::next (void) const
00020 {
00021   return this->next_;
00022 }
00023 
00024 template <class EXT_ID, class INT_ID> ACE_INLINE void
00025 ACE_Map_Entry<EXT_ID, INT_ID>::next (ACE_UINT32 n)
00026 {
00027   this->next_ = n;
00028 }
00029 
00030 template <class EXT_ID, class INT_ID> ACE_INLINE ACE_UINT32
00031 ACE_Map_Entry<EXT_ID, INT_ID>::prev (void) const
00032 {
00033   return this->prev_;
00034 }
00035 
00036 template <class EXT_ID, class INT_ID> ACE_INLINE void
00037 ACE_Map_Entry<EXT_ID, INT_ID>::prev (ACE_UINT32 p)
00038 {
00039   this->prev_ = p;
00040 }
00041 
00042 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00043 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::ACE_Map_Manager (size_t size,
00044                                                             ACE_Allocator *alloc)
00045   : allocator_ (0),
00046     search_structure_ (0),
00047     total_size_ (0),
00048     cur_size_ (0)
00049 {
00050   if (this->open (size, alloc) == -1)
00051     ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("ACE_Map_Manager\n")));
00052 }
00053 
00054 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00055 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::ACE_Map_Manager (ACE_Allocator *alloc)
00056   : allocator_ (0),
00057     search_structure_ (0),
00058     total_size_ (0),
00059     cur_size_ (0)
00060 {
00061   if (this->open (ACE_DEFAULT_MAP_SIZE, alloc) == -1)
00062     ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("ACE_Map_Manager\n")));
00063 }
00064 
00065 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
00066 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::close (void)
00067 {
00068   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00069 
00070   return this->close_i ();
00071 }
00072 
00073 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00074 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::~ACE_Map_Manager (void)
00075 {
00076   this->close ();
00077 }
00078 
00079 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
00080 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::bind (const EXT_ID &ext_id,
00081                                                  const INT_ID &int_id)
00082 {
00083   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00084 
00085   return this->bind_i (ext_id,
00086                        int_id);
00087 }
00088 
00089 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
00090 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::rebind (const EXT_ID &ext_id,
00091                                                    const INT_ID &int_id,
00092                                                    EXT_ID &old_ext_id,
00093                                                    INT_ID &old_int_id)
00094 {
00095   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00096 
00097   return this->rebind_i (ext_id,
00098                          int_id,
00099                          old_ext_id,
00100                          old_int_id);
00101 }
00102 
00103 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
00104 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::rebind (const EXT_ID &ext_id,
00105                                                    const INT_ID &int_id,
00106                                                    INT_ID &old_int_id)
00107 {
00108   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00109 
00110   return this->rebind_i (ext_id,
00111                          int_id,
00112                          old_int_id);
00113 }
00114 
00115 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
00116 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::rebind (const EXT_ID &ext_id,
00117                                                    const INT_ID &int_id)
00118 {
00119   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00120 
00121   return this->rebind_i (ext_id,
00122                          int_id);
00123 }
00124 
00125 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
00126 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::trybind (const EXT_ID &ext_id,
00127                                                     INT_ID &int_id)
00128 {
00129   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00130 
00131   return this->trybind_i (ext_id,
00132                           int_id);
00133 }
00134 
00135 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
00136 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::find (const EXT_ID &ext_id) const
00137 {
00138   ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK> *nc_this =
00139     (ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK> *) this;
00140   ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, nc_this->lock_, -1);
00141 
00142   ACE_UINT32 slot = 0;
00143   return nc_this->find_and_return_index (ext_id, slot);
00144 }
00145 
00146 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
00147 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::find (const EXT_ID &ext_id,
00148                                                  INT_ID &int_id) const
00149 {
00150   ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK> *nc_this =
00151     (ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK> *) this;
00152   ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, nc_this->lock_, -1);
00153 
00154   return nc_this->find_i (ext_id, int_id);
00155 }
00156 
00157 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
00158 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::unbind_i (const EXT_ID &ext_id)
00159 {
00160   // Unbind the entry.
00161   ACE_UINT32 slot = 0;
00162   return this->unbind_and_return_index (ext_id,
00163                                         slot);
00164 }
00165 
00166 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
00167 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::unbind (const EXT_ID &ext_id,
00168                                                    INT_ID &int_id)
00169 {
00170   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00171 
00172   return this->unbind_i (ext_id,
00173                          int_id);
00174 }
00175 
00176 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
00177 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::unbind (const EXT_ID &ext_id)
00178 {
00179   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00180   return this->unbind_i (ext_id);
00181 }
00182 
00183 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE size_t
00184 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::current_size (void) const
00185 {
00186   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, static_cast<size_t> (-1));
00187   return this->cur_size_;
00188 }
00189 
00190 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE size_t
00191 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::total_size (void) const
00192 {
00193   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, static_cast<size_t> (-1));
00194   return this->total_size_;
00195 }
00196 
00197 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE ACE_LOCK &
00198 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::mutex (void)
00199 {
00200   return this->lock_;
00201 }
00202 
00203 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE void
00204 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::move_from_free_list_to_occupied_list (ACE_UINT32 slot)
00205 {
00206   this->shared_move (slot,
00207                      this->free_list_,
00208                      this->free_list_id (),
00209                      this->occupied_list_,
00210                      this->occupied_list_id ());
00211 }
00212 
00213 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE void
00214 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::move_from_occupied_list_to_free_list (ACE_UINT32 slot)
00215 {
00216   this->shared_move (slot,
00217                      this->occupied_list_,
00218                      this->occupied_list_id (),
00219                      this->free_list_,
00220                      this->free_list_id ());
00221 }
00222 
00223 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
00224 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::equal (const EXT_ID &id1,
00225                                                   const EXT_ID &id2)
00226 {
00227   return id1 == id2;
00228 }
00229 
00230 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE ACE_UINT32
00231 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::free_list_id (void) const
00232 {
00233   // If you change ~0, please change
00234   // ACE_Active_Map_Manager_Key::ACE_Active_Map_Manager_Key()
00235   // accordingly.
00236   return (ACE_UINT32) ~0;
00237 }
00238 
00239 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE ACE_UINT32
00240 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::occupied_list_id (void) const
00241 {
00242   return (ACE_UINT32) ~1;
00243 }
00244 
00245 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00246 ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>
00247 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::begin (void)
00248 {
00249   return ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> (*this);
00250 }
00251 
00252 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00253 ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>
00254 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::end (void)
00255 {
00256   return ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> (*this, 1);
00257 }
00258 
00259 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00260 ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>
00261 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::rbegin (void)
00262 {
00263   return ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> (*this);
00264 }
00265 
00266 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00267 ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>
00268 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::rend (void)
00269 {
00270   return ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> (*this, 1);
00271 }
00272 
00273 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00274 ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::ACE_Map_Iterator_Base (ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK> &mm)
00275   : map_man_ (&mm),
00276     next_ (this->map_man_->occupied_list_id ())
00277 {
00278 }
00279 
00280 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
00281 ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::next (ACE_Map_Entry<EXT_ID, INT_ID> *&mm) const
00282 {
00283   if (this->next_ != this->map_man_->occupied_list_id ())
00284     {
00285       mm = &this->map_man_->search_structure_[this->next_];
00286       return 1;
00287     }
00288   else
00289     return 0;
00290 }
00291 
00292 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
00293 ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::done (void) const
00294 {
00295   return this->next_ == this->map_man_->occupied_list_id ();
00296 }
00297 
00298 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
00299 ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::forward_i (void)
00300 {
00301 
00302 #if defined (ACE_HAS_LAZY_MAP_MANAGER)
00303 
00304   while (1)
00305     {
00306       // Go to the next item in the list.
00307       this->next_ = this->map_man_->search_structure_[this->next_].next ();
00308 
00309       // Stop if we reach the end.
00310       if (this->done ())
00311         break;
00312 
00313       // Break if we find a non-free slot.
00314       if (!this->map_man_->search_structure_[this->next_].free_)
00315         {
00316           break;
00317         }
00318     }
00319 
00320 #else
00321 
00322   this->next_ = this->map_man_->search_structure_[this->next_].next ();
00323 
00324 #endif /* ACE_HAS_LAZY_MAP_MANAGER */
00325 
00326   return this->next_ != this->map_man_->occupied_list_id ();
00327 }
00328 
00329 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
00330 ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::reverse_i (void)
00331 {
00332 
00333 #if defined (ACE_HAS_LAZY_MAP_MANAGER)
00334 
00335   while (1)
00336     {
00337       // Go to the prev item in the list.
00338       this->next_ = this->map_man_->search_structure_[this->next_].prev ();
00339 
00340       // Stop if we reach the end.
00341       if (this->done ())
00342         break;
00343 
00344       // Break if we find a non-free slot.
00345       if (!this->map_man_->search_structure_[this->next_].free_)
00346         {
00347           break;
00348         }
00349     }
00350 
00351 #else
00352 
00353   this->next_ = this->map_man_->search_structure_[this->next_].prev ();
00354 
00355 #endif /* ACE_HAS_LAZY_MAP_MANAGER */
00356 
00357   return this->next_ != this->map_man_->occupied_list_id ();
00358 }
00359 
00360 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00361 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK> &
00362 ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::map (void)
00363 {
00364   return *this->map_man_;
00365 }
00366 
00367 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE bool
00368 ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::operator== (const ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK> &rhs) const
00369 {
00370   return (this->map_man_ == rhs.map_man_ &&
00371           this->next_ == rhs.next_);
00372 }
00373 
00374 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE bool
00375 ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::operator!= (const ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK> &rhs) const
00376 {
00377   return !this->operator== (rhs);
00378 }
00379 
00380 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00381 ACE_Map_Const_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::ACE_Map_Const_Iterator_Base (const ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK> &mm)
00382   : map_man_ (&mm),
00383     next_ (this->map_man_->occupied_list_id ())
00384 {
00385 }
00386 
00387 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
00388 ACE_Map_Const_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::next (ACE_Map_Entry<EXT_ID, INT_ID> *&mm) const
00389 {
00390   if (this->next_ != this->map_man_->occupied_list_id ())
00391     {
00392       mm = &this->map_man_->search_structure_[this->next_];
00393       return 1;
00394     }
00395   else
00396     return 0;
00397 }
00398 
00399 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
00400 ACE_Map_Const_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::done (void) const
00401 {
00402   return this->next_ == this->map_man_->occupied_list_id ();
00403 }
00404 
00405 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
00406 ACE_Map_Const_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::forward_i (void)
00407 {
00408 
00409 #if defined (ACE_HAS_LAZY_MAP_MANAGER)
00410 
00411   while (1)
00412     {
00413       // Go to the next item in the list.
00414       this->next_ = this->map_man_->search_structure_[this->next_].next ();
00415 
00416       // Stop if we reach the end.
00417       if (this->done ())
00418         break;
00419 
00420       // Break if we find a non-free slot.
00421       if (!this->map_man_->search_structure_[this->next_].free_)
00422         {
00423           break;
00424         }
00425     }
00426 
00427 #else
00428 
00429   this->next_ = this->map_man_->search_structure_[this->next_].next ();
00430 
00431 #endif /* ACE_HAS_LAZY_MAP_MANAGER */
00432 
00433   return this->next_ != this->map_man_->occupied_list_id ();
00434 }
00435 
00436 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
00437 ACE_Map_Const_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::reverse_i (void)
00438 {
00439 
00440 #if defined (ACE_HAS_LAZY_MAP_MANAGER)
00441 
00442   while (1)
00443     {
00444       // Go to the prev item in the list.
00445       this->next_ = this->map_man_->search_structure_[this->next_].prev ();
00446 
00447       // Stop if we reach the end.
00448       if (this->done ())
00449         break;
00450 
00451       // Break if we find a non-free slot.
00452       if (!this->map_man_->search_structure_[this->next_].free_)
00453         {
00454           break;
00455         }
00456     }
00457 
00458 #else
00459 
00460   this->next_ = this->map_man_->search_structure_[this->next_].prev ();
00461 
00462 #endif /* ACE_HAS_LAZY_MAP_MANAGER */
00463 
00464   return this->next_ != this->map_man_->occupied_list_id ();
00465 }
00466 
00467 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00468 const ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK> &
00469 ACE_Map_Const_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::map (void) const
00470 {
00471   return *this->map_man_;
00472 }
00473 
00474 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE bool
00475 ACE_Map_Const_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::operator== (const ACE_Map_Const_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK> &rhs) const
00476 {
00477   return (this->map_man_ == rhs.map_man_ &&
00478           this->next_ == rhs.next_);
00479 }
00480 
00481 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE bool
00482 ACE_Map_Const_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::operator!= (const ACE_Map_Const_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK> &rhs) const
00483 {
00484   return !this->operator== (rhs);
00485 }
00486 
00487 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00488 ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>::ACE_Map_Iterator (ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK> &mm,
00489                                                               int pass_end)
00490   : ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK> (mm)
00491 {
00492   if (!pass_end)
00493     {
00494 
00495 #if defined (ACE_HAS_LAZY_MAP_MANAGER)
00496 
00497       // Start here.
00498       this->next_ = this->map_man_->occupied_list_.next ();
00499 
00500       while (1)
00501         {
00502           // Stop if we reach the end.
00503           if (this->done ())
00504             break;
00505 
00506           // Break if we find a non-free slot.
00507           if (!this->map_man_->search_structure_[this->next_].free_)
00508             {
00509               break;
00510             }
00511 
00512           // Go to the next item in the list.
00513           this->next_ = this->map_man_->search_structure_[this->next_].next ();
00514         }
00515 
00516 #else
00517 
00518       this->next_ = this->map_man_->occupied_list_.next ();
00519 
00520 #endif /* ACE_HAS_LAZY_MAP_MANAGER */
00521 
00522     }
00523 }
00524 
00525 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
00526 ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>::advance (void)
00527 {
00528   return this->forward_i ();
00529 }
00530 
00531 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00532 ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> &
00533 ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator++ (void)
00534 {
00535   this->forward_i ();
00536   return *this;
00537 }
00538 
00539 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00540 ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>
00541 ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator++ (int)
00542 {
00543   ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> retv (*this);
00544   ++*this;
00545   return retv;
00546 }
00547 
00548 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00549 ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> &
00550 ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator-- (void)
00551 {
00552   this->reverse_i ();
00553   return *this;
00554 }
00555 
00556 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00557 ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>
00558 ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator-- (int)
00559 {
00560   ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> retv (*this);
00561   --*this;
00562   return retv;
00563 }
00564 
00565 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00566 ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK>::ACE_Map_Const_Iterator (const ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK> &mm,
00567                                                                           int pass_end)
00568   : ACE_Map_Const_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK> (mm)
00569 {
00570   if (!pass_end)
00571     {
00572 
00573 #if defined (ACE_HAS_LAZY_MAP_MANAGER)
00574 
00575       // Start here.
00576       this->next_ = this->map_man_->occupied_list_.next ();
00577 
00578       while (1)
00579         {
00580           // Stop if we reach the end.
00581           if (this->done ())
00582             break;
00583 
00584           // Break if we find a non-free slot.
00585           if (!this->map_man_->search_structure_[this->next_].free_)
00586             {
00587               break;
00588             }
00589 
00590           // Go to the next item in the list.
00591           this->next_ = this->map_man_->search_structure_[this->next_].next ();
00592         }
00593 
00594 #else
00595 
00596       this->next_ = this->map_man_->occupied_list_.next ();
00597 
00598 #endif /* ACE_HAS_LAZY_MAP_MANAGER */
00599 
00600     }
00601 }
00602 
00603 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
00604 ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK>::advance (void)
00605 {
00606   return this->forward_i ();
00607 }
00608 
00609 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00610 ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK> &
00611 ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator++ (void)
00612 {
00613   this->forward_i ();
00614   return *this;
00615 }
00616 
00617 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00618 ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK>
00619 ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator++ (int)
00620 {
00621   ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK> retv (*this);
00622   ++*this;
00623   return retv;
00624 }
00625 
00626 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00627 ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK> &
00628 ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator-- (void)
00629 {
00630   this->reverse_i ();
00631   return *this;
00632 }
00633 
00634 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00635 ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK>
00636 ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator-- (int)
00637 {
00638   ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK> retv (*this);
00639   --*this;
00640   return retv;
00641 }
00642 
00643 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00644 ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>::ACE_Map_Reverse_Iterator (ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK> &mm,
00645                                                                               int pass_end)
00646   : ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK> (mm)
00647 {
00648   if (!pass_end)
00649     {
00650 
00651 #if defined (ACE_HAS_LAZY_MAP_MANAGER)
00652 
00653       // Start here.
00654       this->next_ = this->map_man_->occupied_list_.prev ();
00655 
00656       while (1)
00657         {
00658           // Stop if we reach the end.
00659           if (this->done ())
00660             break;
00661 
00662           // Break if we find a non-free slot.
00663           if (!this->map_man_->search_structure_[this->next_].free_)
00664             {
00665               break;
00666             }
00667 
00668           // Go to the prev item in the list.
00669           this->next_ = this->map_man_->search_structure_[this->next_].prev ();
00670         }
00671 
00672 #else
00673 
00674       this->next_ = this->map_man_->occupied_list_.prev ();
00675 
00676 #endif /* ACE_HAS_LAZY_MAP_MANAGER */
00677 
00678 }
00679 }
00680 
00681 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
00682 ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>::advance (void)
00683 {
00684   return this->reverse_i ();
00685 }
00686 
00687 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00688 ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> &
00689 ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator++ (void)
00690 {
00691   this->reverse_i ();
00692   return *this;
00693 }
00694 
00695 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00696 ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>
00697 ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator++ (int)
00698 {
00699   ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> retv (*this);
00700   ++*this;
00701   return retv;
00702 }
00703 
00704 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00705 ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> &
00706 ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator-- (void)
00707 {
00708   this->forward_i ();
00709   return *this;
00710 }
00711 
00712 template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE
00713 ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>
00714 ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>::operator-- (int)
00715 {
00716   ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> retv (*this);
00717   --*this;
00718   return retv;
00719 }
00720 
00721 ACE_END_VERSIONED_NAMESPACE_DECL

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