Map_Manager.inl

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

Generated on Tue Feb 2 17:18:40 2010 for ACE by  doxygen 1.4.7