3 //=============================================================================
7 * $Id: Map_T.h 80826 2008-03-04 14:51:23Z wotte $
9 * @author Irfan Pyarali <irfan@cs.wustl.edu>
11 //=============================================================================
15 #include /**/ "ace/pre.h"
17 #include "ace/Pair_T.h"
18 #include "ace/Map_Manager.h"
19 #include "ace/Hash_Map_Manager_T.h"
20 #include "ace/Active_Map_Manager.h"
22 #if !defined (ACE_LACKS_PRAGMA_ONCE)
24 #endif /* ACE_LACKS_PRAGMA_ONCE */
26 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
29 * @class ACE_Noop_Key_Generator
31 * @brief Defines a noop key generator.
34 class ACE_Noop_Key_Generator
38 /// Functor method: generates a new key.
39 int operator () (T
&);
43 * @class ACE_Incremental_Key_Generator
45 * @brief Defines a simple incremental key generator.
47 * Generates a new key of type T by incrementing current
48 * value. Requirements on T are:
49 * - Constructor that accepts 0 in the constructor.
52 * Note that a primitive types such as u_long, int, etc., are
53 * suitable for this class.
56 class ACE_Incremental_Key_Generator
61 ACE_Incremental_Key_Generator (void);
63 /// Functor method: generates a new key.
64 int operator () (T
&t
);
66 /// Returns the current value.
67 const T
& current_value (void) const;
76 * @class ACE_Iterator_Impl
78 * @brief Defines a abstract iterator.
80 * Implementation to be provided by subclasses.
83 class ACE_Iterator_Impl
88 virtual ~ACE_Iterator_Impl (void);
91 virtual ACE_Iterator_Impl
<T
> *clone (void) const = 0;
94 virtual int compare (const ACE_Iterator_Impl
<T
> &rhs
) const = 0;
97 virtual T
dereference (void) const = 0;
100 virtual void plus_plus (void) = 0;
103 virtual void minus_minus (void) = 0;
107 * @class ACE_Reverse_Iterator_Impl
109 * @brief Defines a abstract reverse iterator.
111 * Implementation to be provided by subclasses.
114 class ACE_Reverse_Iterator_Impl
119 virtual ~ACE_Reverse_Iterator_Impl (void);
122 virtual ACE_Reverse_Iterator_Impl
<T
> *clone (void) const = 0;
125 virtual int compare (const ACE_Reverse_Iterator_Impl
<T
> &rhs
) const = 0;
128 virtual T
dereference (void) const = 0;
131 virtual void plus_plus (void) = 0;
134 virtual void minus_minus (void) = 0;
138 * @class ACE_Iterator
140 * @brief Defines the iterator interface.
142 * Implementation to be provided by forwarding.
150 typedef T value_type
;
151 typedef ACE_Iterator_Impl
<T
> implementation
;
154 ACE_Iterator (ACE_Iterator_Impl
<T
> *impl
);
156 /// Copy constructor.
157 ACE_Iterator (const ACE_Iterator
<T
> &rhs
);
160 ~ACE_Iterator (void);
162 /// Assignment operator.
163 ACE_Iterator
<T
> &operator= (const ACE_Iterator
<T
> &rhs
);
165 /// Comparison operators.
166 bool operator== (const ACE_Iterator
<T
> &rhs
) const;
167 bool operator!= (const ACE_Iterator
<T
> &rhs
) const;
169 /// Dereference operator.
170 T
operator *() const;
173 ACE_Iterator
<T
> &operator++ (void);
176 ACE_Iterator
<T
> operator++ (int);
179 ACE_Iterator
<T
> &operator-- (void);
182 ACE_Iterator
<T
> operator-- (int);
184 /// Accessor to implementation object.
185 ACE_Iterator_Impl
<T
> &impl (void);
189 /// Implementation pointer.
190 ACE_Iterator_Impl
<T
> *implementation_
;
194 * @class ACE_Reverse_Iterator
196 * @brief Defines the reverse iterator interface.
198 * Implementation to be provided by forwarding.
201 class ACE_Reverse_Iterator
206 typedef T value_type
;
207 typedef ACE_Reverse_Iterator_Impl
<T
> implementation
;
210 ACE_Reverse_Iterator (ACE_Reverse_Iterator_Impl
<T
> *impl
);
212 /// Copy constructor.
213 ACE_Reverse_Iterator (const ACE_Reverse_Iterator
<T
> &rhs
);
216 ~ACE_Reverse_Iterator (void);
218 /// Assignment operator.
219 ACE_Reverse_Iterator
<T
> &operator= (const ACE_Reverse_Iterator
<T
> &rhs
);
222 * @name Comparison Operators
224 * The usual equality operators.
227 bool operator== (const ACE_Reverse_Iterator
<T
> &rhs
) const;
228 bool operator!= (const ACE_Reverse_Iterator
<T
> &rhs
) const;
231 /// Dereference operator.
232 T
operator *() const;
235 ACE_Reverse_Iterator
<T
> &operator++ (void);
238 ACE_Reverse_Iterator
<T
> operator++ (int);
241 ACE_Reverse_Iterator
<T
> &operator-- (void);
244 ACE_Reverse_Iterator
<T
> operator-- (int);
246 /// Accessor to implementation object.
247 ACE_Reverse_Iterator_Impl
<T
> &impl (void);
251 /// Implementation pointer.
252 ACE_Reverse_Iterator_Impl
<T
> *implementation_
;
258 * @brief Defines a map interface.
260 * Implementation to be provided by subclasses.
262 template <class KEY
, class VALUE
>
272 typedef ACE_Reference_Pair
<const KEY
, VALUE
>
274 typedef ACE_Iterator
<value_type
>
276 typedef ACE_Reverse_Iterator
<value_type
>
278 typedef ACE_Iterator_Impl
<value_type
>
279 iterator_implementation
;
280 typedef ACE_Reverse_Iterator_Impl
<value_type
>
281 reverse_iterator_implementation
;
283 /// Close down and release dynamically allocated resources.
284 virtual ~ACE_Map (void);
286 /// Initialize a map with size @a length.
287 virtual int open (size_t length
= ACE_DEFAULT_MAP_SIZE
,
288 ACE_Allocator
*alloc
= 0) = 0;
290 /// Close down a <Map> and release dynamically allocated resources.
291 virtual int close (void) = 0;
294 * Add @a key / @a value pair to the map. If @a key is already in the
295 * map then no changes are made and 1 is returned. Returns 0 on a
296 * successful addition. This function fails for maps that do not
297 * allow user specified keys. @a key is an "in" parameter.
299 virtual int bind (const KEY
&key
,
300 const VALUE
&value
) = 0;
303 * Add @a key / @a value pair to the map. @a key is an "inout" parameter
304 * and maybe modified/extended by the map to add additional
305 * information. To recover original key, call the <recover_key>
308 virtual int bind_modify_key (const VALUE
&value
,
312 * Produce a key and return it through @a key which is an "out"
313 * parameter. For maps that do not naturally produce keys, the map
314 * adapters will use the @c KEY_GENERATOR class to produce a key.
315 * However, the users are responsible for not jeopardizing this key
316 * production scheme by using user specified keys with keys produced
317 * by the key generator.
319 virtual int create_key (KEY
&key
) = 0;
322 * Add @a value to the map, and the corresponding key produced by the
323 * Map is returned through @a key which is an "out" parameter. For
324 * maps that do not naturally produce keys, the map adapters will
325 * use the @c KEY_GENERATOR class to produce a key. However, the
326 * users are responsible for not jeopardizing this key production
327 * scheme by using user specified keys with keys produced by the key
330 virtual int bind_create_key (const VALUE
&value
,
334 * Add @a value to the map. The user does not care about the
335 * corresponding key produced by the Map. For maps that do not
336 * naturally produce keys, the map adapters will use the
337 * @c KEY_GENERATOR class to produce a key. However, the users are
338 * responsible for not jeopardizing this key production scheme by
339 * using user specified keys with keys produced by the key
342 virtual int bind_create_key (const VALUE
&value
) = 0;
344 /// Recovers the original key potentially modified by the map during
345 /// <bind_modify_key>.
346 virtual int recover_key (const KEY
&modified_key
,
347 KEY
&original_key
) = 0;
350 * Reassociate @a key with @a value. The function fails if @a key is
351 * not in the map for maps that do not allow user specified keys.
352 * However, for maps that allow user specified keys, if the key is
353 * not in the map, a new @a key / @a value association is created.
355 virtual int rebind (const KEY
&key
,
356 const VALUE
&value
) = 0;
359 * Reassociate @a key with @a value, storing the old value into the
360 * "out" parameter @a old_value. The function fails if @a key is not
361 * in the map for maps that do not allow user specified keys.
362 * However, for maps that allow user specified keys, if the key is
363 * not in the map, a new @a key / @a value association is created.
365 virtual int rebind (const KEY
&key
,
367 VALUE
&old_value
) = 0;
370 * Reassociate @a key with @a value, storing the old key and value
371 * into the "out" parameters @a old_key and @a old_value. The
372 * function fails if @a key is not in the map for maps that do not
373 * allow user specified keys. However, for maps that allow user
374 * specified keys, if the key is not in the map, a new @a key / @a value
375 * association is created.
377 virtual int rebind (const KEY
&key
,
380 VALUE
&old_value
) = 0;
383 * Associate @a key with @a value if and only if @a key is not in the
384 * map. If @a key is already in the map, then the @a value parameter
385 * is overwritten with the existing value in the map. Returns 0 if a
386 * new @a key / @a value association is created. Returns 1 if an
387 * attempt is made to bind an existing entry. This function fails
388 * for maps that do not allow user specified keys.
390 virtual int trybind (const KEY
&key
,
393 /// Locate @a value associated with @a key.
394 virtual int find (const KEY
&key
,
397 /// Is @a key in the map?
398 virtual int find (const KEY
&key
) = 0;
400 /// Remove @a key from the map.
401 virtual int unbind (const KEY
&key
) = 0;
403 /// Remove @a key from the map, and return the @a value associated with
405 virtual int unbind (const KEY
&key
,
408 /// Return the current size of the map.
409 virtual size_t current_size (void) const = 0;
411 /// Return the total size of the map.
412 virtual size_t total_size (void) const = 0;
414 /// Dump the state of an object.
415 virtual void dump (void) const = 0;
417 // = STL styled iterator factory functions.
419 /// Return forward iterator.
420 iterator
begin (void);
423 /// Return reverse iterator.
424 reverse_iterator
rbegin (void);
425 reverse_iterator
rend (void);
429 // = Protected no-op constructor.
432 /// Return forward iterator.
433 virtual ACE_Iterator_Impl
<ACE_Reference_Pair
<const KEY
, VALUE
> > *begin_impl (void) = 0;
434 virtual ACE_Iterator_Impl
<ACE_Reference_Pair
<const KEY
, VALUE
> > *end_impl (void) = 0;
436 /// Return reverse iterator.
437 virtual ACE_Reverse_Iterator_Impl
<ACE_Reference_Pair
<const KEY
, VALUE
> > *rbegin_impl (void) = 0;
438 virtual ACE_Reverse_Iterator_Impl
<ACE_Reference_Pair
<const KEY
, VALUE
> > *rend_impl (void) = 0;
442 // = Disallow these operations.
443 ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Map
<KEY
, VALUE
> &))
444 ACE_UNIMPLEMENTED_FUNC (ACE_Map (const ACE_Map
<KEY
, VALUE
> &))
448 * @class ACE_Map_Impl_Iterator_Adapter
450 * @brief Defines a iterator implementation for the Map_Impl class.
452 * Implementation to be provided by <IMPLEMENTATION>.
454 template <class T
, class IMPLEMENTATION
, class ENTRY
>
455 class ACE_Map_Impl_Iterator_Adapter
: public ACE_Iterator_Impl
<T
>
460 typedef IMPLEMENTATION
464 ACE_Map_Impl_Iterator_Adapter (const IMPLEMENTATION
&impl
);
467 virtual ~ACE_Map_Impl_Iterator_Adapter (void);
470 virtual ACE_Iterator_Impl
<T
> *clone (void) const;
473 virtual int compare (const ACE_Iterator_Impl
<T
> &rhs
) const;
476 virtual T
dereference (void) const;
479 virtual void plus_plus (void);
482 virtual void minus_minus (void);
484 /// Accessor to implementation object.
485 IMPLEMENTATION
&impl (void);
489 /// All implementation details are forwarded to this class.
490 IMPLEMENTATION implementation_
;
494 * @class ACE_Map_Impl_Reverse_Iterator_Adapter
496 * @brief Defines a reverse iterator implementation for the Map_Impl class.
498 * Implementation to be provided by IMPLEMENTATION.
500 template <class T
, class IMPLEMENTATION
, class ENTRY
>
501 class ACE_Map_Impl_Reverse_Iterator_Adapter
: public ACE_Reverse_Iterator_Impl
<T
>
506 typedef IMPLEMENTATION
510 ACE_Map_Impl_Reverse_Iterator_Adapter (const IMPLEMENTATION
&impl
);
513 virtual ~ACE_Map_Impl_Reverse_Iterator_Adapter (void);
516 virtual ACE_Reverse_Iterator_Impl
<T
> *clone (void) const;
519 virtual int compare (const ACE_Reverse_Iterator_Impl
<T
> &rhs
) const;
522 virtual T
dereference (void) const;
525 virtual void plus_plus (void);
528 virtual void minus_minus (void);
530 /// Accessor to implementation object.
531 IMPLEMENTATION
&impl (void);
535 /// All implementation details are forwarded to this class.
536 IMPLEMENTATION implementation_
;
540 * @class ACE_Map_Impl
542 * @brief Defines a map implementation.
544 * Implementation to be provided by <IMPLEMENTATION>.
546 template <class KEY
, class VALUE
, class IMPLEMENTATION
, class ITERATOR
, class REVERSE_ITERATOR
, class ENTRY
>
547 class ACE_Map_Impl
: public ACE_Map
<KEY
, VALUE
>
552 typedef ACE_Map_Impl_Iterator_Adapter
<typename ACE_Map
<KEY
, VALUE
>::value_type
, ITERATOR
, ENTRY
>
554 typedef ACE_Map_Impl_Reverse_Iterator_Adapter
<typename ACE_Map
<KEY
, VALUE
>::value_type
, REVERSE_ITERATOR
, ENTRY
>
555 reverse_iterator_impl
;
557 typedef IMPLEMENTATION
560 // = Initialization and termination methods.
561 /// Initialize with the ACE_DEFAULT_MAP_SIZE.
562 ACE_Map_Impl (ACE_Allocator
*alloc
= 0);
564 /// Initialize with @a size entries. The @a size parameter is ignored
565 /// by maps for which an initialize size does not make sense.
566 ACE_Map_Impl (size_t size
,
567 ACE_Allocator
*alloc
= 0);
569 /// Close down and release dynamically allocated resources.
570 virtual ~ACE_Map_Impl (void);
572 /// Initialize a <Map> with size @a length.
573 virtual int open (size_t length
= ACE_DEFAULT_MAP_SIZE
,
574 ACE_Allocator
*alloc
= 0);
576 /// Close down a <Map> and release dynamically allocated resources.
577 virtual int close (void);
580 * Add @a key / @a value pair to the map. If @a key is already in the
581 * map then no changes are made and 1 is returned. Returns 0 on a
582 * successful addition. This function fails for maps that do not
583 * allow user specified keys. @a key is an "in" parameter.
585 virtual int bind (const KEY
&key
,
589 * Add @a key / @a value pair to the map. @a key is an "inout" parameter
590 * and maybe modified/extended by the map to add additional
591 * information. To recover original key, call the <recover_key>
594 virtual int bind_modify_key (const VALUE
&value
,
598 * Produce a key and return it through @a key which is an "out"
599 * parameter. For maps that do not naturally produce keys, the map
600 * adapters will use the @c KEY_GENERATOR class to produce a key.
601 * However, the users are responsible for not jeopardizing this key
602 * production scheme by using user specified keys with keys produced
603 * by the key generator.
605 virtual int create_key (KEY
&key
);
608 * Add @a value to the map, and the corresponding key produced by the
609 * Map is returned through @a key which is an "out" parameter. For
610 * maps that do not naturally produce keys, the map adapters will
611 * use the @c KEY_GENERATOR class to produce a key. However, the
612 * users are responsible for not jeopardizing this key production
613 * scheme by using user specified keys with keys produced by the key
616 virtual int bind_create_key (const VALUE
&value
,
620 * Add @a value to the map. The user does not care about the
621 * corresponding key produced by the Map. For maps that do not
622 * naturally produce keys, the map adapters will use the
623 * @c KEY_GENERATOR class to produce a key. However, the users are
624 * responsible for not jeopardizing this key production scheme by
625 * using user specified keys with keys produced by the key
628 virtual int bind_create_key (const VALUE
&value
);
630 /// Recovers the original key potentially modified by the map during
631 /// <bind_modify_key>.
632 virtual int recover_key (const KEY
&modified_key
,
636 * Reassociate @a key with @a value. The function fails if @a key is
637 * not in the map for maps that do not allow user specified keys.
638 * However, for maps that allow user specified keys, if the key is
639 * not in the map, a new @a key / @a value association is created.
641 virtual int rebind (const KEY
&key
,
645 * Reassociate @a key with @a value, storing the old value into the
646 * "out" parameter @a old_value. The function fails if @a key is not
647 * in the map for maps that do not allow user specified keys.
648 * However, for maps that allow user specified keys, if the key is
649 * not in the map, a new @a key / @a value association is created.
651 virtual int rebind (const KEY
&key
,
656 * Reassociate @a key with @a value, storing the old key and value
657 * into the "out" parameters @a old_key and @a old_value. The
658 * function fails if @a key is not in the map for maps that do not
659 * allow user specified keys. However, for maps that allow user
660 * specified keys, if the key is not in the map, a new @a key / @a value
661 * association is created.
663 virtual int rebind (const KEY
&key
,
669 * Associate @a key with @a value if and only if @a key is not in the
670 * map. If @a key is already in the map, then the @a value parameter
671 * is overwritten with the existing value in the map. Returns 0 if a
672 * new @a key / @a value association is created. Returns 1 if an
673 * attempt is made to bind an existing entry. This function fails
674 * for maps that do not allow user specified keys.
676 virtual int trybind (const KEY
&key
,
679 /// Locate @a value associated with @a key.
680 virtual int find (const KEY
&key
,
683 /// Is @a key in the map?
684 virtual int find (const KEY
&key
);
686 /// Remove @a key from the map.
687 virtual int unbind (const KEY
&key
);
689 /// Remove @a key from the map, and return the @a value associated with
691 virtual int unbind (const KEY
&key
,
694 /// Return the current size of the map.
695 virtual size_t current_size (void) const;
697 /// Return the total size of the map.
698 virtual size_t total_size (void) const;
700 /// Dump the state of an object.
701 virtual void dump (void) const;
703 /// Accessor to implementation object.
704 IMPLEMENTATION
&impl (void);
708 /// All implementation details are forwarded to this class.
709 IMPLEMENTATION implementation_
;
711 // = STL styled iterator factory functions.
713 /// Return forward iterator.
714 virtual ACE_Iterator_Impl
<ACE_Reference_Pair
<const KEY
, VALUE
> > *begin_impl (void);
715 virtual ACE_Iterator_Impl
<ACE_Reference_Pair
<const KEY
, VALUE
> > *end_impl (void);
717 /// Return reverse iterator.
718 virtual ACE_Reverse_Iterator_Impl
<ACE_Reference_Pair
<const KEY
, VALUE
> > *rbegin_impl (void);
719 virtual ACE_Reverse_Iterator_Impl
<ACE_Reference_Pair
<const KEY
, VALUE
> > *rend_impl (void);
723 // = Disallow these operations.
724 ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Map_Impl
<KEY
, VALUE
, IMPLEMENTATION
, ITERATOR
, REVERSE_ITERATOR
, ENTRY
> &))
725 ACE_UNIMPLEMENTED_FUNC (ACE_Map_Impl (const ACE_Map_Impl
<KEY
, VALUE
, IMPLEMENTATION
, ITERATOR
, REVERSE_ITERATOR
, ENTRY
> &))
729 * @class ACE_Active_Map_Manager_Iterator_Adapter
731 * @brief Defines a iterator implementation for the Active_Map_Manager_Adapter.
733 * Implementation to be provided by ACE_Active_Map_Manager::iterator.
735 template <class T
, class VALUE
>
736 class ACE_Active_Map_Manager_Iterator_Adapter
: public ACE_Iterator_Impl
<T
>
741 typedef typename ACE_Active_Map_Manager
<VALUE
>::iterator
745 ACE_Active_Map_Manager_Iterator_Adapter (const ACE_Map_Iterator
<ACE_Active_Map_Manager_Key
, VALUE
, ACE_Null_Mutex
> &impl
);
748 virtual ~ACE_Active_Map_Manager_Iterator_Adapter (void);
751 virtual ACE_Iterator_Impl
<T
> *clone (void) const;
754 virtual int compare (const ACE_Iterator_Impl
<T
> &rhs
) const;
757 virtual T
dereference (void) const;
760 virtual void plus_plus (void);
763 virtual void minus_minus (void);
765 /// Accessor to implementation object.
766 ACE_Map_Iterator
<ACE_Active_Map_Manager_Key
, VALUE
, ACE_Null_Mutex
> &impl (void);
770 /// All implementation details are forwarded to this class.
771 ACE_Map_Iterator
<ACE_Active_Map_Manager_Key
, VALUE
, ACE_Null_Mutex
> implementation_
;
775 * @class ACE_Active_Map_Manager_Reverse_Iterator_Adapter
777 * @brief Defines a reverse iterator implementation for the Active_Map_Manager_Adapter.
779 * Implementation to be provided by ACE_Active_Map_Manager::reverse_iterator.
781 template <class T
, class VALUE
>
782 class ACE_Active_Map_Manager_Reverse_Iterator_Adapter
: public ACE_Reverse_Iterator_Impl
<T
>
787 typedef typename ACE_Active_Map_Manager
<VALUE
>::reverse_iterator
791 ACE_Active_Map_Manager_Reverse_Iterator_Adapter (const ACE_Map_Reverse_Iterator
<ACE_Active_Map_Manager_Key
, VALUE
, ACE_Null_Mutex
> &impl
);
794 virtual ~ACE_Active_Map_Manager_Reverse_Iterator_Adapter (void);
797 virtual ACE_Reverse_Iterator_Impl
<T
> *clone (void) const;
800 virtual int compare (const ACE_Reverse_Iterator_Impl
<T
> &rhs
) const;
803 virtual T
dereference (void) const;
806 virtual void plus_plus (void);
809 virtual void minus_minus (void);
811 /// Accessor to implementation object.
812 ACE_Map_Reverse_Iterator
<ACE_Active_Map_Manager_Key
, VALUE
, ACE_Null_Mutex
> &impl (void);
816 /// All implementation details are forwarded to this class.
817 ACE_Map_Reverse_Iterator
<ACE_Active_Map_Manager_Key
, VALUE
, ACE_Null_Mutex
> implementation_
;
821 * @class ACE_Active_Map_Manager_Adapter
823 * @brief Defines a map implementation.
825 * Implementation to be provided by <ACE_Active_Map_Manager>.
827 template <class KEY
, class VALUE
, class KEY_ADAPTER
>
828 class ACE_Active_Map_Manager_Adapter
: public ACE_Map
<KEY
, VALUE
>
833 typedef ACE_Pair
<KEY
, VALUE
>
835 typedef ACE_Active_Map_Manager_Iterator_Adapter
<ACE_Reference_Pair
<const KEY
, VALUE
>, expanded_value
>
837 typedef ACE_Active_Map_Manager_Reverse_Iterator_Adapter
<ACE_Reference_Pair
<const KEY
, VALUE
>, expanded_value
>
838 reverse_iterator_impl
;
839 typedef ACE_Active_Map_Manager
<expanded_value
>
842 // = Initialization and termination methods.
843 /// Initialize with the ACE_DEFAULT_MAP_SIZE.
844 ACE_Active_Map_Manager_Adapter (ACE_Allocator
*alloc
= 0);
846 /// Initialize with @a size entries. The @a size parameter is ignored
847 /// by maps for which an initialize size does not make sense.
848 ACE_Active_Map_Manager_Adapter (size_t size
,
849 ACE_Allocator
*alloc
= 0);
851 /// Close down and release dynamically allocated resources.
852 virtual ~ACE_Active_Map_Manager_Adapter (void);
854 /// Initialize a <Map> with size @a length.
855 virtual int open (size_t length
= ACE_DEFAULT_MAP_SIZE
,
856 ACE_Allocator
*alloc
= 0);
858 /// Close down a <Map> and release dynamically allocated resources.
859 virtual int close (void);
862 * Add @a key / @a value pair to the map. If @a key is already in the
863 * map then no changes are made and 1 is returned. Returns 0 on a
864 * successful addition. This function fails for maps that do not
865 * allow user specified keys. @a key is an "in" parameter.
867 virtual int bind (const KEY
&key
,
871 * Add @a key / @a value pair to the map. @a key is an "inout" parameter
872 * and maybe modified/extended by the map to add additional
873 * information. To recover original key, call the <recover_key>
876 virtual int bind_modify_key (const VALUE
&value
,
880 * Produce a key and return it through @a key which is an "out"
881 * parameter. For maps that do not naturally produce keys, the map
882 * adapters will use the @c KEY_GENERATOR class to produce a key.
883 * However, the users are responsible for not jeopardizing this key
884 * production scheme by using user specified keys with keys produced
885 * by the key generator.
887 virtual int create_key (KEY
&key
);
890 * Add @a value to the map, and the corresponding key produced by the
891 * Map is returned through @a key which is an "out" parameter. For
892 * maps that do not naturally produce keys, the map adapters will
893 * use the @c KEY_GENERATOR class to produce a key. However, the
894 * users are responsible for not jeopardizing this key production
895 * scheme by using user specified keys with keys produced by the key
898 virtual int bind_create_key (const VALUE
&value
,
902 * Add @a value to the map. The user does not care about the
903 * corresponding key produced by the Map. For maps that do not
904 * naturally produce keys, the map adapters will use the
905 * @c KEY_GENERATOR class to produce a key. However, the users are
906 * responsible for not jeopardizing this key production scheme by
907 * using user specified keys with keys produced by the key
910 virtual int bind_create_key (const VALUE
&value
);
912 /// Recovers the original key potentially modified by the map during
913 /// <bind_modify_key>.
914 virtual int recover_key (const KEY
&modified_key
,
918 * Reassociate @a key with @a value. The function fails if @a key is
919 * not in the map for maps that do not allow user specified keys.
920 * However, for maps that allow user specified keys, if the key is
921 * not in the map, a new @a key / @a value association is created.
923 virtual int rebind (const KEY
&key
,
927 * Reassociate @a key with @a value, storing the old value into the
928 * "out" parameter @a old_value. The function fails if @a key is not
929 * in the map for maps that do not allow user specified keys.
930 * However, for maps that allow user specified keys, if the key is
931 * not in the map, a new @a key / @a value association is created.
933 virtual int rebind (const KEY
&key
,
938 * Reassociate @a key with @a value, storing the old key and value
939 * into the "out" parameters @a old_key and @a old_value. The
940 * function fails if @a key is not in the map for maps that do not
941 * allow user specified keys. However, for maps that allow user
942 * specified keys, if the key is not in the map, a new @a key / @a value
943 * association is created.
945 virtual int rebind (const KEY
&key
,
951 * Associate @a key with @a value if and only if @a key is not in the
952 * map. If @a key is already in the map, then the @a value parameter
953 * is overwritten with the existing value in the map. Returns 0 if a
954 * new @a key / @a value association is created. Returns 1 if an
955 * attempt is made to bind an existing entry. This function fails
956 * for maps that do not allow user specified keys.
958 virtual int trybind (const KEY
&key
,
961 /// Locate @a value associated with @a key.
962 virtual int find (const KEY
&key
,
965 /// Is @a key in the map?
966 virtual int find (const KEY
&key
);
968 /// Remove @a key from the map.
969 virtual int unbind (const KEY
&key
);
971 /// Remove @a key from the map, and return the @a value associated with
973 virtual int unbind (const KEY
&key
,
976 /// Return the current size of the map.
977 virtual size_t current_size (void) const;
979 /// Return the total size of the map.
980 virtual size_t total_size (void) const;
982 /// Dump the state of an object.
983 virtual void dump (void) const;
985 /// Accessor to implementation object.
986 ACE_Active_Map_Manager
<ACE_Pair
<KEY
, VALUE
> > &impl (void);
988 /// Accessor to key adapter.
989 KEY_ADAPTER
&key_adapter (void);
994 virtual int find (const KEY
&key
,
995 expanded_value
*&internal_value
);
998 virtual int unbind (const KEY
&key
,
999 expanded_value
*&internal_value
);
1001 /// All implementation details are forwarded to this class.
1002 ACE_Active_Map_Manager
<ACE_Pair
<KEY
, VALUE
> > implementation_
;
1004 /// Adapts between the user key and the Active_Map_Manager_Key.
1005 KEY_ADAPTER key_adapter_
;
1007 // = STL styled iterator factory functions.
1009 /// Return forward iterator.
1010 virtual ACE_Iterator_Impl
<ACE_Reference_Pair
<const KEY
, VALUE
> > *begin_impl (void);
1011 virtual ACE_Iterator_Impl
<ACE_Reference_Pair
<const KEY
, VALUE
> > *end_impl (void);
1013 /// Return reverse iterator.
1014 virtual ACE_Reverse_Iterator_Impl
<ACE_Reference_Pair
<const KEY
, VALUE
> > *rbegin_impl (void);
1015 virtual ACE_Reverse_Iterator_Impl
<ACE_Reference_Pair
<const KEY
, VALUE
> > *rend_impl (void);
1019 // = Disallow these operations.
1020 ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Active_Map_Manager_Adapter
<KEY
, VALUE
, KEY_ADAPTER
> &))
1021 ACE_UNIMPLEMENTED_FUNC (ACE_Active_Map_Manager_Adapter (const ACE_Active_Map_Manager_Adapter
<KEY
, VALUE
, KEY_ADAPTER
> &))
1025 * @class ACE_Hash_Map_Manager_Ex_Iterator_Adapter
1027 * @brief Defines a iterator implementation for the Hash_Map_Manager_Adapter.
1029 * Implementation to be provided by ACE_Hash_Map_Manager_Ex::iterator.
1031 template <class T
, class KEY
, class VALUE
, class HASH_KEY
, class COMPARE_KEYS
>
1032 class ACE_Hash_Map_Manager_Ex_Iterator_Adapter
: public ACE_Iterator_Impl
<T
>
1037 typedef typename ACE_Hash_Map_Manager_Ex
<KEY
, VALUE
, HASH_KEY
, COMPARE_KEYS
, ACE_Null_Mutex
>::iterator
1041 ACE_Hash_Map_Manager_Ex_Iterator_Adapter (const ACE_Hash_Map_Iterator_Ex
<KEY
, VALUE
, HASH_KEY
, COMPARE_KEYS
, ACE_Null_Mutex
> &impl
);
1044 virtual ~ACE_Hash_Map_Manager_Ex_Iterator_Adapter (void);
1047 virtual ACE_Iterator_Impl
<T
> *clone (void) const;
1050 virtual int compare (const ACE_Iterator_Impl
<T
> &rhs
) const;
1053 virtual T
dereference (void) const;
1056 virtual void plus_plus (void);
1059 virtual void minus_minus (void);
1061 /// Accessor to implementation object.
1062 ACE_Hash_Map_Iterator_Ex
<KEY
, VALUE
, HASH_KEY
, COMPARE_KEYS
, ACE_Null_Mutex
> &impl (void);
1066 /// All implementation details are forwarded to this class.
1067 ACE_Hash_Map_Iterator_Ex
<KEY
, VALUE
, HASH_KEY
, COMPARE_KEYS
, ACE_Null_Mutex
> implementation_
;
1071 * @class ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter
1073 * @brief Defines a reverse iterator implementation for the Hash_Map_Manager_Adapter.
1075 * Implementation to be provided by ACE_Hash_Map_Manager_Ex::reverse_iterator.
1077 template <class T
, class KEY
, class VALUE
, class HASH_KEY
, class COMPARE_KEYS
>
1078 class ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter
: public ACE_Reverse_Iterator_Impl
<T
>
1083 typedef typename ACE_Hash_Map_Manager_Ex
<KEY
, VALUE
, HASH_KEY
, COMPARE_KEYS
, ACE_Null_Mutex
>::reverse_iterator
1087 ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter (const ACE_Hash_Map_Reverse_Iterator_Ex
<KEY
, VALUE
, HASH_KEY
, COMPARE_KEYS
, ACE_Null_Mutex
> &impl
);
1090 virtual ~ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter (void);
1093 virtual ACE_Reverse_Iterator_Impl
<T
> *clone (void) const;
1096 virtual int compare (const ACE_Reverse_Iterator_Impl
<T
> &rhs
) const;
1099 virtual T
dereference (void) const;
1102 virtual void plus_plus (void);
1105 virtual void minus_minus (void);
1107 /// Accessor to implementation object.
1108 ACE_Hash_Map_Reverse_Iterator_Ex
<KEY
, VALUE
, HASH_KEY
, COMPARE_KEYS
, ACE_Null_Mutex
> &impl (void);
1112 /// All implementation details are forwarded to this class.
1113 ACE_Hash_Map_Reverse_Iterator_Ex
<KEY
, VALUE
, HASH_KEY
, COMPARE_KEYS
, ACE_Null_Mutex
> implementation_
;
1117 * @class ACE_Hash_Map_Manager_Ex_Adapter
1119 * @brief Defines a map implementation.
1121 * Implementation to be provided by ACE_Hash_Map_Manager_Ex.
1123 template <class KEY
, class VALUE
, class HASH_KEY
, class COMPARE_KEYS
, class KEY_GENERATOR
>
1124 class ACE_Hash_Map_Manager_Ex_Adapter
: public ACE_Map
<KEY
, VALUE
>
1129 typedef ACE_Hash_Map_Manager_Ex_Iterator_Adapter
<ACE_Reference_Pair
<const KEY
, VALUE
>, KEY
, VALUE
, HASH_KEY
, COMPARE_KEYS
>
1131 typedef ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter
<ACE_Reference_Pair
<const KEY
, VALUE
>, KEY
, VALUE
, HASH_KEY
, COMPARE_KEYS
>
1132 reverse_iterator_impl
;
1133 typedef ACE_Hash_Map_Manager_Ex
<KEY
, VALUE
, HASH_KEY
, COMPARE_KEYS
, ACE_Null_Mutex
>
1136 // = Initialization and termination methods.
1137 /// Initialize with the ACE_DEFAULT_MAP_SIZE.
1138 ACE_Hash_Map_Manager_Ex_Adapter (ACE_Allocator
*alloc
= 0);
1140 /// Initialize with @a size entries. The @a size parameter is ignored
1141 /// by maps for which an initialize size does not make sense.
1142 ACE_Hash_Map_Manager_Ex_Adapter (size_t size
,
1143 ACE_Allocator
*alloc
= 0);
1145 /// Close down and release dynamically allocated resources.
1146 virtual ~ACE_Hash_Map_Manager_Ex_Adapter (void);
1148 /// Initialize a <Map> with size @a length.
1149 virtual int open (size_t length
= ACE_DEFAULT_MAP_SIZE
,
1150 ACE_Allocator
*alloc
= 0);
1152 /// Close down a <Map> and release dynamically allocated resources.
1153 virtual int close (void);
1156 * Add @a key / @a value pair to the map. If @a key is already in the
1157 * map then no changes are made and 1 is returned. Returns 0 on a
1158 * successful addition. This function fails for maps that do not
1159 * allow user specified keys. @a key is an "in" parameter.
1161 virtual int bind (const KEY
&key
,
1162 const VALUE
&value
);
1165 * Add @a key / @a value pair to the map. @a key is an "inout" parameter
1166 * and maybe modified/extended by the map to add additional
1167 * information. To recover original key, call the <recover_key>
1170 virtual int bind_modify_key (const VALUE
&value
,
1174 * Produce a key and return it through @a key which is an "out"
1175 * parameter. For maps that do not naturally produce keys, the map
1176 * adapters will use the @c KEY_GENERATOR class to produce a key.
1177 * However, the users are responsible for not jeopardizing this key
1178 * production scheme by using user specified keys with keys produced
1179 * by the key generator.
1181 virtual int create_key (KEY
&key
);
1184 * Add @a value to the map, and the corresponding key produced by the
1185 * Map is returned through @a key which is an "out" parameter. For
1186 * maps that do not naturally produce keys, the map adapters will
1187 * use the @c KEY_GENERATOR class to produce a key. However, the
1188 * users are responsible for not jeopardizing this key production
1189 * scheme by using user specified keys with keys produced by the key
1192 virtual int bind_create_key (const VALUE
&value
,
1196 * Add @a value to the map. The user does not care about the
1197 * corresponding key produced by the Map. For maps that do not
1198 * naturally produce keys, the map adapters will use the
1199 * @c KEY_GENERATOR class to produce a key. However, the users are
1200 * responsible for not jeopardizing this key production scheme by
1201 * using user specified keys with keys produced by the key
1204 virtual int bind_create_key (const VALUE
&value
);
1206 /// Recovers the original key potentially modified by the map during
1207 /// <bind_modify_key>.
1208 virtual int recover_key (const KEY
&modified_key
,
1212 * Reassociate @a key with @a value. The function fails if @a key is
1213 * not in the map for maps that do not allow user specified keys.
1214 * However, for maps that allow user specified keys, if the key is
1215 * not in the map, a new @a key / @a value association is created.
1217 virtual int rebind (const KEY
&key
,
1218 const VALUE
&value
);
1221 * Reassociate @a key with @a value, storing the old value into the
1222 * "out" parameter @a old_value. The function fails if @a key is not
1223 * in the map for maps that do not allow user specified keys.
1224 * However, for maps that allow user specified keys, if the key is
1225 * not in the map, a new @a key / @a value association is created.
1227 virtual int rebind (const KEY
&key
,
1232 * Reassociate @a key with @a value, storing the old key and value
1233 * into the "out" parameters @a old_key and @a old_value. The
1234 * function fails if @a key is not in the map for maps that do not
1235 * allow user specified keys. However, for maps that allow user
1236 * specified keys, if the key is not in the map, a new @a key / @a value
1237 * association is created.
1239 virtual int rebind (const KEY
&key
,
1245 * Associate @a key with @a value if and only if @a key is not in the
1246 * map. If @a key is already in the map, then the @a value parameter
1247 * is overwritten with the existing value in the map. Returns 0 if a
1248 * new @a key / @a value association is created. Returns 1 if an
1249 * attempt is made to bind an existing entry. This function fails
1250 * for maps that do not allow user specified keys.
1252 virtual int trybind (const KEY
&key
,
1255 /// Locate @a value associated with @a key.
1256 virtual int find (const KEY
&key
,
1259 /// Is @a key in the map?
1260 virtual int find (const KEY
&key
);
1262 /// Remove @a key from the map.
1263 virtual int unbind (const KEY
&key
);
1265 /// Remove @a key from the map, and return the @a value associated with
1267 virtual int unbind (const KEY
&key
,
1270 /// Return the current size of the map.
1271 virtual size_t current_size (void) const;
1273 /// Return the total size of the map.
1274 virtual size_t total_size (void) const;
1276 /// Dump the state of an object.
1277 virtual void dump (void) const;
1279 /// Accessor to implementation object.
1280 ACE_Hash_Map_Manager_Ex
<KEY
, VALUE
, HASH_KEY
, COMPARE_KEYS
, ACE_Null_Mutex
> &impl (void);
1282 /// Accessor to key generator.
1283 KEY_GENERATOR
&key_generator (void);
1287 /// All implementation details are forwarded to this class.
1288 ACE_Hash_Map_Manager_Ex
<KEY
, VALUE
, HASH_KEY
, COMPARE_KEYS
, ACE_Null_Mutex
> implementation_
;
1290 /// Functor class used for generating key.
1291 KEY_GENERATOR key_generator_
;
1293 // = STL styled iterator factory functions.
1295 /// Return forward iterator.
1296 virtual ACE_Iterator_Impl
<ACE_Reference_Pair
<const KEY
, VALUE
> > *begin_impl (void);
1297 virtual ACE_Iterator_Impl
<ACE_Reference_Pair
<const KEY
, VALUE
> > *end_impl (void);
1299 /// Return reverse iterator.
1300 virtual ACE_Reverse_Iterator_Impl
<ACE_Reference_Pair
<const KEY
, VALUE
> > *rbegin_impl (void);
1301 virtual ACE_Reverse_Iterator_Impl
<ACE_Reference_Pair
<const KEY
, VALUE
> > *rend_impl (void);
1305 // = Disallow these operations.
1306 ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Hash_Map_Manager_Ex_Adapter
<KEY
, VALUE
, HASH_KEY
, COMPARE_KEYS
, KEY_GENERATOR
> &))
1307 ACE_UNIMPLEMENTED_FUNC (ACE_Hash_Map_Manager_Ex_Adapter (const ACE_Hash_Map_Manager_Ex_Adapter
<KEY
, VALUE
, HASH_KEY
, COMPARE_KEYS
, KEY_GENERATOR
> &))
1311 * @class ACE_Map_Manager_Iterator_Adapter
1313 * @brief Defines a iterator implementation for the Map_Manager_Adapter.
1315 * Implementation to be provided by ACE_Map_Manager::iterator.
1317 template <class T
, class KEY
, class VALUE
>
1318 class ACE_Map_Manager_Iterator_Adapter
: public ACE_Iterator_Impl
<T
>
1323 typedef typename ACE_Map_Manager
<KEY
, VALUE
, ACE_Null_Mutex
>::iterator
1327 ACE_Map_Manager_Iterator_Adapter (const ACE_Map_Iterator
<KEY
, VALUE
, ACE_Null_Mutex
> &impl
);
1330 virtual ~ACE_Map_Manager_Iterator_Adapter (void);
1333 virtual ACE_Iterator_Impl
<T
> *clone (void) const;
1336 virtual int compare (const ACE_Iterator_Impl
<T
> &rhs
) const;
1339 virtual T
dereference (void) const;
1342 virtual void plus_plus (void);
1345 virtual void minus_minus (void);
1347 /// Accessor to implementation object.
1348 ACE_Map_Iterator
<KEY
, VALUE
, ACE_Null_Mutex
> &impl (void);
1352 /// All implementation details are forwarded to this class.
1353 ACE_Map_Iterator
<KEY
, VALUE
, ACE_Null_Mutex
> implementation_
;
1357 * @class ACE_Map_Manager_Reverse_Iterator_Adapter
1359 * @brief Defines a reverse iterator implementation for the Map Manager.
1361 * Implementation to be provided by ACE_Map_Manager::reverse_iterator.
1363 template <class T
, class KEY
, class VALUE
>
1364 class ACE_Map_Manager_Reverse_Iterator_Adapter
: public ACE_Reverse_Iterator_Impl
<T
>
1369 typedef typename ACE_Map_Manager
<KEY
, VALUE
, ACE_Null_Mutex
>::reverse_iterator
1373 ACE_Map_Manager_Reverse_Iterator_Adapter (const ACE_Map_Reverse_Iterator
<KEY
, VALUE
, ACE_Null_Mutex
> &impl
);
1376 virtual ~ACE_Map_Manager_Reverse_Iterator_Adapter (void);
1379 virtual ACE_Reverse_Iterator_Impl
<T
> *clone (void) const;
1382 virtual int compare (const ACE_Reverse_Iterator_Impl
<T
> &rhs
) const;
1385 virtual T
dereference (void) const;
1388 virtual void plus_plus (void);
1391 virtual void minus_minus (void);
1393 /// Accessor to implementation object.
1394 ACE_Map_Reverse_Iterator
<KEY
, VALUE
, ACE_Null_Mutex
> &impl (void);
1398 /// All implementation details are forwarded to this class.
1399 ACE_Map_Reverse_Iterator
<KEY
, VALUE
, ACE_Null_Mutex
> implementation_
;
1403 * @class ACE_Map_Manager_Adapter
1405 * @brief Defines a map implementation.
1407 * Implementation to be provided by ACE_Map_Manager.
1409 template <class KEY
, class VALUE
, class KEY_GENERATOR
>
1410 class ACE_Map_Manager_Adapter
: public ACE_Map
<KEY
, VALUE
>
1415 typedef ACE_Map_Manager_Iterator_Adapter
<ACE_Reference_Pair
<const KEY
, VALUE
>, KEY
, VALUE
>
1417 typedef ACE_Map_Manager_Reverse_Iterator_Adapter
<ACE_Reference_Pair
<const KEY
, VALUE
>, KEY
, VALUE
>
1418 reverse_iterator_impl
;
1419 typedef ACE_Map_Manager
<KEY
, VALUE
, ACE_Null_Mutex
>
1422 // = Initialization and termination methods.
1423 /// Initialize with the ACE_DEFAULT_MAP_SIZE.
1424 ACE_Map_Manager_Adapter (ACE_Allocator
*alloc
= 0);
1426 /// Initialize with @a size entries. The @a size parameter is ignored
1427 /// by maps for which an initialize size does not make sense.
1428 ACE_Map_Manager_Adapter (size_t size
,
1429 ACE_Allocator
*alloc
= 0);
1431 /// Close down and release dynamically allocated resources.
1432 virtual ~ACE_Map_Manager_Adapter (void);
1434 /// Initialize a <Map> with size @a length.
1435 virtual int open (size_t length
= ACE_DEFAULT_MAP_SIZE
,
1436 ACE_Allocator
*alloc
= 0);
1438 /// Close down a <Map> and release dynamically allocated resources.
1439 virtual int close (void);
1442 * Add @a key / @a value pair to the map. If @a key is already in the
1443 * map then no changes are made and 1 is returned. Returns 0 on a
1444 * successful addition. This function fails for maps that do not
1445 * allow user specified keys. @a key is an "in" parameter.
1447 virtual int bind (const KEY
&key
,
1448 const VALUE
&value
);
1451 * Add @a key / @a value pair to the map. @a key is an "inout" parameter
1452 * and maybe modified/extended by the map to add additional
1453 * information. To recover original key, call the <recover_key>
1456 virtual int bind_modify_key (const VALUE
&value
,
1460 * Produce a key and return it through @a key which is an "out"
1461 * parameter. For maps that do not naturally produce keys, the map
1462 * adapters will use the @c KEY_GENERATOR class to produce a key.
1463 * However, the users are responsible for not jeopardizing this key
1464 * production scheme by using user specified keys with keys produced
1465 * by the key generator.
1467 virtual int create_key (KEY
&key
);
1470 * Add @a value to the map, and the corresponding key produced by the
1471 * Map is returned through @a key which is an "out" parameter. For
1472 * maps that do not naturally produce keys, the map adapters will
1473 * use the @c KEY_GENERATOR class to produce a key. However, the
1474 * users are responsible for not jeopardizing this key production
1475 * scheme by using user specified keys with keys produced by the key
1478 virtual int bind_create_key (const VALUE
&value
,
1482 * Add @a value to the map. The user does not care about the
1483 * corresponding key produced by the Map. For maps that do not
1484 * naturally produce keys, the map adapters will use the
1485 * @c KEY_GENERATOR class to produce a key. However, the users are
1486 * responsible for not jeopardizing this key production scheme by
1487 * using user specified keys with keys produced by the key
1490 virtual int bind_create_key (const VALUE
&value
);
1492 /// Recovers the original key potentially modified by the map during
1493 /// <bind_modify_key>.
1494 virtual int recover_key (const KEY
&modified_key
,
1498 * Reassociate @a key with @a value. The function fails if @a key is
1499 * not in the map for maps that do not allow user specified keys.
1500 * However, for maps that allow user specified keys, if the key is
1501 * not in the map, a new @a key / @a value association is created.
1503 virtual int rebind (const KEY
&key
,
1504 const VALUE
&value
);
1507 * Reassociate @a key with @a value, storing the old value into the
1508 * "out" parameter @a old_value. The function fails if @a key is not
1509 * in the map for maps that do not allow user specified keys.
1510 * However, for maps that allow user specified keys, if the key is
1511 * not in the map, a new @a key / @a value association is created.
1513 virtual int rebind (const KEY
&key
,
1518 * Reassociate @a key with @a value, storing the old key and value
1519 * into the "out" parameters @a old_key and @a old_value. The
1520 * function fails if @a key is not in the map for maps that do not
1521 * allow user specified keys. However, for maps that allow user
1522 * specified keys, if the key is not in the map, a new @a key / @a value
1523 * association is created.
1525 virtual int rebind (const KEY
&key
,
1531 * Associate @a key with @a value if and only if @a key is not in the
1532 * map. If @a key is already in the map, then the @a value parameter
1533 * is overwritten with the existing value in the map. Returns 0 if a
1534 * new @a key / @a value association is created. Returns 1 if an
1535 * attempt is made to bind an existing entry. This function fails
1536 * for maps that do not allow user specified keys.
1538 virtual int trybind (const KEY
&key
,
1541 /// Locate @a value associated with @a key.
1542 virtual int find (const KEY
&key
,
1545 /// Is @a key in the map?
1546 virtual int find (const KEY
&key
);
1548 /// Remove @a key from the map.
1549 virtual int unbind (const KEY
&key
);
1551 /// Remove @a key from the map, and return the @a value associated with
1553 virtual int unbind (const KEY
&key
,
1556 /// Return the current size of the map.
1557 virtual size_t current_size (void) const;
1559 /// Return the total size of the map.
1560 virtual size_t total_size (void) const;
1562 /// Dump the state of an object.
1563 virtual void dump (void) const;
1565 /// Accessor to implementation object.
1566 ACE_Map_Manager
<KEY
, VALUE
, ACE_Null_Mutex
> &impl (void);
1568 /// Accessor to key generator.
1569 KEY_GENERATOR
&key_generator (void);
1573 /// All implementation details are forwarded to this class.
1574 ACE_Map_Manager
<KEY
, VALUE
, ACE_Null_Mutex
> implementation_
;
1576 /// Functor class used for generating key.
1577 KEY_GENERATOR key_generator_
;
1579 // = STL styled iterator factory functions.
1581 /// Return forward iterator.
1582 virtual ACE_Iterator_Impl
<ACE_Reference_Pair
<const KEY
, VALUE
> > *begin_impl (void);
1583 virtual ACE_Iterator_Impl
<ACE_Reference_Pair
<const KEY
, VALUE
> > *end_impl (void);
1585 /// Return reverse iterator.
1586 virtual ACE_Reverse_Iterator_Impl
<ACE_Reference_Pair
<const KEY
, VALUE
> > *rbegin_impl (void);
1587 virtual ACE_Reverse_Iterator_Impl
<ACE_Reference_Pair
<const KEY
, VALUE
> > *rend_impl (void);
1591 // = Disallow these operations.
1592 ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Map_Manager_Adapter
<KEY
, VALUE
, KEY_GENERATOR
> &))
1593 ACE_UNIMPLEMENTED_FUNC (ACE_Map_Manager_Adapter (const ACE_Map_Manager_Adapter
<KEY
, VALUE
, KEY_GENERATOR
> &))
1596 ACE_END_VERSIONED_NAMESPACE_DECL
1598 #if defined (__ACE_INLINE__)
1599 #include "ace/Map_T.inl"
1600 #endif /* __ACE_INLINE__ */
1602 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
1603 #include "ace/Map_T.cpp"
1604 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
1606 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
1607 #pragma implementation ("Map_T.cpp")
1608 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
1610 #include /**/ "ace/post.h"
1611 #endif /* ACE_MAP_T_H */