1 // $Id: Map_T.cpp 80826 2008-03-04 14:51:23Z wotte $
8 #if !defined (ACE_LACKS_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)
24 ACE_Iterator_Impl
<T
>::~ACE_Iterator_Impl (void)
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;
44 (ACE_Map_Impl_Iterator_Adapter
<T
, IMPLEMENTATION
, ENTRY
>) (*this),
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_
,
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;
88 (ACE_Map_Impl_Reverse_Iterator_Adapter
<T
, IMPLEMENTATION
, ENTRY
>) (*this),
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_
,
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
,
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
,
147 return this->implementation_
.bind (key
,
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
,
155 return this->implementation_
.bind_modify_key (value
,
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
,
169 return this->implementation_
.bind_create_key (value
,
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
,
183 return this->implementation_
.recover_key (modified_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
,
191 return this->implementation_
.rebind (key
,
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
,
200 return this->implementation_
.rebind (key
,
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
,
211 return this->implementation_
.rebind (key
,
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
,
221 return this->implementation_
.trybind (key
,
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
,
229 return this->implementation_
.find (key
,
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
,
249 return this->implementation_
.unbind (key
,
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 ()),
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 ()),
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 ()),
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 ()),
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),
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),
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
,
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
&,
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
,
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
,
442 // Encode the active key and the existing user key into key part
443 // of <expanded_value>.
444 result
= this->key_adapter_
.encode (key
,
446 internal_value
->first ());
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 ();
456 // In case of errors, unbind from map.
457 this->implementation_
.unbind (active_key
);
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
,
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
,
481 // Encode the active key into key part of <expanded_value>.
482 result
= this->key_adapter_
.encode (internal_value
->first (),
484 internal_value
->first ());
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 ();
494 // In case of errors, unbind from map.
495 this->implementation_
.unbind (active_key
);
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
,
512 // Encode the active key into key part of <expanded_value>.
513 result
= this->key_adapter_
.encode (internal_value
->first (),
515 internal_value
->first ());
518 // Copy user value into <expanded_value>.
519 internal_value
->second (value
);
523 // In case of errors, unbind from map.
524 this->implementation_
.unbind (active_key
);
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
,
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
,
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
,
551 // Find recovered active key in map.
552 result
= this->implementation_
.find (active_key
,
559 template <class KEY
, class VALUE
, class KEY_ADAPTER
> int
560 ACE_Active_Map_Manager_Adapter
<KEY
, VALUE
, KEY_ADAPTER
>::find (const KEY
&key
,
563 expanded_value
*internal_value
= 0;
564 int result
= this->find (key
,
570 value
= internal_value
->second ();
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
,
584 template <class KEY
, class VALUE
, class KEY_ADAPTER
> int
585 ACE_Active_Map_Manager_Adapter
<KEY
, VALUE
, KEY_ADAPTER
>::rebind (const KEY
&key
,
588 expanded_value
*internal_value
= 0;
589 int result
= this->find (key
,
595 internal_value
->second (value
);
601 template <class KEY
, class VALUE
, class KEY_ADAPTER
> int
602 ACE_Active_Map_Manager_Adapter
<KEY
, VALUE
, KEY_ADAPTER
>::rebind (const KEY
&key
,
606 expanded_value
*internal_value
= 0;
607 int result
= this->find (key
,
613 old_value
= internal_value
->second ();
615 // Reset to new value.
616 internal_value
->second (value
);
622 template <class KEY
, class VALUE
, class KEY_ADAPTER
> int
623 ACE_Active_Map_Manager_Adapter
<KEY
, VALUE
, KEY_ADAPTER
>::rebind (const KEY
&key
,
628 expanded_value
*internal_value
= 0;
629 int result
= this->find (key
,
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
);
645 template <class KEY
, class VALUE
, class KEY_ADAPTER
> int
646 ACE_Active_Map_Manager_Adapter
<KEY
, VALUE
, KEY_ADAPTER
>::trybind (const KEY
&,
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
,
662 // Unbind recovered active key from map.
663 result
= this->implementation_
.unbind (active_key
,
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
,
678 template <class KEY
, class VALUE
, class KEY_ADAPTER
> int
679 ACE_Active_Map_Manager_Adapter
<KEY
, VALUE
, KEY_ADAPTER
>::unbind (const KEY
&key
,
682 expanded_value
*internal_value
= 0;
683 int result
= this->unbind (key
,
689 value
= internal_value
->second ();
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 ()),
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 ()),
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 ()),
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 ()),
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),
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),
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
,
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
,
870 return this->implementation_
.bind (key
,
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
,
878 return this->implementation_
.bind (key
,
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
,
893 // Invoke the user specified key generation functor.
894 int result
= this->key_generator_ (key
);
899 result
= this->implementation_
.bind (key
,
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
)
910 return this->bind_create_key (value
,
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
,
918 original_key
= modified_key
;
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
,
926 return this->implementation_
.rebind (key
,
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
,
935 return this->implementation_
.rebind (key
,
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
,
946 return this->implementation_
.rebind (key
,
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
,
956 return this->implementation_
.trybind (key
,
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
,
964 return this->implementation_
.find (key
,
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
,
984 return this->implementation_
.unbind (key
,
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 ()),
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 ()),
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 ()),
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 ()),
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),
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),
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
,
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
,
1163 return this->implementation_
.bind (key
,
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
,
1171 return this->implementation_
.bind (key
,
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
,
1186 // Invoke the user specified key generation functor.
1187 int result
= this->key_generator_ (key
);
1192 result
= this->implementation_
.bind (key
,
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
)
1203 return this->bind_create_key (value
,
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
,
1211 original_key
= modified_key
;
1215 template <class KEY
, class VALUE
, class KEY_GENERATOR
> int
1216 ACE_Map_Manager_Adapter
<KEY
, VALUE
, KEY_GENERATOR
>::rebind (const KEY
&key
,
1219 return this->implementation_
.rebind (key
,
1223 template <class KEY
, class VALUE
, class KEY_GENERATOR
> int
1224 ACE_Map_Manager_Adapter
<KEY
, VALUE
, KEY_GENERATOR
>::rebind (const KEY
&key
,
1228 return this->implementation_
.rebind (key
,
1233 template <class KEY
, class VALUE
, class KEY_GENERATOR
> int
1234 ACE_Map_Manager_Adapter
<KEY
, VALUE
, KEY_GENERATOR
>::rebind (const KEY
&key
,
1239 return this->implementation_
.rebind (key
,
1245 template <class KEY
, class VALUE
, class KEY_GENERATOR
> int
1246 ACE_Map_Manager_Adapter
<KEY
, VALUE
, KEY_GENERATOR
>::trybind (const KEY
&key
,
1249 return this->implementation_
.trybind (key
,
1253 template <class KEY
, class VALUE
, class KEY_GENERATOR
> int
1254 ACE_Map_Manager_Adapter
<KEY
, VALUE
, KEY_GENERATOR
>::find (const KEY
&key
,
1257 return this->implementation_
.find (key
,
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
,
1277 return this->implementation_
.unbind (key
,
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 ()),
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 ()),
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 ()),
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 ()),
1341 ACE_END_VERSIONED_NAMESPACE_DECL
1343 #endif /* ACE_MAP_T_CPP */