Initial Patch of Auction House bot rev. 135
[auctionmangos.git] / dep / ACE_wrappers / ace / Map_T.cpp
blobef3184c5c2e68b3bcb67ca0b59d1039208513d88
1 // $Id: Map_T.cpp 80826 2008-03-04 14:51:23Z wotte $
3 #ifndef ACE_MAP_T_CPP
4 #define ACE_MAP_T_CPP
6 #include "ace/Map_T.h"
8 #if !defined (ACE_LACKS_PRAGMA_ONCE)
9 # pragma once
10 #endif /* ACE_LACKS_PRAGMA_ONCE */
12 #if !defined (__ACE_INLINE__)
13 #include "ace/Map_T.inl"
14 #endif /* __ACE_INLINE__ */
16 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
18 template <class KEY, class VALUE>
19 ACE_Map<KEY, VALUE>::~ACE_Map (void)
23 template <class T>
24 ACE_Iterator_Impl<T>::~ACE_Iterator_Impl (void)
28 template <class T>
29 ACE_Reverse_Iterator_Impl<T>::~ACE_Reverse_Iterator_Impl (void)
33 template <class T, class IMPLEMENTATION, class ENTRY>
34 ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::~ACE_Map_Impl_Iterator_Adapter (void)
39 template <class T, class IMPLEMENTATION, class ENTRY> ACE_Iterator_Impl<T> *
40 ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::clone (void) const
42 ACE_Iterator_Impl<T> *temp = 0;
43 ACE_NEW_RETURN (temp,
44 (ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>) (*this),
45 0);
46 return temp;
49 template <class T, class IMPLEMENTATION, class ENTRY> int
50 ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::compare (const ACE_Iterator_Impl<T> &rhs) const
52 const ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY> &rhs_local
53 = dynamic_cast<const ACE_Map_Impl_Iterator_Adapter< T, IMPLEMENTATION, ENTRY> &> (rhs);
55 return this->implementation_ == rhs_local.implementation_;
58 template <class T, class IMPLEMENTATION, class ENTRY> T
59 ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::dereference () const
61 ENTRY &entry = *this->implementation_;
62 return T (entry.ext_id_,
63 entry.int_id_);
66 template <class T, class IMPLEMENTATION, class ENTRY> void
67 ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::plus_plus (void)
69 ++this->implementation_;
72 template <class T, class IMPLEMENTATION, class ENTRY> void
73 ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::minus_minus (void)
75 --this->implementation_;
78 template <class T, class IMPLEMENTATION, class ENTRY>
79 ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::~ACE_Map_Impl_Reverse_Iterator_Adapter (void)
83 template <class T, class IMPLEMENTATION, class ENTRY> ACE_Reverse_Iterator_Impl<T> *
84 ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::clone (void) const
86 ACE_Reverse_Iterator_Impl<T> *temp = 0;
87 ACE_NEW_RETURN (temp,
88 (ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>) (*this),
89 0);
90 return temp;
94 template <class T, class IMPLEMENTATION, class ENTRY> int
95 ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::compare (const ACE_Reverse_Iterator_Impl<T> &rhs) const
97 const ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY> &rhs_local
98 = dynamic_cast<const ACE_Map_Impl_Reverse_Iterator_Adapter< T, IMPLEMENTATION, ENTRY> &> (rhs);
100 return this->implementation_ == rhs_local.implementation_;
103 template <class T, class IMPLEMENTATION, class ENTRY> T
104 ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::dereference () const
106 ENTRY &entry = *this->implementation_;
107 return T (entry.ext_id_,
108 entry.int_id_);
111 template <class T, class IMPLEMENTATION, class ENTRY> void
112 ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::plus_plus (void)
114 ++this->implementation_;
117 template <class T, class IMPLEMENTATION, class ENTRY> void
118 ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::minus_minus (void)
120 --this->implementation_;
124 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY>
125 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::~ACE_Map_Impl (void)
129 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
130 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::open (size_t length,
131 ACE_Allocator *alloc)
133 return this->implementation_.open (length,
134 alloc);
137 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
138 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::close (void)
140 return this->implementation_.close ();
143 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
144 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::bind (const KEY &key,
145 const VALUE &value)
147 return this->implementation_.bind (key,
148 value);
151 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
152 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::bind_modify_key (const VALUE &value,
153 KEY &key)
155 return this->implementation_.bind_modify_key (value,
156 key);
159 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
160 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::create_key (KEY &key)
162 return this->implementation_.create_key (key);
165 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
166 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::bind_create_key (const VALUE &value,
167 KEY &key)
169 return this->implementation_.bind_create_key (value,
170 key);
173 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
174 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::bind_create_key (const VALUE &value)
176 return this->implementation_.bind_create_key (value);
179 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
180 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::recover_key (const KEY &modified_key,
181 KEY &original_key)
183 return this->implementation_.recover_key (modified_key,
184 original_key);
187 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
188 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::rebind (const KEY &key,
189 const VALUE &value)
191 return this->implementation_.rebind (key,
192 value);
195 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
196 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::rebind (const KEY &key,
197 const VALUE &value,
198 VALUE &old_value)
200 return this->implementation_.rebind (key,
201 value,
202 old_value);
205 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
206 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::rebind (const KEY &key,
207 const VALUE &value,
208 KEY &old_key,
209 VALUE &old_value)
211 return this->implementation_.rebind (key,
212 value,
213 old_key,
214 old_value);
217 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
218 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::trybind (const KEY &key,
219 VALUE &value)
221 return this->implementation_.trybind (key,
222 value);
225 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
226 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::find (const KEY &key,
227 VALUE &value)
229 return this->implementation_.find (key,
230 value);
233 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
234 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::find (const KEY &key)
236 return this->implementation_.find (key);
239 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
240 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::unbind (const KEY &key)
242 return this->implementation_.unbind (key);
245 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
246 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::unbind (const KEY &key,
247 VALUE &value)
249 return this->implementation_.unbind (key,
250 value);
253 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> size_t
254 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::current_size (void) const
256 return this->implementation_.current_size ();
259 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> size_t
260 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::total_size (void) const
262 return this->implementation_.total_size ();
265 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> void
266 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::dump (void) const
268 #if defined (ACE_HAS_DUMP)
269 this->implementation_.dump ();
270 #endif /* ACE_HAS_DUMP */
273 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
274 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::begin_impl (void)
276 ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
277 ACE_NEW_RETURN (temp,
278 iterator_impl (this->implementation_.begin ()),
280 return temp;
283 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
284 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::end_impl (void)
286 ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
287 ACE_NEW_RETURN (temp,
288 iterator_impl (this->implementation_.end ()),
290 return temp;
293 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
294 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::rbegin_impl (void)
296 ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
297 ACE_NEW_RETURN (temp,
298 reverse_iterator_impl (this->implementation_.rbegin ()),
300 return temp;
303 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
304 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::rend_impl (void)
306 ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
307 ACE_NEW_RETURN (temp,
308 reverse_iterator_impl (this->implementation_.rend ()),
310 return temp;
313 template <class T, class VALUE>
314 ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::~ACE_Active_Map_Manager_Iterator_Adapter (void)
318 template <class T, class VALUE> ACE_Iterator_Impl<T> *
319 ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::clone (void) const
321 ACE_Iterator_Impl<T> *temp = 0;
322 ACE_NEW_RETURN (temp,
323 (ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>) (*this),
325 return temp;
329 template <class T, class VALUE> int
330 ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::compare (const ACE_Iterator_Impl<T> &rhs) const
332 const ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE> &rhs_local
333 = dynamic_cast<const ACE_Active_Map_Manager_Iterator_Adapter< T, VALUE> &> (rhs);
335 return this->implementation_ == rhs_local.implementation_;
338 template <class T, class VALUE> T
339 ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::dereference () const
341 // The following syntax is necessary to work around certain broken compilers.
342 // In particular, please do not prefix implementation_ with this->
343 return T ((*implementation_).int_id_.first (),
344 (*implementation_).int_id_.second ());
347 template <class T, class VALUE> void
348 ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::plus_plus (void)
350 ++this->implementation_;
353 template <class T, class VALUE> void
354 ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::minus_minus (void)
356 --this->implementation_;
359 template <class T, class VALUE>
360 ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::~ACE_Active_Map_Manager_Reverse_Iterator_Adapter (void)
364 template <class T, class VALUE> ACE_Reverse_Iterator_Impl<T> *
365 ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::clone (void) const
367 ACE_Reverse_Iterator_Impl<T> *temp = 0;
368 ACE_NEW_RETURN (temp,
369 (ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>) (*this),
371 return temp;
375 template <class T, class VALUE> int
376 ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::compare (const ACE_Reverse_Iterator_Impl<T> &rhs) const
378 const ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE> &rhs_local
379 = dynamic_cast<const ACE_Active_Map_Manager_Reverse_Iterator_Adapter< T, VALUE> &> (rhs);
381 return this->implementation_ == rhs_local.implementation_;
384 template <class T, class VALUE> T
385 ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::dereference () const
387 // The following syntax is necessary to work around certain broken compilers.
388 // In particular, please do not prefix implementation_ with this->
389 return T ((*implementation_).int_id_.first (),
390 (*implementation_).int_id_.second ());
393 template <class T, class VALUE> void
394 ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::plus_plus (void)
396 ++this->implementation_;
399 template <class T, class VALUE> void
400 ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::minus_minus (void)
402 --this->implementation_;
405 template <class KEY, class VALUE, class KEY_ADAPTER>
406 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::~ACE_Active_Map_Manager_Adapter (void)
410 template <class KEY, class VALUE, class KEY_ADAPTER> int
411 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::open (size_t length,
412 ACE_Allocator *alloc)
414 return this->implementation_.open (length,
415 alloc);
418 template <class KEY, class VALUE, class KEY_ADAPTER> int
419 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::close (void)
421 return this->implementation_.close ();
424 template <class KEY, class VALUE, class KEY_ADAPTER> int
425 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::bind (const KEY &,
426 const VALUE &)
428 ACE_NOTSUP_RETURN (-1);
431 template <class KEY, class VALUE, class KEY_ADAPTER> int
432 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::bind_modify_key (const VALUE &value,
433 KEY &key)
435 // Reserve a slot and create an active key.
436 expanded_value *internal_value = 0;
437 ACE_Active_Map_Manager_Key active_key;
438 int result = this->implementation_.bind (active_key,
439 internal_value);
440 if (result == 0)
442 // Encode the active key and the existing user key into key part
443 // of <expanded_value>.
444 result = this->key_adapter_.encode (key,
445 active_key,
446 internal_value->first ());
447 if (result == 0)
449 // Copy user value into <expanded_value>.
450 internal_value->second (value);
451 // Copy new, modified key back to the user key.
452 key = internal_value->first ();
454 else
456 // In case of errors, unbind from map.
457 this->implementation_.unbind (active_key);
461 return result;
464 template <class KEY, class VALUE, class KEY_ADAPTER> int
465 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::create_key (KEY &)
467 ACE_NOTSUP_RETURN (-1);
470 template <class KEY, class VALUE, class KEY_ADAPTER> int
471 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::bind_create_key (const VALUE &value,
472 KEY &key)
474 // Reserve a slot and create an active key.
475 expanded_value *internal_value = 0;
476 ACE_Active_Map_Manager_Key active_key;
477 int result = this->implementation_.bind (active_key,
478 internal_value);
479 if (result == 0)
481 // Encode the active key into key part of <expanded_value>.
482 result = this->key_adapter_.encode (internal_value->first (),
483 active_key,
484 internal_value->first ());
485 if (result == 0)
487 // Copy user value into <expanded_value>.
488 internal_value->second (value);
489 // Copy new, modified key to the user key.
490 key = internal_value->first ();
492 else
494 // In case of errors, unbind from map.
495 this->implementation_.unbind (active_key);
499 return result;
502 template <class KEY, class VALUE, class KEY_ADAPTER> int
503 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::bind_create_key (const VALUE &value)
505 // Reserve a slot and create an active key.
506 expanded_value *internal_value = 0;
507 ACE_Active_Map_Manager_Key active_key;
508 int result = this->implementation_.bind (active_key,
509 internal_value);
510 if (result == 0)
512 // Encode the active key into key part of <expanded_value>.
513 result = this->key_adapter_.encode (internal_value->first (),
514 active_key,
515 internal_value->first ());
516 if (result == 0)
518 // Copy user value into <expanded_value>.
519 internal_value->second (value);
521 else
523 // In case of errors, unbind from map.
524 this->implementation_.unbind (active_key);
528 return result;
531 template <class KEY, class VALUE, class KEY_ADAPTER> int
532 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::recover_key (const KEY &modified_key,
533 KEY &original_key)
535 // Ask the <key_adapter_> to help out with recovering the original
536 // user key, since it was the one that encode it in the first place.
537 return this->key_adapter_.decode (modified_key,
538 original_key);
541 template <class KEY, class VALUE, class KEY_ADAPTER> int
542 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::find (const KEY &key,
543 expanded_value *&internal_value)
545 // Ask the <key_adapter_> to recover the active key.
546 ACE_Active_Map_Manager_Key active_key;
547 int result = this->key_adapter_.decode (key,
548 active_key);
549 if (result == 0)
551 // Find recovered active key in map.
552 result = this->implementation_.find (active_key,
553 internal_value);
556 return result;
559 template <class KEY, class VALUE, class KEY_ADAPTER> int
560 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::find (const KEY &key,
561 VALUE &value)
563 expanded_value *internal_value = 0;
564 int result = this->find (key,
565 internal_value);
567 if (result == 0)
569 // Copy value.
570 value = internal_value->second ();
573 return result;
576 template <class KEY, class VALUE, class KEY_ADAPTER> int
577 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::find (const KEY &key)
579 expanded_value *internal_value = 0;
580 return this->find (key,
581 internal_value);
584 template <class KEY, class VALUE, class KEY_ADAPTER> int
585 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::rebind (const KEY &key,
586 const VALUE &value)
588 expanded_value *internal_value = 0;
589 int result = this->find (key,
590 internal_value);
592 if (result == 0)
594 // Reset value.
595 internal_value->second (value);
598 return result;
601 template <class KEY, class VALUE, class KEY_ADAPTER> int
602 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::rebind (const KEY &key,
603 const VALUE &value,
604 VALUE &old_value)
606 expanded_value *internal_value = 0;
607 int result = this->find (key,
608 internal_value);
610 if (result == 0)
612 // Copy old value.
613 old_value = internal_value->second ();
615 // Reset to new value.
616 internal_value->second (value);
619 return result;
622 template <class KEY, class VALUE, class KEY_ADAPTER> int
623 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::rebind (const KEY &key,
624 const VALUE &value,
625 KEY &old_key,
626 VALUE &old_value)
628 expanded_value *internal_value = 0;
629 int result = this->find (key,
630 internal_value);
632 if (result == 0)
634 // Copy old key and value.
635 old_key = internal_value->first ();
636 old_value = internal_value->second ();
638 // Reset to new value.
639 internal_value->second (value);
642 return result;
645 template <class KEY, class VALUE, class KEY_ADAPTER> int
646 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::trybind (const KEY &,
647 VALUE &)
649 ACE_NOTSUP_RETURN (-1);
652 template <class KEY, class VALUE, class KEY_ADAPTER> int
653 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::unbind (const KEY &key,
654 expanded_value *&internal_value)
656 // Ask the <key_adapter_> to recover the active key.
657 ACE_Active_Map_Manager_Key active_key;
658 int result = this->key_adapter_.decode (key,
659 active_key);
660 if (result == 0)
662 // Unbind recovered active key from map.
663 result = this->implementation_.unbind (active_key,
664 internal_value);
667 return result;
670 template <class KEY, class VALUE, class KEY_ADAPTER> int
671 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::unbind (const KEY &key)
673 expanded_value *internal_value = 0;
674 return this->unbind (key,
675 internal_value);
678 template <class KEY, class VALUE, class KEY_ADAPTER> int
679 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::unbind (const KEY &key,
680 VALUE &value)
682 expanded_value *internal_value = 0;
683 int result = this->unbind (key,
684 internal_value);
686 if (result == 0)
688 // Copy value.
689 value = internal_value->second ();
692 return result;
695 template <class KEY, class VALUE, class KEY_ADAPTER> size_t
696 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::current_size (void) const
698 return this->implementation_.current_size ();
701 template <class KEY, class VALUE, class KEY_ADAPTER> size_t
702 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::total_size (void) const
704 return this->implementation_.total_size ();
707 template <class KEY, class VALUE, class KEY_ADAPTER> void
708 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::dump (void) const
710 #if defined (ACE_HAS_DUMP)
711 this->implementation_.dump ();
712 #endif /* ACE_HAS_DUMP */
715 template <class KEY, class VALUE, class KEY_ADAPTER> ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
716 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::begin_impl (void)
718 ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
719 ACE_NEW_RETURN (temp,
720 iterator_impl (this->implementation_.begin ()),
722 return temp;
725 template <class KEY, class VALUE, class KEY_ADAPTER> ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
726 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::end_impl (void)
728 ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
729 ACE_NEW_RETURN (temp,
730 iterator_impl (this->implementation_.end ()),
732 return temp;
735 template <class KEY, class VALUE, class KEY_ADAPTER> ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
736 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::rbegin_impl (void)
738 ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
739 ACE_NEW_RETURN (temp,
740 reverse_iterator_impl (this->implementation_.rbegin ()),
742 return temp;
745 template <class KEY, class VALUE, class KEY_ADAPTER> ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
746 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::rend_impl (void)
748 ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
749 ACE_NEW_RETURN (temp,
750 reverse_iterator_impl (this->implementation_.rend ()),
752 return temp;
755 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS>
756 ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::~ACE_Hash_Map_Manager_Ex_Iterator_Adapter (void)
760 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> ACE_Iterator_Impl<T> *
761 ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::clone (void) const
763 ACE_Iterator_Impl<T> *temp = 0;
764 ACE_NEW_RETURN (temp,
765 (ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>) (*this),
767 return temp;
771 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> int
772 ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::compare (const ACE_Iterator_Impl<T> &rhs) const
774 const ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS> &rhs_local
775 = dynamic_cast<const ACE_Hash_Map_Manager_Ex_Iterator_Adapter< T, KEY, VALUE, HASH_KEY, COMPARE_KEYS> &> (rhs);
777 return this->implementation_ == rhs_local.implementation_;
780 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> T
781 ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::dereference () const
783 // The following syntax is necessary to work around certain broken compilers.
784 // In particular, please do not prefix implementation_ with this->
785 return T ((*implementation_).ext_id_,
786 (*implementation_).int_id_);
789 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> void
790 ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::plus_plus (void)
792 ++this->implementation_;
795 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> void
796 ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::minus_minus (void)
798 --this->implementation_;
801 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS>
802 ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::~ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter (void)
806 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> ACE_Reverse_Iterator_Impl<T> *
807 ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::clone (void) const
809 ACE_Reverse_Iterator_Impl<T> *temp = 0;
810 ACE_NEW_RETURN (temp,
811 (ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>) (*this),
813 return temp;
817 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> int
818 ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::compare (const ACE_Reverse_Iterator_Impl<T> &rhs) const
820 const ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS> &rhs_local
821 = dynamic_cast<const ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter< T, KEY, VALUE, HASH_KEY, COMPARE_KEYS> &> (rhs);
823 return this->implementation_ == rhs_local.implementation_;
826 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> T
827 ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::dereference () const
829 // The following syntax is necessary to work around certain broken compilers.
830 // In particular, please do not prefix implementation_ with this->
831 return T ((*implementation_).ext_id_,
832 (*implementation_).int_id_);
835 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> void
836 ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::plus_plus (void)
838 ++this->implementation_;
841 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> void
842 ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::minus_minus (void)
844 --this->implementation_;
847 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR>
848 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::~ACE_Hash_Map_Manager_Ex_Adapter (void)
852 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
853 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::open (size_t length,
854 ACE_Allocator *alloc)
856 return this->implementation_.open (length,
857 alloc);
860 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
861 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::close (void)
863 return this->implementation_.close ();
866 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
867 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::bind (const KEY &key,
868 const VALUE &value)
870 return this->implementation_.bind (key,
871 value);
874 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
875 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::bind_modify_key (const VALUE &value,
876 KEY &key)
878 return this->implementation_.bind (key,
879 value);
882 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
883 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::create_key (KEY &key)
885 // Invoke the user specified key generation functor.
886 return this->key_generator_ (key);
889 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
890 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::bind_create_key (const VALUE &value,
891 KEY &key)
893 // Invoke the user specified key generation functor.
894 int result = this->key_generator_ (key);
896 if (result == 0)
898 // Try to add.
899 result = this->implementation_.bind (key,
900 value);
903 return result;
906 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
907 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::bind_create_key (const VALUE &value)
909 KEY key;
910 return this->bind_create_key (value,
911 key);
914 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
915 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::recover_key (const KEY &modified_key,
916 KEY &original_key)
918 original_key = modified_key;
919 return 0;
922 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
923 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::rebind (const KEY &key,
924 const VALUE &value)
926 return this->implementation_.rebind (key,
927 value);
930 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
931 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::rebind (const KEY &key,
932 const VALUE &value,
933 VALUE &old_value)
935 return this->implementation_.rebind (key,
936 value,
937 old_value);
940 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
941 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::rebind (const KEY &key,
942 const VALUE &value,
943 KEY &old_key,
944 VALUE &old_value)
946 return this->implementation_.rebind (key,
947 value,
948 old_key,
949 old_value);
952 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
953 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::trybind (const KEY &key,
954 VALUE &value)
956 return this->implementation_.trybind (key,
957 value);
960 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
961 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::find (const KEY &key,
962 VALUE &value)
964 return this->implementation_.find (key,
965 value);
968 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
969 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::find (const KEY &key)
971 return this->implementation_.find (key);
974 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
975 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::unbind (const KEY &key)
977 return this->implementation_.unbind (key);
980 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
981 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::unbind (const KEY &key,
982 VALUE &value)
984 return this->implementation_.unbind (key,
985 value);
988 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> size_t
989 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::current_size (void) const
991 return this->implementation_.current_size ();
994 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> size_t
995 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::total_size (void) const
997 return this->implementation_.total_size ();
1000 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> void
1001 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::dump (void) const
1003 #if defined (ACE_HAS_DUMP)
1004 this->implementation_.dump ();
1005 #endif /* ACE_HAS_DUMP */
1008 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
1009 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::begin_impl (void)
1011 ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
1012 ACE_NEW_RETURN (temp,
1013 iterator_impl (this->implementation_.begin ()),
1015 return temp;
1018 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
1019 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::end_impl (void)
1021 ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
1022 ACE_NEW_RETURN (temp,
1023 iterator_impl (this->implementation_.end ()),
1025 return temp;
1028 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
1029 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::rbegin_impl (void)
1031 ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
1032 ACE_NEW_RETURN (temp,
1033 reverse_iterator_impl (this->implementation_.rbegin ()),
1035 return temp;
1038 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
1039 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::rend_impl (void)
1041 ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
1042 ACE_NEW_RETURN (temp,
1043 reverse_iterator_impl (this->implementation_.rend ()),
1045 return temp;
1048 template <class T, class KEY, class VALUE>
1049 ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::~ACE_Map_Manager_Iterator_Adapter (void)
1053 template <class T, class KEY, class VALUE> ACE_Iterator_Impl<T> *
1054 ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::clone (void) const
1056 ACE_Iterator_Impl<T> *temp = 0;
1057 ACE_NEW_RETURN (temp,
1058 (ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>) (*this),
1060 return temp;
1064 template <class T, class KEY, class VALUE> int
1065 ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::compare (const ACE_Iterator_Impl<T> &rhs) const
1067 const ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE> &rhs_local
1068 = dynamic_cast<const ACE_Map_Manager_Iterator_Adapter< T, KEY, VALUE> &> (rhs);
1070 return this->implementation_ == rhs_local.implementation_;
1073 template <class T, class KEY, class VALUE> T
1074 ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::dereference () const
1076 // The following syntax is necessary to work around certain broken compilers.
1077 // In particular, please do not prefix implementation_ with this->
1078 return T ((*implementation_).ext_id_,
1079 (*implementation_).int_id_);
1082 template <class T, class KEY, class VALUE> void
1083 ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::plus_plus (void)
1085 ++this->implementation_;
1088 template <class T, class KEY, class VALUE> void
1089 ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::minus_minus (void)
1091 --this->implementation_;
1094 template <class T, class KEY, class VALUE>
1095 ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::~ACE_Map_Manager_Reverse_Iterator_Adapter (void)
1099 template <class T, class KEY, class VALUE> ACE_Reverse_Iterator_Impl<T> *
1100 ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::clone (void) const
1102 ACE_Reverse_Iterator_Impl<T> *temp = 0;
1103 ACE_NEW_RETURN (temp,
1104 (ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>) (*this),
1106 return temp;
1110 template <class T, class KEY, class VALUE> int
1111 ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::compare (const ACE_Reverse_Iterator_Impl<T> &rhs) const
1113 const ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE> &rhs_local
1114 = dynamic_cast<const ACE_Map_Manager_Reverse_Iterator_Adapter< T, KEY, VALUE> &> (rhs);
1116 return this->implementation_ == rhs_local.implementation_;
1119 template <class T, class KEY, class VALUE> T
1120 ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::dereference () const
1122 // The following syntax is necessary to work around certain broken compilers.
1123 // In particular, please do not prefix implementation_ with this->
1124 return T ((*implementation_).ext_id_,
1125 (*implementation_).int_id_);
1128 template <class T, class KEY, class VALUE> void
1129 ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::plus_plus (void)
1131 ++this->implementation_;
1134 template <class T, class KEY, class VALUE> void
1135 ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::minus_minus (void)
1137 --this->implementation_;
1140 template <class KEY, class VALUE, class KEY_GENERATOR>
1141 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::~ACE_Map_Manager_Adapter (void)
1145 template <class KEY, class VALUE, class KEY_GENERATOR> int
1146 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::open (size_t length,
1147 ACE_Allocator *alloc)
1149 return this->implementation_.open (length,
1150 alloc);
1153 template <class KEY, class VALUE, class KEY_GENERATOR> int
1154 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::close (void)
1156 return this->implementation_.close ();
1159 template <class KEY, class VALUE, class KEY_GENERATOR> int
1160 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::bind (const KEY &key,
1161 const VALUE &value)
1163 return this->implementation_.bind (key,
1164 value);
1167 template <class KEY, class VALUE, class KEY_GENERATOR> int
1168 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::bind_modify_key (const VALUE &value,
1169 KEY &key)
1171 return this->implementation_.bind (key,
1172 value);
1175 template <class KEY, class VALUE, class KEY_GENERATOR> int
1176 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::create_key (KEY &key)
1178 // Invoke the user specified key generation functor.
1179 return this->key_generator_ (key);
1182 template <class KEY, class VALUE, class KEY_GENERATOR> int
1183 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::bind_create_key (const VALUE &value,
1184 KEY &key)
1186 // Invoke the user specified key generation functor.
1187 int result = this->key_generator_ (key);
1189 if (result == 0)
1191 // Try to add.
1192 result = this->implementation_.bind (key,
1193 value);
1196 return result;
1199 template <class KEY, class VALUE, class KEY_GENERATOR> int
1200 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::bind_create_key (const VALUE &value)
1202 KEY key;
1203 return this->bind_create_key (value,
1204 key);
1207 template <class KEY, class VALUE, class KEY_GENERATOR> int
1208 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::recover_key (const KEY &modified_key,
1209 KEY &original_key)
1211 original_key = modified_key;
1212 return 0;
1215 template <class KEY, class VALUE, class KEY_GENERATOR> int
1216 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::rebind (const KEY &key,
1217 const VALUE &value)
1219 return this->implementation_.rebind (key,
1220 value);
1223 template <class KEY, class VALUE, class KEY_GENERATOR> int
1224 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::rebind (const KEY &key,
1225 const VALUE &value,
1226 VALUE &old_value)
1228 return this->implementation_.rebind (key,
1229 value,
1230 old_value);
1233 template <class KEY, class VALUE, class KEY_GENERATOR> int
1234 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::rebind (const KEY &key,
1235 const VALUE &value,
1236 KEY &old_key,
1237 VALUE &old_value)
1239 return this->implementation_.rebind (key,
1240 value,
1241 old_key,
1242 old_value);
1245 template <class KEY, class VALUE, class KEY_GENERATOR> int
1246 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::trybind (const KEY &key,
1247 VALUE &value)
1249 return this->implementation_.trybind (key,
1250 value);
1253 template <class KEY, class VALUE, class KEY_GENERATOR> int
1254 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::find (const KEY &key,
1255 VALUE &value)
1257 return this->implementation_.find (key,
1258 value);
1261 template <class KEY, class VALUE, class KEY_GENERATOR> int
1262 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::find (const KEY &key)
1264 return this->implementation_.find (key);
1267 template <class KEY, class VALUE, class KEY_GENERATOR> int
1268 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::unbind (const KEY &key)
1270 return this->implementation_.unbind (key);
1273 template <class KEY, class VALUE, class KEY_GENERATOR> int
1274 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::unbind (const KEY &key,
1275 VALUE &value)
1277 return this->implementation_.unbind (key,
1278 value);
1281 template <class KEY, class VALUE, class KEY_GENERATOR> size_t
1282 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::current_size (void) const
1284 return this->implementation_.current_size ();
1287 template <class KEY, class VALUE, class KEY_GENERATOR> size_t
1288 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::total_size (void) const
1290 return this->implementation_.total_size ();
1293 template <class KEY, class VALUE, class KEY_GENERATOR> void
1294 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::dump (void) const
1296 #if defined (ACE_HAS_DUMP)
1297 this->implementation_.dump ();
1298 #endif /* ACE_HAS_DUMP */
1301 template <class KEY, class VALUE, class KEY_GENERATOR> ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
1302 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::begin_impl (void)
1304 ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
1305 ACE_NEW_RETURN (temp,
1306 iterator_impl (this->implementation_.begin ()),
1308 return temp;
1311 template <class KEY, class VALUE, class KEY_GENERATOR> ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
1312 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::end_impl (void)
1314 ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
1315 ACE_NEW_RETURN (temp,
1316 iterator_impl (this->implementation_.end ()),
1318 return temp;
1321 template <class KEY, class VALUE, class KEY_GENERATOR> ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
1322 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::rbegin_impl (void)
1324 ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
1325 ACE_NEW_RETURN (temp,
1326 reverse_iterator_impl (this->implementation_.rbegin ()),
1328 return temp;
1331 template <class KEY, class VALUE, class KEY_GENERATOR> ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
1332 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::rend_impl (void)
1334 ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
1335 ACE_NEW_RETURN (temp,
1336 reverse_iterator_impl (this->implementation_.rend ()),
1338 return temp;
1341 ACE_END_VERSIONED_NAMESPACE_DECL
1343 #endif /* ACE_MAP_T_CPP */