Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# ACE_Map Class Template Reference

Defines a map interface. More...

`#include <Map_T.h>`

Inheritance diagram for ACE_Map

[legend]
List of all members.

## Public Types
typedef KEY | key_type
typedef VALUE | mapped_type
typedef ACE_Reference_Pair< const KEY, VALUE> | value_type
typedef ACE_Iterator<value_type> | iterator
typedef ACE_Reverse_Iterator< value_type> | reverse_iterator
typedef ACE_Iterator_Impl< value_type> | iterator_implementation
typedef ACE_Reverse_Iterator_Impl< value_type> | reverse_iterator_implementation
## Public Methods
virtual | ~ACE_Map (void)
| Close down and release dynamically allocated resources.
virtual int | open (size_t length = ACE_DEFAULT_MAP_SIZE, ACE_Allocator *alloc = 0) = 0
| Initialize a <Map> with size <length>.
virtual int | close (void) = 0
| Close down a <Map> and release dynamically allocated resources.
virtual int | bind (const KEY &key, const VALUE &value) = 0
virtual int | bind_modify_key (const VALUE &value, KEY &key) = 0
virtual int | create_key (KEY &key) = 0
virtual int | bind_create_key (const VALUE &value, KEY &key) = 0
virtual int | bind_create_key (const VALUE &value) = 0
virtual int | recover_key (const KEY &modified_key, KEY &original_key) = 0
| Recovers the original key potentially modified by the map during <bind_modify_key>.
virtual int | rebind (const KEY &key, const VALUE &value) = 0
virtual int | rebind (const KEY &key, const VALUE &value, VALUE &old_value) = 0
virtual int | rebind (const KEY &key, const VALUE &value, KEY &old_key, VALUE &old_value) = 0
virtual int | trybind (const KEY &key, VALUE &value) = 0
virtual int | find (const KEY &key, VALUE &value) = 0
| Locate <value> associated with <key>.
virtual int | find (const KEY &key) = 0
| Is <key> in the map?
virtual int | unbind (const KEY &key) = 0
| Remove <key> from the map.
virtual int | unbind (const KEY &key, VALUE &value) = 0
| Remove <key> from the map, and return the <value> associated with <key>.
virtual size_t | current_size (void) const = 0
| Return the current size of the map.
virtual size_t | total_size (void) const = 0
| Return the total size of the map.
virtual void | dump (void) const = 0
| Dump the state of an object.
iterator | begin (void)
| Return forward iterator.
iterator | end (void)
reverse_iterator | rbegin (void)
| Return reverse iterator.
reverse_iterator | rend (void)
## Protected Methods
| ACE_Map (void)
virtual ACE_Iterator_Impl< ACE_Reference_Pair<const KEY, VALUE> >* | begin_impl (void) = 0
| Return forward iterator.
virtual ACE_Iterator_Impl< ACE_Reference_Pair<const KEY, VALUE> >* | end_impl (void) = 0
virtual ACE_Reverse_Iterator_Impl< ACE_Reference_Pair<const KEY, VALUE> >* | rbegin_impl (void) = 0
| Return reverse iterator.
virtual ACE_Reverse_Iterator_Impl< ACE_Reference_Pair<const KEY, VALUE> >* | rend_impl (void) = 0
## Private Methods
void | operator= (const ACE_Map<KEY, VALUE> &)
| ACE_Map (const ACE_Map<KEY, VALUE> &)

## Detailed Description

### template<class KEY, class VALUE> template class ACE_Map

Defines a map interface.

Implementation to be provided by subclasses.

## Member Typedef Documentation

template<classKEY, classVALUE>
typedef ACE_Iterator<value_type> ACE_Map<KEY, VALUE>::iterator

template<classKEY, classVALUE>
typedef ACE_Iterator_Impl<value_type> ACE_Map<KEY, VALUE>::iterator_implementation

template<classKEY, classVALUE>
typedef KEY ACE_Map<KEY, VALUE>::key_type

template<classKEY, classVALUE>
typedef VALUE ACE_Map<KEY, VALUE>::mapped_type

template<classKEY, classVALUE>
typedef ACE_Reverse_Iterator<value_type> ACE_Map<KEY, VALUE>::reverse_iterator

template<classKEY, classVALUE>
typedef ACE_Reverse_Iterator_Impl<value_type> ACE_Map<KEY, VALUE>::reverse_iterator_implementation

template<classKEY, classVALUE>
typedef ACE_Reference_Pair<const KEY, VALUE> ACE_Map<KEY, VALUE>::value_type

## Constructor & Destructor Documentation

template<classKEY, classVALUE>
ACE_INLINE ACE_Map< KEY,VALUE >::~ACE_Map<KEY, VALUE> ( | void )`[virtual]`

| Close down and release dynamically allocated resources.

template<classKEY, classVALUE>
ACE_INLINE ACE_Map< KEY,VALUE >::ACE_Map<KEY, VALUE> ( | void )`[protected]`

template<classKEY, classVALUE>
ACE_Map<KEY, VALUE>::ACE_Map<KEY, VALUE> ( | const ACE_Map< KEY,VALUE >& )`[private]`

## Member Function Documentation

template<classKEY, classVALUE>
ACE_INLINE ACE_Iterator< ACE_Reference_Pair< const KEY,VALUE > > ACE_Map< KEY,VALUE >::begin ( | void )

| Return forward iterator.

template<classKEY, classVALUE>
ACE_Iterator_Impl< ACE_Reference_Pair< const KEY,VALUE > >* ACE_Map<KEY, VALUE>::begin_impl ( | void )`[protected, pure virtual]`

| Return forward iterator. Reimplemented in ACE_Map_Impl, ACE_Active_Map_Manager_Adapter, ACE_Hash_Map_Manager_Ex_Adapter, and ACE_Map_Manager_Adapter.

template<classKEY, classVALUE>
int ACE_Map<KEY, VALUE>::bind ( | const KEY & key,
| const VALUE & value )`[pure virtual]`

| Add <key>/<value> pair to the map. If <key> is already in the map then no changes are made and 1 is returned. Returns 0 on a successful addition. This function fails for maps that do not allow user specified keys. <key> is an "in" parameter. Reimplemented in ACE_Map_Impl, ACE_Active_Map_Manager_Adapter, ACE_Hash_Map_Manager_Ex_Adapter, and ACE_Map_Manager_Adapter.

template<classKEY, classVALUE>
int ACE_Map<KEY, VALUE>::bind_create_key ( | const VALUE & value )`[pure virtual]`

| Add <value> to the map. The user does not care about the corresponding key produced by the Map. For maps that do not naturally produce keys, the map adapters will use the <KEY_GENERATOR> class to produce a key. However, the users are responsible for not jeopardizing this key production scheme by using user specified keys with keys produced by the key generator. Reimplemented in ACE_Map_Impl, ACE_Active_Map_Manager_Adapter, ACE_Hash_Map_Manager_Ex_Adapter, and ACE_Map_Manager_Adapter.

template<classKEY, classVALUE>
int ACE_Map<KEY, VALUE>::bind_create_key ( | const VALUE & value,
| KEY & key )`[pure virtual]`

| Add <value> to the map, and the corresponding key produced by the Map is returned through <key> which is an "out" parameter. For maps that do not naturally produce keys, the map adapters will use the <KEY_GENERATOR> class to produce a key. However, the users are responsible for not jeopardizing this key production scheme by using user specified keys with keys produced by the key generator. Reimplemented in ACE_Map_Impl, ACE_Active_Map_Manager_Adapter, ACE_Hash_Map_Manager_Ex_Adapter, and ACE_Map_Manager_Adapter.

template<classKEY, classVALUE>
int ACE_Map<KEY, VALUE>::bind_modify_key ( | const VALUE & value,
| KEY & key )`[pure virtual]`

| Add <key>/<value> pair to the map. <key> is an "inout" parameter and maybe modified/extended by the map to add additional information. To recover original key, call the <recover_key> method. Reimplemented in ACE_Map_Impl, ACE_Active_Map_Manager_Adapter, ACE_Hash_Map_Manager_Ex_Adapter, and ACE_Map_Manager_Adapter.

template<classKEY, classVALUE>
int ACE_Map<KEY, VALUE>::close ( | void )`[pure virtual]`

| Close down a <Map> and release dynamically allocated resources. Reimplemented in ACE_Map_Impl, ACE_Active_Map_Manager_Adapter, ACE_Hash_Map_Manager_Ex_Adapter, and ACE_Map_Manager_Adapter.

template<classKEY, classVALUE>
int ACE_Map<KEY, VALUE>::create_key ( | KEY & key )`[pure virtual]`

| Produce a key and return it through <key> which is an "out" parameter. For maps that do not naturally produce keys, the map adapters will use the <KEY_GENERATOR> class to produce a key. However, the users are responsible for not jeopardizing this key production scheme by using user specified keys with keys produced by the key generator. Reimplemented in ACE_Map_Impl, ACE_Active_Map_Manager_Adapter, ACE_Hash_Map_Manager_Ex_Adapter, and ACE_Map_Manager_Adapter.

template<classKEY, classVALUE>
size_t ACE_Map<KEY, VALUE>::current_size ( | void ) const`[pure virtual]`

| Return the current size of the map. Reimplemented in ACE_Map_Impl, ACE_Active_Map_Manager_Adapter, ACE_Hash_Map_Manager_Ex_Adapter, and ACE_Map_Manager_Adapter.

template<classKEY, classVALUE>
void ACE_Map<KEY, VALUE>::dump ( | void ) const`[pure virtual]`

| Dump the state of an object. Reimplemented in ACE_Map_Impl, ACE_Active_Map_Manager_Adapter, ACE_Hash_Map_Manager_Ex_Adapter, and ACE_Map_Manager_Adapter.

template<classKEY, classVALUE>
ACE_INLINE ACE_Iterator< ACE_Reference_Pair< const KEY,VALUE > > ACE_Map< KEY,VALUE >::end ( | void )

template<classKEY, classVALUE>
virtual ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> >* ACE_Map<KEY, VALUE>::end_impl ( | void )`[protected, pure virtual]`

| Reimplemented in ACE_Map_Impl, ACE_Active_Map_Manager_Adapter, ACE_Hash_Map_Manager_Ex_Adapter, and ACE_Map_Manager_Adapter.

template<classKEY, classVALUE>
int ACE_Map<KEY, VALUE>::find ( | const KEY & key )`[pure virtual]`

| Is <key> in the map? Reimplemented in ACE_Map_Impl, ACE_Active_Map_Manager_Adapter, ACE_Hash_Map_Manager_Ex_Adapter, and ACE_Map_Manager_Adapter.

template<classKEY, classVALUE>
int ACE_Map<KEY, VALUE>::find ( | const KEY & key,
| VALUE & value )`[pure virtual]`

| Locate <value> associated with <key>. Reimplemented in ACE_Map_Impl, ACE_Active_Map_Manager_Adapter, ACE_Hash_Map_Manager_Ex_Adapter, and ACE_Map_Manager_Adapter.

template<classKEY, classVALUE>
int ACE_Map<KEY, VALUE>::open ( | size_t length = ACE_DEFAULT_MAP_SIZE,
| ACE_Allocator * alloc = 0 )`[pure virtual]`

| Initialize a <Map> with size <length>. Reimplemented in ACE_Map_Impl, ACE_Active_Map_Manager_Adapter, ACE_Hash_Map_Manager_Ex_Adapter, and ACE_Map_Manager_Adapter.

template<classKEY, classVALUE>
void ACE_Map<KEY, VALUE>::operator= ( | const ACE_Map< KEY,VALUE >& )`[private]`

template<classKEY, classVALUE>
ACE_INLINE ACE_Reverse_Iterator< ACE_Reference_Pair< const KEY,VALUE > > ACE_Map< KEY,VALUE >::rbegin ( | void )

| Return reverse iterator.

template<classKEY, classVALUE>
ACE_Reverse_Iterator_Impl< ACE_Reference_Pair< const KEY,VALUE > >* ACE_Map<KEY, VALUE>::rbegin_impl ( | void )`[protected, pure virtual]`

| Return reverse iterator. Reimplemented in ACE_Map_Impl, ACE_Active_Map_Manager_Adapter, ACE_Hash_Map_Manager_Ex_Adapter, and ACE_Map_Manager_Adapter.

template<classKEY, classVALUE>
int ACE_Map<KEY, VALUE>::rebind ( | const KEY & key,
| const VALUE & value,
| KEY & old_key,
| VALUE & old_value )`[pure virtual]`

| Reassociate <key> with <value>, storing the old key and value into the "out" parameters <old_key> and <old_value>. The function fails if <key> is not in the map for maps that do not allow user specified keys. However, for maps that allow user specified keys, if the key is not in the map, a new <key>/<value> association is created. Reimplemented in ACE_Map_Impl, ACE_Active_Map_Manager_Adapter, ACE_Hash_Map_Manager_Ex_Adapter, and ACE_Map_Manager_Adapter.

template<classKEY, classVALUE>
int ACE_Map<KEY, VALUE>::rebind ( | const KEY & key,
| const VALUE & value,
| VALUE & old_value )`[pure virtual]`

| Reassociate <key> with <value>, storing the old value into the "out" parameter <old_value>. The function fails if <key> is not in the map for maps that do not allow user specified keys. However, for maps that allow user specified keys, if the key is not in the map, a new <key>/<value> association is created. Reimplemented in ACE_Map_Impl, ACE_Active_Map_Manager_Adapter, ACE_Hash_Map_Manager_Ex_Adapter, and ACE_Map_Manager_Adapter.

template<classKEY, classVALUE>
int ACE_Map<KEY, VALUE>::rebind ( | const KEY & key,
| const VALUE & value )`[pure virtual]`

| Reassociate <key> with <value>. The function fails if <key> is not in the map for maps that do not allow user specified keys. However, for maps that allow user specified keys, if the key is not in the map, a new <key>/<value> association is created. Reimplemented in ACE_Map_Impl, ACE_Active_Map_Manager_Adapter, ACE_Hash_Map_Manager_Ex_Adapter, and ACE_Map_Manager_Adapter.

template<classKEY, classVALUE>
int ACE_Map<KEY, VALUE>::recover_key ( | const KEY & modified_key,
| KEY & original_key )`[pure virtual]`

| Recovers the original key potentially modified by the map during <bind_modify_key>. Reimplemented in ACE_Map_Impl, ACE_Active_Map_Manager_Adapter, ACE_Hash_Map_Manager_Ex_Adapter, and ACE_Map_Manager_Adapter.

template<classKEY, classVALUE>
ACE_INLINE ACE_Reverse_Iterator< ACE_Reference_Pair< const KEY,VALUE > > ACE_Map< KEY,VALUE >::rend ( | void )

template<classKEY, classVALUE>
virtual ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> >* ACE_Map<KEY, VALUE>::rend_impl ( | void )`[protected, pure virtual]`

| Reimplemented in ACE_Map_Impl, ACE_Active_Map_Manager_Adapter, ACE_Hash_Map_Manager_Ex_Adapter, and ACE_Map_Manager_Adapter.

template<classKEY, classVALUE>
size_t ACE_Map<KEY, VALUE>::total_size ( | void ) const`[pure virtual]`

| Return the total size of the map. Reimplemented in ACE_Map_Impl, ACE_Active_Map_Manager_Adapter, ACE_Hash_Map_Manager_Ex_Adapter, and ACE_Map_Manager_Adapter.

template<classKEY, classVALUE>
int ACE_Map<KEY, VALUE>::trybind ( | const KEY & key,
| VALUE & value )`[pure virtual]`

| Associate <key> with <value> if and only if <key> is not in the map. If <key> is already in the map, then the <value> parameter is overwritten with the existing value in the map. Returns 0 if a new <key>/<value> association is created. Returns 1 if an attempt is made to bind an existing entry. This function fails for maps that do not allow user specified keys. Reimplemented in ACE_Map_Impl, ACE_Active_Map_Manager_Adapter, ACE_Hash_Map_Manager_Ex_Adapter, and ACE_Map_Manager_Adapter.

template<classKEY, classVALUE>
int ACE_Map<KEY, VALUE>::unbind ( | const KEY & key,
| VALUE & value )`[pure virtual]`

| Remove <key> from the map, and return the <value> associated with <key>. Reimplemented in ACE_Map_Impl, ACE_Active_Map_Manager_Adapter, ACE_Hash_Map_Manager_Ex_Adapter, and ACE_Map_Manager_Adapter.

template<classKEY, classVALUE>
int ACE_Map<KEY, VALUE>::unbind ( | const KEY & key )`[pure virtual]`

| Remove <key> from the map. Reimplemented in ACE_Map_Impl, ACE_Active_Map_Manager_Adapter, ACE_Hash_Map_Manager_Ex_Adapter, and ACE_Map_Manager_Adapter.

The documentation for this class was generated from the following files:

- Map_T.h
- Map_T.i