Defines a map implementation. More...
#include <Map_T.h>
Public Types | |
typedef ACE_Hash_Map_Manager_Ex_Iterator_Adapter < ACE_Reference_Pair< const KEY, VALUE >, KEY, VALUE, HASH_KEY, COMPARE_KEYS > | iterator_impl |
typedef ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter < ACE_Reference_Pair< const KEY, VALUE >, KEY, VALUE, HASH_KEY, COMPARE_KEYS > | reverse_iterator_impl |
typedef ACE_Hash_Map_Manager_Ex< KEY, VALUE, HASH_KEY, COMPARE_KEYS, ACE_Null_Mutex > | implementation |
Public Member Functions | |
ACE_Hash_Map_Manager_Ex_Adapter (ACE_Allocator *alloc=0) | |
Initialize with the ACE_DEFAULT_MAP_SIZE. | |
ACE_Hash_Map_Manager_Ex_Adapter (size_t size, ACE_Allocator *alloc=0) | |
virtual | ~ACE_Hash_Map_Manager_Ex_Adapter (void) |
Close down and release dynamically allocated resources. | |
virtual int | open (size_t length=ACE_DEFAULT_MAP_SIZE, ACE_Allocator *alloc=0) |
Initialize a Map with size length. | |
virtual int | close (void) |
Close down a Map and release dynamically allocated resources. | |
virtual int | bind (const KEY &key, const VALUE &value) |
virtual int | bind_modify_key (const VALUE &value, KEY &key) |
virtual int | create_key (KEY &key) |
virtual int | bind_create_key (const VALUE &value, KEY &key) |
virtual int | bind_create_key (const VALUE &value) |
virtual int | recover_key (const KEY &modified_key, KEY &original_key) |
virtual int | rebind (const KEY &key, const VALUE &value) |
virtual int | rebind (const KEY &key, const VALUE &value, VALUE &old_value) |
virtual int | rebind (const KEY &key, const VALUE &value, KEY &old_key, VALUE &old_value) |
virtual int | trybind (const KEY &key, VALUE &value) |
virtual int | find (const KEY &key, VALUE &value) |
Locate value associated with key. | |
virtual int | find (const KEY &key) |
Is key in the map? | |
virtual int | unbind (const KEY &key) |
Remove key from the map. | |
virtual int | unbind (const KEY &key, VALUE &value) |
virtual size_t | current_size (void) const |
Return the current size of the map. | |
virtual size_t | total_size (void) const |
Return the total size of the map. | |
virtual void | dump (void) const |
Dump the state of an object. | |
ACE_Hash_Map_Manager_Ex< KEY, VALUE, HASH_KEY, COMPARE_KEYS, ACE_Null_Mutex > & | impl (void) |
Accessor to implementation object. | |
KEY_GENERATOR & | key_generator (void) |
Accessor to key generator. | |
Protected Member Functions | |
virtual ACE_Iterator_Impl < ACE_Reference_Pair< const KEY, VALUE > > * | begin_impl (void) |
Return forward iterator. | |
virtual ACE_Iterator_Impl < ACE_Reference_Pair< const KEY, VALUE > > * | end_impl (void) |
virtual ACE_Reverse_Iterator_Impl < ACE_Reference_Pair< const KEY, VALUE > > * | rbegin_impl (void) |
Return reverse iterator. | |
virtual ACE_Reverse_Iterator_Impl < ACE_Reference_Pair< const KEY, VALUE > > * | rend_impl (void) |
Protected Attributes | |
ACE_Hash_Map_Manager_Ex< KEY, VALUE, HASH_KEY, COMPARE_KEYS, ACE_Null_Mutex > | implementation_ |
All implementation details are forwarded to this class. | |
KEY_GENERATOR | key_generator_ |
Functor class used for generating key. | |
Private Member Functions | |
void | operator= (const ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR > &) |
ACE_Hash_Map_Manager_Ex_Adapter (const ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR > &) |
Defines a map implementation.
Implementation to be provided by ACE_Hash_Map_Manager_Ex.
Definition at line 1124 of file Map_T.h.
typedef ACE_Hash_Map_Manager_Ex<KEY, VALUE, HASH_KEY, COMPARE_KEYS, ACE_Null_Mutex> ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::implementation |
typedef ACE_Hash_Map_Manager_Ex_Iterator_Adapter<ACE_Reference_Pair<const KEY, VALUE>, KEY, VALUE, HASH_KEY, COMPARE_KEYS> ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::iterator_impl |
typedef ACE_Hash_Map_Manager_Ex_Reverse_Iterator_Adapter<ACE_Reference_Pair<const KEY, VALUE>, KEY, VALUE, HASH_KEY, COMPARE_KEYS> ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::reverse_iterator_impl |
ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::ACE_Hash_Map_Manager_Ex_Adapter | ( | ACE_Allocator * | alloc = 0 |
) | [inline] |
Initialize with the ACE_DEFAULT_MAP_SIZE.
Definition at line 340 of file Map_T.inl.
: implementation_ (alloc) { }
ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::ACE_Hash_Map_Manager_Ex_Adapter | ( | size_t | size, | |
ACE_Allocator * | alloc = 0 | |||
) | [inline] |
Initialize with size entries. The size parameter is ignored by maps for which an initialize size does not make sense.
Definition at line 346 of file Map_T.inl.
: implementation_ (size, alloc) { }
ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::~ACE_Hash_Map_Manager_Ex_Adapter | ( | void | ) | [virtual] |
ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::ACE_Hash_Map_Manager_Ex_Adapter | ( | const ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR > & | ) | [private] |
ACE_Iterator_Impl< ACE_Reference_Pair< const KEY, VALUE > > * ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::begin_impl | ( | void | ) | [protected, virtual] |
Return forward iterator.
Implements ACE_Map< KEY, VALUE >.
Definition at line 1009 of file Map_T.cpp.
{ ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0; ACE_NEW_RETURN (temp, iterator_impl (this->implementation_.begin ()), 0); return temp; }
int ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::bind | ( | const KEY & | key, | |
const VALUE & | value | |||
) | [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.
Implements ACE_Map< KEY, VALUE >.
Definition at line 867 of file Map_T.cpp.
{ return this->implementation_.bind (key, value); }
int ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::bind_create_key | ( | const VALUE & | value, | |
KEY & | key | |||
) | [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.
Implements ACE_Map< KEY, VALUE >.
Definition at line 890 of file Map_T.cpp.
{ // Invoke the user specified key generation functor. int result = this->key_generator_ (key); if (result == 0) { // Try to add. result = this->implementation_.bind (key, value); } return result; }
int ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::bind_create_key | ( | const VALUE & | value | ) | [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.
Implements ACE_Map< KEY, VALUE >.
Definition at line 907 of file Map_T.cpp.
{ KEY key; return this->bind_create_key (value, key); }
int ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::bind_modify_key | ( | const VALUE & | value, | |
KEY & | key | |||
) | [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.
Implements ACE_Map< KEY, VALUE >.
Definition at line 875 of file Map_T.cpp.
{ return this->implementation_.bind (key, value); }
int ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::close | ( | void | ) | [virtual] |
Close down a Map and release dynamically allocated resources.
Implements ACE_Map< KEY, VALUE >.
Definition at line 861 of file Map_T.cpp.
{ return this->implementation_.close (); }
int ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::create_key | ( | KEY & | key | ) | [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.
Implements ACE_Map< KEY, VALUE >.
Definition at line 883 of file Map_T.cpp.
{ // Invoke the user specified key generation functor. return this->key_generator_ (key); }
size_t ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::current_size | ( | void | ) | const [virtual] |
Return the current size of the map.
Implements ACE_Map< KEY, VALUE >.
Definition at line 989 of file Map_T.cpp.
{ return this->implementation_.current_size (); }
void ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::dump | ( | void | ) | const [virtual] |
Dump the state of an object.
Implements ACE_Map< KEY, VALUE >.
Definition at line 1001 of file Map_T.cpp.
{ #if defined (ACE_HAS_DUMP) this->implementation_.dump (); #endif /* ACE_HAS_DUMP */ }
ACE_Iterator_Impl< ACE_Reference_Pair< const KEY, VALUE > > * ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::end_impl | ( | void | ) | [protected, virtual] |
Implements ACE_Map< KEY, VALUE >.
Definition at line 1019 of file Map_T.cpp.
{ ACE_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0; ACE_NEW_RETURN (temp, iterator_impl (this->implementation_.end ()), 0); return temp; }
int ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::find | ( | const KEY & | key, | |
VALUE & | value | |||
) | [virtual] |
Locate value associated with key.
Implements ACE_Map< KEY, VALUE >.
Definition at line 961 of file Map_T.cpp.
{ return this->implementation_.find (key, value); }
int ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::find | ( | const KEY & | key | ) | [virtual] |
Is key in the map?
Implements ACE_Map< KEY, VALUE >.
Definition at line 969 of file Map_T.cpp.
{ return this->implementation_.find (key); }
ACE_Hash_Map_Manager_Ex< KEY, VALUE, HASH_KEY, COMPARE_KEYS, ACE_Null_Mutex > & ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::impl | ( | void | ) | [inline] |
Accessor to implementation object.
Definition at line 354 of file Map_T.inl.
{ return this->implementation_; }
KEY_GENERATOR & ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::key_generator | ( | void | ) | [inline] |
Accessor to key generator.
Definition at line 360 of file Map_T.inl.
{ return this->key_generator_; }
int ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::open | ( | size_t | length = ACE_DEFAULT_MAP_SIZE , |
|
ACE_Allocator * | alloc = 0 | |||
) | [virtual] |
Initialize a Map with size length.
Implements ACE_Map< KEY, VALUE >.
Definition at line 853 of file Map_T.cpp.
{ return this->implementation_.open (length, alloc); }
void ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::operator= | ( | const ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR > & | ) | [private] |
ACE_Reverse_Iterator_Impl< ACE_Reference_Pair< const KEY, VALUE > > * ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::rbegin_impl | ( | void | ) | [protected, virtual] |
Return reverse iterator.
Implements ACE_Map< KEY, VALUE >.
Definition at line 1029 of file Map_T.cpp.
{ ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0; ACE_NEW_RETURN (temp, reverse_iterator_impl (this->implementation_.rbegin ()), 0); return temp; }
int ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::rebind | ( | const KEY & | key, | |
const VALUE & | value, | |||
VALUE & | old_value | |||
) | [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.
Implements ACE_Map< KEY, VALUE >.
Definition at line 931 of file Map_T.cpp.
{ return this->implementation_.rebind (key, value, old_value); }
int ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::rebind | ( | const KEY & | key, | |
const VALUE & | value | |||
) | [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.
Implements ACE_Map< KEY, VALUE >.
Definition at line 923 of file Map_T.cpp.
{ return this->implementation_.rebind (key, value); }
int ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::rebind | ( | const KEY & | key, | |
const VALUE & | value, | |||
KEY & | old_key, | |||
VALUE & | old_value | |||
) | [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.
Implements ACE_Map< KEY, VALUE >.
Definition at line 941 of file Map_T.cpp.
{ return this->implementation_.rebind (key, value, old_key, old_value); }
int ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::recover_key | ( | const KEY & | modified_key, | |
KEY & | original_key | |||
) | [virtual] |
Recovers the original key potentially modified by the map during bind_modify_key().
Implements ACE_Map< KEY, VALUE >.
Definition at line 915 of file Map_T.cpp.
{
original_key = modified_key;
return 0;
}
ACE_Reverse_Iterator_Impl< ACE_Reference_Pair< const KEY, VALUE > > * ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::rend_impl | ( | void | ) | [protected, virtual] |
Implements ACE_Map< KEY, VALUE >.
Definition at line 1039 of file Map_T.cpp.
{ ACE_Reverse_Iterator_Impl<ACE_Reference_Pair<const KEY, VALUE> > *temp = 0; ACE_NEW_RETURN (temp, reverse_iterator_impl (this->implementation_.rend ()), 0); return temp; }
size_t ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::total_size | ( | void | ) | const [virtual] |
Return the total size of the map.
Implements ACE_Map< KEY, VALUE >.
Definition at line 995 of file Map_T.cpp.
{ return this->implementation_.total_size (); }
int ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::trybind | ( | const KEY & | key, | |
VALUE & | value | |||
) | [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.
Implements ACE_Map< KEY, VALUE >.
Definition at line 953 of file Map_T.cpp.
{ return this->implementation_.trybind (key, value); }
int ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::unbind | ( | const KEY & | key | ) | [virtual] |
Remove key from the map.
Implements ACE_Map< KEY, VALUE >.
Definition at line 975 of file Map_T.cpp.
{ return this->implementation_.unbind (key); }
int ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::unbind | ( | const KEY & | key, | |
VALUE & | value | |||
) | [virtual] |
Remove key from the map, and return the value associated with key.
Implements ACE_Map< KEY, VALUE >.
Definition at line 981 of file Map_T.cpp.
{ return this->implementation_.unbind (key, value); }
ACE_Hash_Map_Manager_Ex<KEY, VALUE, HASH_KEY, COMPARE_KEYS, ACE_Null_Mutex> ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::implementation_ [protected] |
KEY_GENERATOR ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::key_generator_ [protected] |