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