Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / Map_T.cpp
blob064682ca78bf7d160fab3cf7a2fed9b84ebda70c
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 T, class IMPLEMENTATION, class ENTRY> ACE_Iterator_Impl<T> *
17 ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::clone () const
19 ACE_Iterator_Impl<T> *temp = 0;
20 ACE_NEW_RETURN (temp,
21 (ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>) (*this),
22 0);
23 return temp;
26 template <class T, class IMPLEMENTATION, class ENTRY> int
27 ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::compare (const ACE_Iterator_Impl<T> &rhs) const
29 const ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY> &rhs_local
30 = dynamic_cast<const ACE_Map_Impl_Iterator_Adapter< T, IMPLEMENTATION, ENTRY> &> (rhs);
32 return this->implementation_ == rhs_local.implementation_;
35 template <class T, class IMPLEMENTATION, class ENTRY> T
36 ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::dereference () const
38 ENTRY &entry = *this->implementation_;
39 return T (entry.ext_id_,
40 entry.int_id_);
43 template <class T, class IMPLEMENTATION, class ENTRY> void
44 ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::plus_plus ()
46 ++this->implementation_;
49 template <class T, class IMPLEMENTATION, class ENTRY> void
50 ACE_Map_Impl_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::minus_minus ()
52 --this->implementation_;
55 template <class T, class IMPLEMENTATION, class ENTRY>
56 ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::~ACE_Map_Impl_Reverse_Iterator_Adapter ()
60 template <class T, class IMPLEMENTATION, class ENTRY> ACE_Reverse_Iterator_Impl<T> *
61 ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::clone () const
63 ACE_Reverse_Iterator_Impl<T> *temp = 0;
64 ACE_NEW_RETURN (temp,
65 (ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>) (*this),
66 0);
67 return temp;
70 template <class T, class IMPLEMENTATION, class ENTRY> int
71 ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::compare (const ACE_Reverse_Iterator_Impl<T> &rhs) const
73 const ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY> &rhs_local
74 = dynamic_cast<const ACE_Map_Impl_Reverse_Iterator_Adapter< T, IMPLEMENTATION, ENTRY> &> (rhs);
76 return this->implementation_ == rhs_local.implementation_;
79 template <class T, class IMPLEMENTATION, class ENTRY> T
80 ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::dereference () const
82 ENTRY &entry = *this->implementation_;
83 return T (entry.ext_id_,
84 entry.int_id_);
87 template <class T, class IMPLEMENTATION, class ENTRY> void
88 ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::plus_plus ()
90 ++this->implementation_;
93 template <class T, class IMPLEMENTATION, class ENTRY> void
94 ACE_Map_Impl_Reverse_Iterator_Adapter<T, IMPLEMENTATION, ENTRY>::minus_minus ()
96 --this->implementation_;
100 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY>
101 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::~ACE_Map_Impl ()
105 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
106 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::open (size_t length,
107 ACE_Allocator *alloc)
109 return this->implementation_.open (length,
110 alloc);
113 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
114 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::close ()
116 return this->implementation_.close ();
119 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
120 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::bind (const KEY &key,
121 const VALUE &value)
123 return this->implementation_.bind (key,
124 value);
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>::bind_modify_key (const VALUE &value,
129 KEY &key)
131 return this->implementation_.bind_modify_key (value,
132 key);
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>::create_key (KEY &key)
138 return this->implementation_.create_key (key);
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_create_key (const VALUE &value,
143 KEY &key)
145 return this->implementation_.bind_create_key (value,
146 key);
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_create_key (const VALUE &value)
152 return this->implementation_.bind_create_key (value);
155 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
156 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::recover_key (const KEY &modified_key,
157 KEY &original_key)
159 return this->implementation_.recover_key (modified_key,
160 original_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>::rebind (const KEY &key,
165 const VALUE &value)
167 return this->implementation_.rebind (key,
168 value);
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>::rebind (const KEY &key,
173 const VALUE &value,
174 VALUE &old_value)
176 return this->implementation_.rebind (key,
177 value,
178 old_value);
181 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
182 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::rebind (const KEY &key,
183 const VALUE &value,
184 KEY &old_key,
185 VALUE &old_value)
187 return this->implementation_.rebind (key,
188 value,
189 old_key,
190 old_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>::trybind (const KEY &key,
195 VALUE &value)
197 return this->implementation_.trybind (key,
198 value);
201 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
202 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::find (const KEY &key,
203 VALUE &value)
205 return this->implementation_.find (key,
206 value);
209 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
210 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::find (const KEY &key)
212 return this->implementation_.find (key);
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>::unbind (const KEY &key)
218 return this->implementation_.unbind (key);
221 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> int
222 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::unbind (const KEY &key,
223 VALUE &value)
225 return this->implementation_.unbind (key,
226 value);
229 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> size_t
230 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::current_size () const
232 return this->implementation_.current_size ();
235 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> size_t
236 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::total_size () const
238 return this->implementation_.total_size ();
241 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> void
242 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::dump () const
244 #if defined (ACE_HAS_DUMP)
245 this->implementation_.dump ();
246 #endif /* ACE_HAS_DUMP */
249 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
250 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::begin_impl ()
252 ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
253 ACE_NEW_RETURN (temp,
254 iterator_impl (this->implementation_.begin ()),
256 return temp;
259 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
260 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::end_impl ()
262 ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
263 ACE_NEW_RETURN (temp,
264 iterator_impl (this->implementation_.end ()),
266 return temp;
269 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
270 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::rbegin_impl ()
272 ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
273 ACE_NEW_RETURN (temp,
274 reverse_iterator_impl (this->implementation_.rbegin ()),
276 return temp;
279 template <class KEY, class VALUE, class IMPLEMENTATION, class ITERATOR, class REVERSE_ITERATOR, class ENTRY> ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
280 ACE_Map_Impl<KEY, VALUE, IMPLEMENTATION, ITERATOR, REVERSE_ITERATOR, ENTRY>::rend_impl ()
282 ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
283 ACE_NEW_RETURN (temp,
284 reverse_iterator_impl (this->implementation_.rend ()),
286 return temp;
289 template <class T, class VALUE>
290 ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::~ACE_Active_Map_Manager_Iterator_Adapter ()
294 template <class T, class VALUE> ACE_Iterator_Impl<T> *
295 ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::clone () const
297 ACE_Iterator_Impl<T> *temp = 0;
298 ACE_NEW_RETURN (temp,
299 (ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>) (*this),
301 return temp;
305 template <class T, class VALUE> int
306 ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::compare (const ACE_Iterator_Impl<T> &rhs) const
308 const ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE> &rhs_local
309 = dynamic_cast<const ACE_Active_Map_Manager_Iterator_Adapter< T, VALUE> &> (rhs);
311 return this->implementation_ == rhs_local.implementation_;
314 template <class T, class VALUE> T
315 ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::dereference () const
317 // The following syntax is necessary to work around certain broken compilers.
318 // In particular, please do not prefix implementation_ with this->
319 return T ((*implementation_).int_id_.first,
320 (*implementation_).int_id_.second);
323 template <class T, class VALUE> void
324 ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::plus_plus ()
326 ++this->implementation_;
329 template <class T, class VALUE> void
330 ACE_Active_Map_Manager_Iterator_Adapter<T, VALUE>::minus_minus ()
332 --this->implementation_;
335 template <class T, class VALUE>
336 ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::~ACE_Active_Map_Manager_Reverse_Iterator_Adapter ()
340 template <class T, class VALUE> ACE_Reverse_Iterator_Impl<T> *
341 ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::clone () const
343 ACE_Reverse_Iterator_Impl<T> *temp = 0;
344 ACE_NEW_RETURN (temp,
345 (ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>) (*this),
347 return temp;
351 template <class T, class VALUE> int
352 ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::compare (const ACE_Reverse_Iterator_Impl<T> &rhs) const
354 const ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE> &rhs_local
355 = dynamic_cast<const ACE_Active_Map_Manager_Reverse_Iterator_Adapter< T, VALUE> &> (rhs);
357 return this->implementation_ == rhs_local.implementation_;
360 template <class T, class VALUE> T
361 ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::dereference () const
363 // The following syntax is necessary to work around certain broken compilers.
364 // In particular, please do not prefix implementation_ with this->
365 return T ((*implementation_).int_id_.first,
366 (*implementation_).int_id_.second);
369 template <class T, class VALUE> void
370 ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::plus_plus ()
372 ++this->implementation_;
375 template <class T, class VALUE> void
376 ACE_Active_Map_Manager_Reverse_Iterator_Adapter<T, VALUE>::minus_minus ()
378 --this->implementation_;
381 template <class KEY, class VALUE, class KEY_ADAPTER>
382 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::~ACE_Active_Map_Manager_Adapter ()
386 template <class KEY, class VALUE, class KEY_ADAPTER> int
387 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::open (size_t length,
388 ACE_Allocator *alloc)
390 return this->implementation_.open (length,
391 alloc);
394 template <class KEY, class VALUE, class KEY_ADAPTER> int
395 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::close ()
397 return this->implementation_.close ();
400 template <class KEY, class VALUE, class KEY_ADAPTER> int
401 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::bind (const KEY &,
402 const VALUE &)
404 ACE_NOTSUP_RETURN (-1);
407 template <class KEY, class VALUE, class KEY_ADAPTER> int
408 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::bind_modify_key (const VALUE &value,
409 KEY &key)
411 // Reserve a slot and create an active key.
412 expanded_value *internal_value = 0;
413 ACE_Active_Map_Manager_Key active_key;
414 int result = this->implementation_.bind (active_key,
415 internal_value);
416 if (result == 0)
418 // Encode the active key and the existing user key into key part
419 // of <expanded_value>.
420 result = this->key_adapter_.encode (key,
421 active_key,
422 internal_value->first);
423 if (result == 0)
425 // Copy user value into <expanded_value>.
426 internal_value->second = value;
427 // Copy new, modified key back to the user key.
428 key = internal_value->first;
430 else
432 // In case of errors, unbind from map.
433 this->implementation_.unbind (active_key);
437 return result;
440 template <class KEY, class VALUE, class KEY_ADAPTER> int
441 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::create_key (KEY &)
443 ACE_NOTSUP_RETURN (-1);
446 template <class KEY, class VALUE, class KEY_ADAPTER> int
447 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::bind_create_key (const VALUE &value,
448 KEY &key)
450 // Reserve a slot and create an active key.
451 expanded_value *internal_value = 0;
452 ACE_Active_Map_Manager_Key active_key;
453 int result = this->implementation_.bind (active_key,
454 internal_value);
455 if (result == 0)
457 // Encode the active key into key part of <expanded_value>.
458 result = this->key_adapter_.encode (internal_value->first,
459 active_key,
460 internal_value->first);
461 if (result == 0)
463 // Copy user value into <expanded_value>.
464 internal_value->second = value;
465 // Copy new, modified key to the user key.
466 key = internal_value->first;
468 else
470 // In case of errors, unbind from map.
471 this->implementation_.unbind (active_key);
475 return result;
478 template <class KEY, class VALUE, class KEY_ADAPTER> int
479 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::bind_create_key (const VALUE &value)
481 // Reserve a slot and create an active key.
482 expanded_value *internal_value = 0;
483 ACE_Active_Map_Manager_Key active_key;
484 int result = this->implementation_.bind (active_key,
485 internal_value);
486 if (result == 0)
488 // Encode the active key into key part of <expanded_value>.
489 result = this->key_adapter_.encode (internal_value->first,
490 active_key,
491 internal_value->first);
492 if (result == 0)
494 // Copy user value into <expanded_value>.
495 internal_value->second = value;
497 else
499 // In case of errors, unbind from map.
500 this->implementation_.unbind (active_key);
504 return result;
507 template <class KEY, class VALUE, class KEY_ADAPTER> int
508 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::recover_key (const KEY &modified_key,
509 KEY &original_key)
511 // Ask the <key_adapter_> to help out with recovering the original
512 // user key, since it was the one that encode it in the first place.
513 return this->key_adapter_.decode (modified_key,
514 original_key);
517 template <class KEY, class VALUE, class KEY_ADAPTER> int
518 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::find (const KEY &key,
519 expanded_value *&internal_value)
521 // Ask the <key_adapter_> to recover the active key.
522 ACE_Active_Map_Manager_Key active_key;
523 int result = this->key_adapter_.decode (key,
524 active_key);
525 if (result == 0)
527 // Find recovered active key in map.
528 result = this->implementation_.find (active_key,
529 internal_value);
532 return result;
535 template <class KEY, class VALUE, class KEY_ADAPTER> int
536 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::find (const KEY &key,
537 VALUE &value)
539 expanded_value *internal_value = 0;
540 int result = this->find (key,
541 internal_value);
543 if (result == 0)
545 // Copy value.
546 value = internal_value->second;
549 return result;
552 template <class KEY, class VALUE, class KEY_ADAPTER> int
553 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::find (const KEY &key)
555 expanded_value *internal_value = 0;
556 return this->find (key,
557 internal_value);
560 template <class KEY, class VALUE, class KEY_ADAPTER> int
561 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::rebind (const KEY &key,
562 const VALUE &value)
564 expanded_value *internal_value = 0;
565 int result = this->find (key,
566 internal_value);
568 if (result == 0)
570 // Reset value.
571 internal_value->second = value;
574 return result;
577 template <class KEY, class VALUE, class KEY_ADAPTER> int
578 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::rebind (const KEY &key,
579 const VALUE &value,
580 VALUE &old_value)
582 expanded_value *internal_value = 0;
583 int result = this->find (key,
584 internal_value);
586 if (result == 0)
588 // Copy old value.
589 old_value = internal_value->second;
591 // Reset to new value.
592 internal_value->second = value;
595 return result;
598 template <class KEY, class VALUE, class KEY_ADAPTER> int
599 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::rebind (const KEY &key,
600 const VALUE &value,
601 KEY &old_key,
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 key and value.
611 old_key = internal_value->first;
612 old_value = internal_value->second;
614 // Reset to new value.
615 internal_value->second = value;
618 return result;
621 template <class KEY, class VALUE, class KEY_ADAPTER> int
622 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::trybind (const KEY &,
623 VALUE &)
625 ACE_NOTSUP_RETURN (-1);
628 template <class KEY, class VALUE, class KEY_ADAPTER> int
629 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::unbind (const KEY &key,
630 expanded_value *&internal_value)
632 // Ask the <key_adapter_> to recover the active key.
633 ACE_Active_Map_Manager_Key active_key;
634 int result = this->key_adapter_.decode (key,
635 active_key);
636 if (result == 0)
638 // Unbind recovered active key from map.
639 result = this->implementation_.unbind (active_key,
640 internal_value);
643 return result;
646 template <class KEY, class VALUE, class KEY_ADAPTER> int
647 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::unbind (const KEY &key)
649 expanded_value *internal_value = 0;
650 return this->unbind (key,
651 internal_value);
654 template <class KEY, class VALUE, class KEY_ADAPTER> int
655 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::unbind (const KEY &key,
656 VALUE &value)
658 expanded_value *internal_value = 0;
659 int result = this->unbind (key,
660 internal_value);
662 if (result == 0)
664 // Copy value.
665 value = internal_value->second;
668 return result;
671 template <class KEY, class VALUE, class KEY_ADAPTER> size_t
672 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::current_size () const
674 return this->implementation_.current_size ();
677 template <class KEY, class VALUE, class KEY_ADAPTER> size_t
678 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::total_size () const
680 return this->implementation_.total_size ();
683 template <class KEY, class VALUE, class KEY_ADAPTER> void
684 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::dump () const
686 #if defined (ACE_HAS_DUMP)
687 this->implementation_.dump ();
688 #endif /* ACE_HAS_DUMP */
691 template <class KEY, class VALUE, class KEY_ADAPTER> ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
692 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::begin_impl ()
694 ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
695 ACE_NEW_RETURN (temp,
696 iterator_impl (this->implementation_.begin ()),
698 return temp;
701 template <class KEY, class VALUE, class KEY_ADAPTER> ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
702 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::end_impl ()
704 ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
705 ACE_NEW_RETURN (temp,
706 iterator_impl (this->implementation_.end ()),
708 return temp;
711 template <class KEY, class VALUE, class KEY_ADAPTER> ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
712 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::rbegin_impl ()
714 ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
715 ACE_NEW_RETURN (temp,
716 reverse_iterator_impl (this->implementation_.rbegin ()),
718 return temp;
721 template <class KEY, class VALUE, class KEY_ADAPTER> ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
722 ACE_Active_Map_Manager_Adapter<KEY, VALUE, KEY_ADAPTER>::rend_impl ()
724 ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
725 ACE_NEW_RETURN (temp,
726 reverse_iterator_impl (this->implementation_.rend ()),
728 return temp;
731 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS>
732 ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::~ACE_Hash_Map_Manager_Ex_Iterator_Adapter ()
736 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> ACE_Iterator_Impl<T> *
737 ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::clone () const
739 ACE_Iterator_Impl<T> *temp = 0;
740 ACE_NEW_RETURN (temp,
741 (ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>) (*this),
743 return temp;
747 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> int
748 ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::compare (const ACE_Iterator_Impl<T> &rhs) const
750 const ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS> &rhs_local
751 = dynamic_cast<const ACE_Hash_Map_Manager_Ex_Iterator_Adapter< T, KEY, VALUE, HASH_KEY, COMPARE_KEYS> &> (rhs);
753 return this->implementation_ == rhs_local.implementation_;
756 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> T
757 ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::dereference () const
759 // The following syntax is necessary to work around certain broken compilers.
760 // In particular, please do not prefix implementation_ with this->
761 return T ((*implementation_).ext_id_,
762 (*implementation_).int_id_);
765 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> void
766 ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::plus_plus ()
768 ++this->implementation_;
771 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> void
772 ACE_Hash_Map_Manager_Ex_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::minus_minus ()
774 --this->implementation_;
777 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS>
778 ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::~ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter ()
782 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> ACE_Reverse_Iterator_Impl<T> *
783 ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::clone () const
785 ACE_Reverse_Iterator_Impl<T> *temp = 0;
786 ACE_NEW_RETURN (temp,
787 (ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>) (*this),
789 return temp;
793 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> int
794 ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::compare (const ACE_Reverse_Iterator_Impl<T> &rhs) const
796 const ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS> &rhs_local
797 = dynamic_cast<const ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter< T, KEY, VALUE, HASH_KEY, COMPARE_KEYS> &> (rhs);
799 return this->implementation_ == rhs_local.implementation_;
802 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> T
803 ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::dereference () const
805 // The following syntax is necessary to work around certain broken compilers.
806 // In particular, please do not prefix implementation_ with this->
807 return T ((*implementation_).ext_id_,
808 (*implementation_).int_id_);
811 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> void
812 ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::plus_plus ()
814 ++this->implementation_;
817 template <class T, class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS> void
818 ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<T, KEY, VALUE, HASH_KEY, COMPARE_KEYS>::minus_minus ()
820 --this->implementation_;
823 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR>
824 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::~ACE_Hash_Map_Manager_Ex_Adapter ()
828 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
829 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::open (size_t length,
830 ACE_Allocator *alloc)
832 return this->implementation_.open (length,
833 alloc);
836 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
837 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::close ()
839 return this->implementation_.close ();
842 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
843 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::bind (const KEY &key,
844 const VALUE &value)
846 return this->implementation_.bind (key,
847 value);
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>::bind_modify_key (const VALUE &value,
852 KEY &key)
854 return this->implementation_.bind (key,
855 value);
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>::create_key (KEY &key)
861 // Invoke the user specified key generation functor.
862 return this->key_generator_ (key);
865 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
866 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::bind_create_key (const VALUE &value,
867 KEY &key)
869 // Invoke the user specified key generation functor.
870 int result = this->key_generator_ (key);
872 if (result == 0)
874 // Try to add.
875 result = this->implementation_.bind (key,
876 value);
879 return result;
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>::bind_create_key (const VALUE &value)
885 KEY key;
886 return this->bind_create_key (value,
887 key);
890 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
891 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::recover_key (const KEY &modified_key,
892 KEY &original_key)
894 original_key = modified_key;
895 return 0;
898 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
899 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::rebind (const KEY &key,
900 const VALUE &value)
902 return this->implementation_.rebind (key,
903 value);
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>::rebind (const KEY &key,
908 const VALUE &value,
909 VALUE &old_value)
911 return this->implementation_.rebind (key,
912 value,
913 old_value);
916 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
917 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::rebind (const KEY &key,
918 const VALUE &value,
919 KEY &old_key,
920 VALUE &old_value)
922 return this->implementation_.rebind (key,
923 value,
924 old_key,
925 old_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>::trybind (const KEY &key,
930 VALUE &value)
932 return this->implementation_.trybind (key,
933 value);
936 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
937 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::find (const KEY &key,
938 VALUE &value)
940 return this->implementation_.find (key,
941 value);
944 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
945 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::find (const KEY &key)
947 return this->implementation_.find (key);
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>::unbind (const KEY &key)
953 return this->implementation_.unbind (key);
956 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> int
957 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::unbind (const KEY &key,
958 VALUE &value)
960 return this->implementation_.unbind (key,
961 value);
964 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> size_t
965 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::current_size () const
967 return this->implementation_.current_size ();
970 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> size_t
971 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::total_size () const
973 return this->implementation_.total_size ();
976 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> void
977 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::dump () const
979 #if defined (ACE_HAS_DUMP)
980 this->implementation_.dump ();
981 #endif /* ACE_HAS_DUMP */
984 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
985 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::begin_impl ()
987 ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
988 ACE_NEW_RETURN (temp,
989 iterator_impl (this->implementation_.begin ()),
991 return temp;
994 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
995 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::end_impl ()
997 ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
998 ACE_NEW_RETURN (temp,
999 iterator_impl (this->implementation_.end ()),
1001 return temp;
1004 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
1005 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::rbegin_impl ()
1007 ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
1008 ACE_NEW_RETURN (temp,
1009 reverse_iterator_impl (this->implementation_.rbegin ()),
1011 return temp;
1014 template <class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class KEY_GENERATOR> ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
1015 ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR>::rend_impl ()
1017 ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
1018 ACE_NEW_RETURN (temp,
1019 reverse_iterator_impl (this->implementation_.rend ()),
1021 return temp;
1024 template <class T, class KEY, class VALUE>
1025 ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::~ACE_Map_Manager_Iterator_Adapter ()
1029 template <class T, class KEY, class VALUE> ACE_Iterator_Impl<T> *
1030 ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::clone () const
1032 ACE_Iterator_Impl<T> *temp = 0;
1033 ACE_NEW_RETURN (temp,
1034 (ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>) (*this),
1036 return temp;
1040 template <class T, class KEY, class VALUE> int
1041 ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::compare (const ACE_Iterator_Impl<T> &rhs) const
1043 const ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE> &rhs_local
1044 = dynamic_cast<const ACE_Map_Manager_Iterator_Adapter< T, KEY, VALUE> &> (rhs);
1046 return this->implementation_ == rhs_local.implementation_;
1049 template <class T, class KEY, class VALUE> T
1050 ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::dereference () const
1052 // The following syntax is necessary to work around certain broken compilers.
1053 // In particular, please do not prefix implementation_ with this->
1054 return T ((*implementation_).ext_id_,
1055 (*implementation_).int_id_);
1058 template <class T, class KEY, class VALUE> void
1059 ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::plus_plus ()
1061 ++this->implementation_;
1064 template <class T, class KEY, class VALUE> void
1065 ACE_Map_Manager_Iterator_Adapter<T, KEY, VALUE>::minus_minus ()
1067 --this->implementation_;
1070 template <class T, class KEY, class VALUE>
1071 ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::~ACE_Map_Manager_Reverse_Iterator_Adapter ()
1075 template <class T, class KEY, class VALUE> ACE_Reverse_Iterator_Impl<T> *
1076 ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::clone () const
1078 ACE_Reverse_Iterator_Impl<T> *temp = 0;
1079 ACE_NEW_RETURN (temp,
1080 (ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>) (*this),
1082 return temp;
1086 template <class T, class KEY, class VALUE> int
1087 ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::compare (const ACE_Reverse_Iterator_Impl<T> &rhs) const
1089 const ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE> &rhs_local
1090 = dynamic_cast<const ACE_Map_Manager_Reverse_Iterator_Adapter< T, KEY, VALUE> &> (rhs);
1092 return this->implementation_ == rhs_local.implementation_;
1095 template <class T, class KEY, class VALUE> T
1096 ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::dereference () const
1098 // The following syntax is necessary to work around certain broken compilers.
1099 // In particular, please do not prefix implementation_ with this->
1100 return T ((*implementation_).ext_id_,
1101 (*implementation_).int_id_);
1104 template <class T, class KEY, class VALUE> void
1105 ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::plus_plus ()
1107 ++this->implementation_;
1110 template <class T, class KEY, class VALUE> void
1111 ACE_Map_Manager_Reverse_Iterator_Adapter<T, KEY, VALUE>::minus_minus ()
1113 --this->implementation_;
1116 template <class KEY, class VALUE, class KEY_GENERATOR>
1117 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::~ACE_Map_Manager_Adapter ()
1121 template <class KEY, class VALUE, class KEY_GENERATOR> int
1122 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::open (size_t length,
1123 ACE_Allocator *alloc)
1125 return this->implementation_.open (length,
1126 alloc);
1129 template <class KEY, class VALUE, class KEY_GENERATOR> int
1130 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::close ()
1132 return this->implementation_.close ();
1135 template <class KEY, class VALUE, class KEY_GENERATOR> int
1136 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::bind (const KEY &key,
1137 const VALUE &value)
1139 return this->implementation_.bind (key,
1140 value);
1143 template <class KEY, class VALUE, class KEY_GENERATOR> int
1144 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::bind_modify_key (const VALUE &value,
1145 KEY &key)
1147 return this->implementation_.bind (key,
1148 value);
1151 template <class KEY, class VALUE, class KEY_GENERATOR> int
1152 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::create_key (KEY &key)
1154 // Invoke the user specified key generation functor.
1155 return this->key_generator_ (key);
1158 template <class KEY, class VALUE, class KEY_GENERATOR> int
1159 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::bind_create_key (const VALUE &value,
1160 KEY &key)
1162 // Invoke the user specified key generation functor.
1163 int result = this->key_generator_ (key);
1165 if (result == 0)
1167 // Try to add.
1168 result = this->implementation_.bind (key,
1169 value);
1172 return result;
1175 template <class KEY, class VALUE, class KEY_GENERATOR> int
1176 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::bind_create_key (const VALUE &value)
1178 KEY key;
1179 return this->bind_create_key (value,
1180 key);
1183 template <class KEY, class VALUE, class KEY_GENERATOR> int
1184 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::recover_key (const KEY &modified_key,
1185 KEY &original_key)
1187 original_key = modified_key;
1188 return 0;
1191 template <class KEY, class VALUE, class KEY_GENERATOR> int
1192 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::rebind (const KEY &key,
1193 const VALUE &value)
1195 return this->implementation_.rebind (key,
1196 value);
1199 template <class KEY, class VALUE, class KEY_GENERATOR> int
1200 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::rebind (const KEY &key,
1201 const VALUE &value,
1202 VALUE &old_value)
1204 return this->implementation_.rebind (key,
1205 value,
1206 old_value);
1209 template <class KEY, class VALUE, class KEY_GENERATOR> int
1210 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::rebind (const KEY &key,
1211 const VALUE &value,
1212 KEY &old_key,
1213 VALUE &old_value)
1215 return this->implementation_.rebind (key,
1216 value,
1217 old_key,
1218 old_value);
1221 template <class KEY, class VALUE, class KEY_GENERATOR> int
1222 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::trybind (const KEY &key,
1223 VALUE &value)
1225 return this->implementation_.trybind (key,
1226 value);
1229 template <class KEY, class VALUE, class KEY_GENERATOR> int
1230 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::find (const KEY &key,
1231 VALUE &value)
1233 return this->implementation_.find (key,
1234 value);
1237 template <class KEY, class VALUE, class KEY_GENERATOR> int
1238 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::find (const KEY &key)
1240 return this->implementation_.find (key);
1243 template <class KEY, class VALUE, class KEY_GENERATOR> int
1244 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::unbind (const KEY &key)
1246 return this->implementation_.unbind (key);
1249 template <class KEY, class VALUE, class KEY_GENERATOR> int
1250 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::unbind (const KEY &key,
1251 VALUE &value)
1253 return this->implementation_.unbind (key,
1254 value);
1257 template <class KEY, class VALUE, class KEY_GENERATOR> size_t
1258 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::current_size () const
1260 return this->implementation_.current_size ();
1263 template <class KEY, class VALUE, class KEY_GENERATOR> size_t
1264 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::total_size () const
1266 return this->implementation_.total_size ();
1269 template <class KEY, class VALUE, class KEY_GENERATOR> void
1270 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::dump () const
1272 #if defined (ACE_HAS_DUMP)
1273 this->implementation_.dump ();
1274 #endif /* ACE_HAS_DUMP */
1277 template <class KEY, class VALUE, class KEY_GENERATOR> ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
1278 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::begin_impl ()
1280 ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
1281 ACE_NEW_RETURN (temp,
1282 iterator_impl (this->implementation_.begin ()),
1284 return temp;
1287 template <class KEY, class VALUE, class KEY_GENERATOR> ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
1288 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::end_impl ()
1290 ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
1291 ACE_NEW_RETURN (temp,
1292 iterator_impl (this->implementation_.end ()),
1294 return temp;
1297 template <class KEY, class VALUE, class KEY_GENERATOR> ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
1298 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::rbegin_impl ()
1300 ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
1301 ACE_NEW_RETURN (temp,
1302 reverse_iterator_impl (this->implementation_.rbegin ()),
1304 return temp;
1307 template <class KEY, class VALUE, class KEY_GENERATOR> ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *
1308 ACE_Map_Manager_Adapter<KEY, VALUE, KEY_GENERATOR>::rend_impl ()
1310 ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0;
1311 ACE_NEW_RETURN (temp,
1312 reverse_iterator_impl (this->implementation_.rend ()),
1314 return temp;
1317 ACE_END_VERSIONED_NAMESPACE_DECL
1319 #endif /* ACE_MAP_T_CPP */