Removed ACE_HAS_BSTRING, not used
[ACE_TAO.git] / ACE / ace / Map_T.cpp
blobf67f07ef8f81b150c9b36e51ca43b6af445edbdc
1 #ifndef ACE_MAP_T_CPP
2 #define ACE_MAP_T_CPP
4 #include "ace/Map_T.h"
6 #if !defined (ACE_LACKS_PRAGMA_ONCE)
7 # pragma once
8 #endif /* ACE_LACKS_PRAGMA_ONCE */
10 #if !defined (__ACE_INLINE__)
11 #include "ace/Map_T.inl"
12 #endif /* __ACE_INLINE__ */
14 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
16 template <class KEY, class VALUE>
17 ACE_Map<KEY, VALUE>::~ACE_Map (void)
21 template <class T>
22 ACE_Iterator_Impl<T>::~ACE_Iterator_Impl (void)
26 template <class T>
27 ACE_Reverse_Iterator_Impl<T>::~ACE_Reverse_Iterator_Impl (void)
31 template <class T, class IMPLEMENTATION, class ENTRY>
32 ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::~ACE_Map_Impl_Iterator_Adapter (void)
37 template <class T, class IMPLEMENTATION, class ENTRY> ACE_Iterator_Impl<T> *
38 ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::clone (void) const
40 ACE_Iterator_Impl<T> *temp = 0;
41 ACE_NEW_RETURN (temp,
42 (ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>) (*this),
43 0);
44 return temp;
47 template <class T, class IMPLEMENTATION, class ENTRY> int
48 ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::compare (const ACE_Iterator_Impl<T> &rhs) const
50 const ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY> &rhs_local
51 = dynamic_cast<const ACE_Map_Impl_Iterator_Adapter< T, IMPLEMENTATION, ENTRY> &> (rhs);
53 return this->implementation_ == rhs_local.implementation_;
56 template <class T, class IMPLEMENTATION, class ENTRY> T
57 ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::dereference () const
59 ENTRY &entry = *this->implementation_;
60 return T (entry.ext_id_,
61 entry.int_id_);
64 template <class T, class IMPLEMENTATION, class ENTRY> void
65 ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::plus_plus (void)
67 ++this->implementation_;
70 template <class T, class IMPLEMENTATION, class ENTRY> void
71 ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::minus_minus (void)
73 --this->implementation_;
76 template <class T, class IMPLEMENTATION, class ENTRY>
77 ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::~ACE_Map_Impl_Reverse_Iterator_Adapter (void)
81 template <class T, class IMPLEMENTATION, class ENTRY> ACE_Reverse_Iterator_Impl<T> *
82 ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::clone (void) const
84 ACE_Reverse_Iterator_Impl<T> *temp = 0;
85 ACE_NEW_RETURN (temp,
86 (ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>) (*this),
87 0);
88 return temp;
92 template <class T, class IMPLEMENTATION, class ENTRY> int
93 ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::compare (const ACE_Reverse_Iterator_Impl<T> &rhs) const
95 const ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY> &rhs_local
96 = dynamic_cast<const ACE_Map_Impl_Reverse_Iterator_Adapter< T, IMPLEMENTATION, ENTRY> &> (rhs);
98 return this->implementation_ == rhs_local.implementation_;
101 template <class T, class IMPLEMENTATION, class ENTRY> T
102 ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::dereference () const
104 ENTRY &entry = *this->implementation_;
105 return T (entry.ext_id_,
106 entry.int_id_);
109 template <class T, class IMPLEMENTATION, class ENTRY> void
110 ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::plus_plus (void)
112 ++this->implementation_;
115 template <class T, class IMPLEMENTATION, class ENTRY> void
116 ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::minus_minus (void)
118 --this->implementation_;
122 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY>
123 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::~ACE_Map_Impl (void)
127 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
128 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::open (size_t length,
129 ACE_Allocator *alloc)
131 return this->implementation_.open (length,
132 alloc);
135 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
136 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::close (void)
138 return this->implementation_.close ();
141 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
142 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::bind (const KEY &key,
143 const VALUE &value)
145 return this->implementation_.bind (key,
146 value);
149 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
150 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::bind_modify_key (const VALUE &value,
151 KEY &key)
153 return this->implementation_.bind_modify_key (value,
154 key);
157 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
158 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::create_key (KEY &key)
160 return this->implementation_.create_key (key);
163 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
164 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::bind_create_key (const VALUE &value,
165 KEY &key)
167 return this->implementation_.bind_create_key (value,
168 key);
171 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
172 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::bind_create_key (const VALUE &value)
174 return this->implementation_.bind_create_key (value);
177 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
178 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::recover_key (const KEY &modified_key,
179 KEY &original_key)
181 return this->implementation_.recover_key (modified_key,
182 original_key);
185 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
186 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::rebind (const KEY &key,
187 const VALUE &value)
189 return this->implementation_.rebind (key,
190 value);
193 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
194 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::rebind (const KEY &key,
195 const VALUE &value,
196 VALUE &old_value)
198 return this->implementation_.rebind (key,
199 value,
200 old_value);
203 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
204 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::rebind (const KEY &key,
205 const VALUE &value,
206 KEY &old_key,
207 VALUE &old_value)
209 return this->implementation_.rebind (key,
210 value,
211 old_key,
212 old_value);
215 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
216 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::trybind (const KEY &key,
217 VALUE &value)
219 return this->implementation_.trybind (key,
220 value);
223 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
224 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::find (const KEY &key,
225 VALUE &value)
227 return this->implementation_.find (key,
228 value);
231 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
232 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::find (const KEY &key)
234 return this->implementation_.find (key);
237 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
238 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::unbind (const KEY &key)
240 return this->implementation_.unbind (key);
243 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
244 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::unbind (const KEY &key,
245 VALUE &value)
247 return this->implementation_.unbind (key,
248 value);
251 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> size_t
252 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::current_size (void) const
254 return this->implementation_.current_size ();
257 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> size_t
258 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::total_size (void) const
260 return this->implementation_.total_size ();
263 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> void
264 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::dump (void) const
266 #if defined (ACE_HAS_DUMP)
267 this->implementation_.dump ();
268 #endif /* ACE_HAS_DUMP */
271 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
272 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::begin_impl (void)
274 ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
275 ACE_NEW_RETURN (temp,
276 iterator_impl (this->implementation_.begin ()),
278 return temp;
281 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
282 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::end_impl (void)
284 ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
285 ACE_NEW_RETURN (temp,
286 iterator_impl (this->implementation_.end ()),
288 return temp;
291 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
292 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::rbegin_impl (void)
294 ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
295 ACE_NEW_RETURN (temp,
296 reverse_iterator_impl (this->implementation_.rbegin ()),
298 return temp;
301 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
302 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::rend_impl (void)
304 ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
305 ACE_NEW_RETURN (temp,
306 reverse_iterator_impl (this->implementation_.rend ()),
308 return temp;
311 template <class T, class VALUE>
312 ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::~ACE_Active_Map_Manager_Iterator_Adapter (void)
316 template <class T, class VALUE> ACE_Iterator_Impl<T> *
317 ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::clone (void) const
319 ACE_Iterator_Impl<T> *temp = 0;
320 ACE_NEW_RETURN (temp,
321 (ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>) (*this),
323 return temp;
327 template <class T, class VALUE> int
328 ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::compare (const ACE_Iterator_Impl<T> &rhs) const
330 const ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE> &rhs_local
331 = dynamic_cast<const ACE_Active_Map_Manager_Iterator_Adapter< T, VALUE> &> (rhs);
333 return this->implementation_ == rhs_local.implementation_;
336 template <class T, class VALUE> T
337 ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::dereference () const
339 // The following syntax is necessary to work around certain broken compilers.
340 // In particular, please do not prefix implementation_ with this->
341 return T ((*implementation_).int_id_.first,
342 (*implementation_).int_id_.second);
345 template <class T, class VALUE> void
346 ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::plus_plus (void)
348 ++this->implementation_;
351 template <class T, class VALUE> void
352 ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::minus_minus (void)
354 --this->implementation_;
357 template <class T, class VALUE>
358 ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::~ACE_Active_Map_Manager_Reverse_Iterator_Adapter (void)
362 template <class T, class VALUE> ACE_Reverse_Iterator_Impl<T> *
363 ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::clone (void) const
365 ACE_Reverse_Iterator_Impl<T> *temp = 0;
366 ACE_NEW_RETURN (temp,
367 (ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>) (*this),
369 return temp;
373 template <class T, class VALUE> int
374 ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::compare (const ACE_Reverse_Iterator_Impl<T> &rhs) const
376 const ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE> &rhs_local
377 = dynamic_cast<const ACE_Active_Map_Manager_Reverse_Iterator_Adapter< T, VALUE> &> (rhs);
379 return this->implementation_ == rhs_local.implementation_;
382 template <class T, class VALUE> T
383 ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::dereference () const
385 // The following syntax is necessary to work around certain broken compilers.
386 // In particular, please do not prefix implementation_ with this->
387 return T ((*implementation_).int_id_.first,
388 (*implementation_).int_id_.second);
391 template <class T, class VALUE> void
392 ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::plus_plus (void)
394 ++this->implementation_;
397 template <class T, class VALUE> void
398 ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::minus_minus (void)
400 --this->implementation_;
403 template <class KEY, class VALUE, class KEY_ADAPTER>
404 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::~ACE_Active_Map_Manager_Adapter (void)
408 template <class KEY, class VALUE, class KEY_ADAPTER> int
409 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::open (size_t length,
410 ACE_Allocator *alloc)
412 return this->implementation_.open (length,
413 alloc);
416 template <class KEY, class VALUE, class KEY_ADAPTER> int
417 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::close (void)
419 return this->implementation_.close ();
422 template <class KEY, class VALUE, class KEY_ADAPTER> int
423 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::bind (const KEY &,
424 const VALUE &)
426 ACE_NOTSUP_RETURN (-1);
429 template <class KEY, class VALUE, class KEY_ADAPTER> int
430 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::bind_modify_key (const VALUE &value,
431 KEY &key)
433 // Reserve a slot and create an active key.
434 expanded_value *internal_value = 0;
435 ACE_Active_Map_Manager_Key active_key;
436 int result = this->implementation_.bind (active_key,
437 internal_value);
438 if (result == 0)
440 // Encode the active key and the existing user key into key part
441 // of <expanded_value>.
442 result = this->key_adapter_.encode (key,
443 active_key,
444 internal_value->first);
445 if (result == 0)
447 // Copy user value into <expanded_value>.
448 internal_value->second = value;
449 // Copy new, modified key back to the user key.
450 key = internal_value->first;
452 else
454 // In case of errors, unbind from map.
455 this->implementation_.unbind (active_key);
459 return result;
462 template <class KEY, class VALUE, class KEY_ADAPTER> int
463 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::create_key (KEY &)
465 ACE_NOTSUP_RETURN (-1);
468 template <class KEY, class VALUE, class KEY_ADAPTER> int
469 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::bind_create_key (const VALUE &value,
470 KEY &key)
472 // Reserve a slot and create an active key.
473 expanded_value *internal_value = 0;
474 ACE_Active_Map_Manager_Key active_key;
475 int result = this->implementation_.bind (active_key,
476 internal_value);
477 if (result == 0)
479 // Encode the active key into key part of <expanded_value>.
480 result = this->key_adapter_.encode (internal_value->first,
481 active_key,
482 internal_value->first);
483 if (result == 0)
485 // Copy user value into <expanded_value>.
486 internal_value->second = value;
487 // Copy new, modified key to the user key.
488 key = internal_value->first;
490 else
492 // In case of errors, unbind from map.
493 this->implementation_.unbind (active_key);
497 return result;
500 template <class KEY, class VALUE, class KEY_ADAPTER> int
501 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::bind_create_key (const VALUE &value)
503 // Reserve a slot and create an active key.
504 expanded_value *internal_value = 0;
505 ACE_Active_Map_Manager_Key active_key;
506 int result = this->implementation_.bind (active_key,
507 internal_value);
508 if (result == 0)
510 // Encode the active key into key part of <expanded_value>.
511 result = this->key_adapter_.encode (internal_value->first,
512 active_key,
513 internal_value->first);
514 if (result == 0)
516 // Copy user value into <expanded_value>.
517 internal_value->second = value;
519 else
521 // In case of errors, unbind from map.
522 this->implementation_.unbind (active_key);
526 return result;
529 template <class KEY, class VALUE, class KEY_ADAPTER> int
530 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::recover_key (const KEY &modified_key,
531 KEY &original_key)
533 // Ask the <key_adapter_> to help out with recovering the original
534 // user key, since it was the one that encode it in the first place.
535 return this->key_adapter_.decode (modified_key,
536 original_key);
539 template <class KEY, class VALUE, class KEY_ADAPTER> int
540 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::find (const KEY &key,
541 expanded_value *&internal_value)
543 // Ask the <key_adapter_> to recover the active key.
544 ACE_Active_Map_Manager_Key active_key;
545 int result = this->key_adapter_.decode (key,
546 active_key);
547 if (result == 0)
549 // Find recovered active key in map.
550 result = this->implementation_.find (active_key,
551 internal_value);
554 return result;
557 template <class KEY, class VALUE, class KEY_ADAPTER> int
558 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::find (const KEY &key,
559 VALUE &value)
561 expanded_value *internal_value = 0;
562 int result = this->find (key,
563 internal_value);
565 if (result == 0)
567 // Copy value.
568 value = internal_value->second;
571 return result;
574 template <class KEY, class VALUE, class KEY_ADAPTER> int
575 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::find (const KEY &key)
577 expanded_value *internal_value = 0;
578 return this->find (key,
579 internal_value);
582 template <class KEY, class VALUE, class KEY_ADAPTER> int
583 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::rebind (const KEY &key,
584 const VALUE &value)
586 expanded_value *internal_value = 0;
587 int result = this->find (key,
588 internal_value);
590 if (result == 0)
592 // Reset value.
593 internal_value->second = value;
596 return result;
599 template <class KEY, class VALUE, class KEY_ADAPTER> int
600 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::rebind (const KEY &key,
601 const VALUE &value,
602 VALUE &old_value)
604 expanded_value *internal_value = 0;
605 int result = this->find (key,
606 internal_value);
608 if (result == 0)
610 // Copy old value.
611 old_value = internal_value->second;
613 // Reset to new value.
614 internal_value->second = value;
617 return result;
620 template <class KEY, class VALUE, class KEY_ADAPTER> int
621 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::rebind (const KEY &key,
622 const VALUE &value,
623 KEY &old_key,
624 VALUE &old_value)
626 expanded_value *internal_value = 0;
627 int result = this->find (key,
628 internal_value);
630 if (result == 0)
632 // Copy old key and value.
633 old_key = internal_value->first;
634 old_value = internal_value->second;
636 // Reset to new value.
637 internal_value->second = value;
640 return result;
643 template <class KEY, class VALUE, class KEY_ADAPTER> int
644 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::trybind (const KEY &,
645 VALUE &)
647 ACE_NOTSUP_RETURN (-1);
650 template <class KEY, class VALUE, class KEY_ADAPTER> int
651 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::unbind (const KEY &key,
652 expanded_value *&internal_value)
654 // Ask the <key_adapter_> to recover the active key.
655 ACE_Active_Map_Manager_Key active_key;
656 int result = this->key_adapter_.decode (key,
657 active_key);
658 if (result == 0)
660 // Unbind recovered active key from map.
661 result = this->implementation_.unbind (active_key,
662 internal_value);
665 return result;
668 template <class KEY, class VALUE, class KEY_ADAPTER> int
669 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::unbind (const KEY &key)
671 expanded_value *internal_value = 0;
672 return this->unbind (key,
673 internal_value);
676 template <class KEY, class VALUE, class KEY_ADAPTER> int
677 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::unbind (const KEY &key,
678 VALUE &value)
680 expanded_value *internal_value = 0;
681 int result = this->unbind (key,
682 internal_value);
684 if (result == 0)
686 // Copy value.
687 value = internal_value->second;
690 return result;
693 template <class KEY, class VALUE, class KEY_ADAPTER> size_t
694 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::current_size (void) const
696 return this->implementation_.current_size ();
699 template <class KEY, class VALUE, class KEY_ADAPTER> size_t
700 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::total_size (void) const
702 return this->implementation_.total_size ();
705 template <class KEY, class VALUE, class KEY_ADAPTER> void
706 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::dump (void) const
708 #if defined (ACE_HAS_DUMP)
709 this->implementation_.dump ();
710 #endif /* ACE_HAS_DUMP */
713 template <class KEY, class VALUE, class KEY_ADAPTER> ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
714 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::begin_impl (void)
716 ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
717 ACE_NEW_RETURN (temp,
718 iterator_impl (this->implementation_.begin ()),
720 return temp;
723 template <class KEY, class VALUE, class KEY_ADAPTER> ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
724 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::end_impl (void)
726 ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
727 ACE_NEW_RETURN (temp,
728 iterator_impl (this->implementation_.end ()),
730 return temp;
733 template <class KEY, class VALUE, class KEY_ADAPTER> ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
734 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::rbegin_impl (void)
736 ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
737 ACE_NEW_RETURN (temp,
738 reverse_iterator_impl (this->implementation_.rbegin ()),
740 return temp;
743 template <class KEY, class VALUE, class KEY_ADAPTER> ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
744 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::rend_impl (void)
746 ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
747 ACE_NEW_RETURN (temp,
748 reverse_iterator_impl (this->implementation_.rend ()),
750 return temp;
753 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS>
754 ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::~ACE_Hash_Map_Manager_Ex_Iterator_Adapter (void)
758 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> ACE_Iterator_Impl<T> *
759 ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::clone (void) const
761 ACE_Iterator_Impl<T> *temp = 0;
762 ACE_NEW_RETURN (temp,
763 (ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>) (*this),
765 return temp;
769 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> int
770 ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::compare (const ACE_Iterator_Impl<T> &rhs) const
772 const ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS> &rhs_local
773 = dynamic_cast<const ACE_Hash_Map_Manager_Ex_Iterator_Adapter< T, KEY, VALUE, HASH_KEY, COMPARE_KEYS> &> (rhs);
775 return this->implementation_ == rhs_local.implementation_;
778 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> T
779 ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::dereference () const
781 // The following syntax is necessary to work around certain broken compilers.
782 // In particular, please do not prefix implementation_ with this->
783 return T ((*implementation_).ext_id_,
784 (*implementation_).int_id_);
787 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> void
788 ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::plus_plus (void)
790 ++this->implementation_;
793 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> void
794 ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::minus_minus (void)
796 --this->implementation_;
799 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS>
800 ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::~ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter (void)
804 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> ACE_Reverse_Iterator_Impl<T> *
805 ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::clone (void) const
807 ACE_Reverse_Iterator_Impl<T> *temp = 0;
808 ACE_NEW_RETURN (temp,
809 (ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>) (*this),
811 return temp;
815 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> int
816 ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::compare (const ACE_Reverse_Iterator_Impl<T> &rhs) const
818 const ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS> &rhs_local
819 = dynamic_cast<const ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter< T, KEY, VALUE, HASH_KEY, COMPARE_KEYS> &> (rhs);
821 return this->implementation_ == rhs_local.implementation_;
824 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> T
825 ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::dereference () const
827 // The following syntax is necessary to work around certain broken compilers.
828 // In particular, please do not prefix implementation_ with this->
829 return T ((*implementation_).ext_id_,
830 (*implementation_).int_id_);
833 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> void
834 ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::plus_plus (void)
836 ++this->implementation_;
839 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> void
840 ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::minus_minus (void)
842 --this->implementation_;
845 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR>
846 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::~ACE_Hash_Map_Manager_Ex_Adapter (void)
850 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
851 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::open (size_t length,
852 ACE_Allocator *alloc)
854 return this->implementation_.open (length,
855 alloc);
858 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
859 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::close (void)
861 return this->implementation_.close ();
864 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
865 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::bind (const KEY &key,
866 const VALUE &value)
868 return this->implementation_.bind (key,
869 value);
872 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
873 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::bind_modify_key (const VALUE &value,
874 KEY &key)
876 return this->implementation_.bind (key,
877 value);
880 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
881 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::create_key (KEY &key)
883 // Invoke the user specified key generation functor.
884 return this->key_generator_ (key);
887 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
888 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::bind_create_key (const VALUE &value,
889 KEY &key)
891 // Invoke the user specified key generation functor.
892 int result = this->key_generator_ (key);
894 if (result == 0)
896 // Try to add.
897 result = this->implementation_.bind (key,
898 value);
901 return result;
904 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
905 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::bind_create_key (const VALUE &value)
907 KEY key;
908 return this->bind_create_key (value,
909 key);
912 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
913 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::recover_key (const KEY &modified_key,
914 KEY &original_key)
916 original_key = modified_key;
917 return 0;
920 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
921 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::rebind (const KEY &key,
922 const VALUE &value)
924 return this->implementation_.rebind (key,
925 value);
928 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
929 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::rebind (const KEY &key,
930 const VALUE &value,
931 VALUE &old_value)
933 return this->implementation_.rebind (key,
934 value,
935 old_value);
938 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
939 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::rebind (const KEY &key,
940 const VALUE &value,
941 KEY &old_key,
942 VALUE &old_value)
944 return this->implementation_.rebind (key,
945 value,
946 old_key,
947 old_value);
950 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
951 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::trybind (const KEY &key,
952 VALUE &value)
954 return this->implementation_.trybind (key,
955 value);
958 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
959 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::find (const KEY &key,
960 VALUE &value)
962 return this->implementation_.find (key,
963 value);
966 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
967 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::find (const KEY &key)
969 return this->implementation_.find (key);
972 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
973 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::unbind (const KEY &key)
975 return this->implementation_.unbind (key);
978 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
979 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::unbind (const KEY &key,
980 VALUE &value)
982 return this->implementation_.unbind (key,
983 value);
986 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> size_t
987 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::current_size (void) const
989 return this->implementation_.current_size ();
992 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> size_t
993 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::total_size (void) const
995 return this->implementation_.total_size ();
998 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> void
999 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::dump (void) const
1001 #if defined (ACE_HAS_DUMP)
1002 this->implementation_.dump ();
1003 #endif /* ACE_HAS_DUMP */
1006 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
1007 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::begin_impl (void)
1009 ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
1010 ACE_NEW_RETURN (temp,
1011 iterator_impl (this->implementation_.begin ()),
1013 return temp;
1016 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
1017 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::end_impl (void)
1019 ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
1020 ACE_NEW_RETURN (temp,
1021 iterator_impl (this->implementation_.end ()),
1023 return temp;
1026 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
1027 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::rbegin_impl (void)
1029 ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
1030 ACE_NEW_RETURN (temp,
1031 reverse_iterator_impl (this->implementation_.rbegin ()),
1033 return temp;
1036 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
1037 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::rend_impl (void)
1039 ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
1040 ACE_NEW_RETURN (temp,
1041 reverse_iterator_impl (this->implementation_.rend ()),
1043 return temp;
1046 template <class T, class KEY, class VALUE>
1047 ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::~ACE_Map_Manager_Iterator_Adapter (void)
1051 template <class T, class KEY, class VALUE> ACE_Iterator_Impl<T> *
1052 ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::clone (void) const
1054 ACE_Iterator_Impl<T> *temp = 0;
1055 ACE_NEW_RETURN (temp,
1056 (ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>) (*this),
1058 return temp;
1062 template <class T, class KEY, class VALUE> int
1063 ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::compare (const ACE_Iterator_Impl<T> &rhs) const
1065 const ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE> &rhs_local
1066 = dynamic_cast<const ACE_Map_Manager_Iterator_Adapter< T, KEY, VALUE> &> (rhs);
1068 return this->implementation_ == rhs_local.implementation_;
1071 template <class T, class KEY, class VALUE> T
1072 ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::dereference () const
1074 // The following syntax is necessary to work around certain broken compilers.
1075 // In particular, please do not prefix implementation_ with this->
1076 return T ((*implementation_).ext_id_,
1077 (*implementation_).int_id_);
1080 template <class T, class KEY, class VALUE> void
1081 ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::plus_plus (void)
1083 ++this->implementation_;
1086 template <class T, class KEY, class VALUE> void
1087 ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::minus_minus (void)
1089 --this->implementation_;
1092 template <class T, class KEY, class VALUE>
1093 ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::~ACE_Map_Manager_Reverse_Iterator_Adapter (void)
1097 template <class T, class KEY, class VALUE> ACE_Reverse_Iterator_Impl<T> *
1098 ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::clone (void) const
1100 ACE_Reverse_Iterator_Impl<T> *temp = 0;
1101 ACE_NEW_RETURN (temp,
1102 (ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>) (*this),
1104 return temp;
1108 template <class T, class KEY, class VALUE> int
1109 ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::compare (const ACE_Reverse_Iterator_Impl<T> &rhs) const
1111 const ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE> &rhs_local
1112 = dynamic_cast<const ACE_Map_Manager_Reverse_Iterator_Adapter< T, KEY, VALUE> &> (rhs);
1114 return this->implementation_ == rhs_local.implementation_;
1117 template <class T, class KEY, class VALUE> T
1118 ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::dereference () const
1120 // The following syntax is necessary to work around certain broken compilers.
1121 // In particular, please do not prefix implementation_ with this->
1122 return T ((*implementation_).ext_id_,
1123 (*implementation_).int_id_);
1126 template <class T, class KEY, class VALUE> void
1127 ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::plus_plus (void)
1129 ++this->implementation_;
1132 template <class T, class KEY, class VALUE> void
1133 ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::minus_minus (void)
1135 --this->implementation_;
1138 template <class KEY, class VALUE, class KEY_GENERATOR>
1139 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::~ACE_Map_Manager_Adapter (void)
1143 template <class KEY, class VALUE, class KEY_GENERATOR> int
1144 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::open (size_t length,
1145 ACE_Allocator *alloc)
1147 return this->implementation_.open (length,
1148 alloc);
1151 template <class KEY, class VALUE, class KEY_GENERATOR> int
1152 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::close (void)
1154 return this->implementation_.close ();
1157 template <class KEY, class VALUE, class KEY_GENERATOR> int
1158 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::bind (const KEY &key,
1159 const VALUE &value)
1161 return this->implementation_.bind (key,
1162 value);
1165 template <class KEY, class VALUE, class KEY_GENERATOR> int
1166 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::bind_modify_key (const VALUE &value,
1167 KEY &key)
1169 return this->implementation_.bind (key,
1170 value);
1173 template <class KEY, class VALUE, class KEY_GENERATOR> int
1174 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::create_key (KEY &key)
1176 // Invoke the user specified key generation functor.
1177 return this->key_generator_ (key);
1180 template <class KEY, class VALUE, class KEY_GENERATOR> int
1181 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::bind_create_key (const VALUE &value,
1182 KEY &key)
1184 // Invoke the user specified key generation functor.
1185 int result = this->key_generator_ (key);
1187 if (result == 0)
1189 // Try to add.
1190 result = this->implementation_.bind (key,
1191 value);
1194 return result;
1197 template <class KEY, class VALUE, class KEY_GENERATOR> int
1198 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::bind_create_key (const VALUE &value)
1200 KEY key;
1201 return this->bind_create_key (value,
1202 key);
1205 template <class KEY, class VALUE, class KEY_GENERATOR> int
1206 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::recover_key (const KEY &modified_key,
1207 KEY &original_key)
1209 original_key = modified_key;
1210 return 0;
1213 template <class KEY, class VALUE, class KEY_GENERATOR> int
1214 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::rebind (const KEY &key,
1215 const VALUE &value)
1217 return this->implementation_.rebind (key,
1218 value);
1221 template <class KEY, class VALUE, class KEY_GENERATOR> int
1222 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::rebind (const KEY &key,
1223 const VALUE &value,
1224 VALUE &old_value)
1226 return this->implementation_.rebind (key,
1227 value,
1228 old_value);
1231 template <class KEY, class VALUE, class KEY_GENERATOR> int
1232 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::rebind (const KEY &key,
1233 const VALUE &value,
1234 KEY &old_key,
1235 VALUE &old_value)
1237 return this->implementation_.rebind (key,
1238 value,
1239 old_key,
1240 old_value);
1243 template <class KEY, class VALUE, class KEY_GENERATOR> int
1244 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::trybind (const KEY &key,
1245 VALUE &value)
1247 return this->implementation_.trybind (key,
1248 value);
1251 template <class KEY, class VALUE, class KEY_GENERATOR> int
1252 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::find (const KEY &key,
1253 VALUE &value)
1255 return this->implementation_.find (key,
1256 value);
1259 template <class KEY, class VALUE, class KEY_GENERATOR> int
1260 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::find (const KEY &key)
1262 return this->implementation_.find (key);
1265 template <class KEY, class VALUE, class KEY_GENERATOR> int
1266 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::unbind (const KEY &key)
1268 return this->implementation_.unbind (key);
1271 template <class KEY, class VALUE, class KEY_GENERATOR> int
1272 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::unbind (const KEY &key,
1273 VALUE &value)
1275 return this->implementation_.unbind (key,
1276 value);
1279 template <class KEY, class VALUE, class KEY_GENERATOR> size_t
1280 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::current_size (void) const
1282 return this->implementation_.current_size ();
1285 template <class KEY, class VALUE, class KEY_GENERATOR> size_t
1286 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::total_size (void) const
1288 return this->implementation_.total_size ();
1291 template <class KEY, class VALUE, class KEY_GENERATOR> void
1292 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::dump (void) const
1294 #if defined (ACE_HAS_DUMP)
1295 this->implementation_.dump ();
1296 #endif /* ACE_HAS_DUMP */
1299 template <class KEY, class VALUE, class KEY_GENERATOR> ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
1300 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::begin_impl (void)
1302 ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
1303 ACE_NEW_RETURN (temp,
1304 iterator_impl (this->implementation_.begin ()),
1306 return temp;
1309 template <class KEY, class VALUE, class KEY_GENERATOR> ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
1310 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::end_impl (void)
1312 ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
1313 ACE_NEW_RETURN (temp,
1314 iterator_impl (this->implementation_.end ()),
1316 return temp;
1319 template <class KEY, class VALUE, class KEY_GENERATOR> ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
1320 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::rbegin_impl (void)
1322 ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
1323 ACE_NEW_RETURN (temp,
1324 reverse_iterator_impl (this->implementation_.rbegin ()),
1326 return temp;
1329 template <class KEY, class VALUE, class KEY_GENERATOR> ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
1330 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::rend_impl (void)
1332 ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
1333 ACE_NEW_RETURN (temp,
1334 reverse_iterator_impl (this->implementation_.rend ()),
1336 return temp;
1339 ACE_END_VERSIONED_NAMESPACE_DECL
1341 #endif /* ACE_MAP_T_CPP */