EXT_ID
type objects with INT_ID
type objects.
More...
#include <Hash_Map_Manager_T.h>
Collaboration diagram for ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >:
Public Types | |
typedef EXT_ID | KEY |
typedef INT_ID | VALUE |
typedef ACE_LOCK | lock_type |
typedef ACE_Hash_Map_Entry< EXT_ID, INT_ID > | ENTRY |
typedef ACE_Hash_Map_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > | ITERATOR |
typedef ACE_Hash_Map_Const_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > | CONST_ITERATOR |
typedef ACE_Hash_Map_Reverse_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > | REVERSE_ITERATOR |
typedef ACE_Hash_Map_Const_Reverse_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > | CONST_REVERSE_ITERATOR |
typedef ACE_Hash_Map_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > | iterator |
typedef ACE_Hash_Map_Const_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > | const_iterator |
typedef ACE_Hash_Map_Reverse_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > | reverse_iterator |
typedef ACE_Hash_Map_Const_Reverse_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > | const_reverse_iterator |
typedef EXT_ID | key_type |
typedef INT_ID | data_type |
typedef ACE_Hash_Map_Entry< EXT_ID, INT_ID > | value_type |
typedef value_type & | reference |
typedef value_type const & | const_reference |
typedef value_type * | pointer |
typedef value_type const * | const_pointer |
typedef ptrdiff_t | difference_type |
typedef size_t | size_type |
Public Member Functions | |
ACE_Hash_Map_Manager_Ex (ACE_Allocator *table_alloc=0, ACE_Allocator *entry_alloc=0) | |
ACE_Hash_Map_Manager_Ex (size_t size, ACE_Allocator *table_alloc=0, ACE_Allocator *entry_alloc=0) | |
int | open (size_t size=ACE_DEFAULT_MAP_SIZE, ACE_Allocator *table_alloc=0, ACE_Allocator *entry_alloc=0) |
int | close (void) |
int | unbind_all (void) |
Removes all the entries in the ACE_Hash_Map_Manager_Ex. | |
~ACE_Hash_Map_Manager_Ex (void) | |
Cleanup the ACE_Hash_Map_Manager_Ex. | |
int | bind (const EXT_ID &item, const INT_ID &int_id) |
int | bind (const EXT_ID &ext_id, const INT_ID &int_id, ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&entry) |
int | trybind (const EXT_ID &ext_id, INT_ID &int_id) |
int | trybind (const EXT_ID &ext_id, INT_ID &int_id, ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&entry) |
int | rebind (const EXT_ID &ext_id, const INT_ID &int_id) |
int | rebind (const EXT_ID &ext_id, const INT_ID &int_id, ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&entry) |
int | rebind (const EXT_ID &ext_id, const INT_ID &int_id, INT_ID &old_int_id) |
int | rebind (const EXT_ID &ext_id, const INT_ID &int_id, INT_ID &old_int_id, ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&entry) |
int | rebind (const EXT_ID &ext_id, const INT_ID &int_id, EXT_ID &old_ext_id, INT_ID &old_int_id) |
int | rebind (const EXT_ID &ext_id, const INT_ID &int_id, EXT_ID &old_ext_id, INT_ID &old_int_id, ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&entry) |
int | find (const EXT_ID &ext_id, INT_ID &int_id) const |
int | find (const EXT_ID &ext_id) const |
Returns 0 if the ext_id is in the mapping, otherwise -1. | |
int | find (const EXT_ID &ext_id, ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&entry) const |
void | find (EXT_ID const &ext_id, iterator &pos) const |
int | unbind (const EXT_ID &ext_id) |
int | unbind (const EXT_ID &ext_id, INT_ID &int_id) |
int | unbind (ACE_Hash_Map_Entry< EXT_ID, INT_ID > *entry) |
Remove entry from map. | |
int | unbind (iterator pos) |
Remove entry from map pointed to by iterator pos. | |
size_t | current_size (void) const |
size_t | total_size (void) const |
ACE_LOCK & | mutex (void) |
void | dump (void) const |
Dump the state of an object. | |
iterator | begin (void) |
Return forward iterator. | |
iterator | end (void) |
const_iterator | begin (void) const |
const_iterator | end (void) const |
reverse_iterator | rbegin (void) |
Return reverse iterator. | |
reverse_iterator | rend (void) |
const_reverse_iterator | rbegin (void) const |
const_reverse_iterator | rend (void) const |
Protected Member Functions | |
int | equal (const EXT_ID &id1, const EXT_ID &id2) |
u_long | hash (const EXT_ID &ext_id) |
int | bind_i (const EXT_ID &ext_id, const INT_ID &int_id) |
Performs bind. Must be called with locks held. | |
int | bind_i (const EXT_ID &ext_id, const INT_ID &int_id, ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&entry) |
Performs bind. Must be called with locks held. | |
int | trybind_i (const EXT_ID &ext_id, INT_ID &int_id) |
Performs trybind. Must be called with locks held. | |
int | trybind_i (const EXT_ID &ext_id, INT_ID &int_id, ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&entry) |
Performs trybind. Must be called with locks held. | |
int | rebind_i (const EXT_ID &ext_id, const INT_ID &int_id) |
Performs rebind. Must be called with locks held. | |
int | rebind_i (const EXT_ID &ext_id, const INT_ID &int_id, ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&entry) |
Performs rebind. Must be called with locks held. | |
int | rebind_i (const EXT_ID &ext_id, const INT_ID &int_id, INT_ID &old_int_id) |
Performs rebind. Must be called with locks held. | |
int | rebind_i (const EXT_ID &ext_id, const INT_ID &int_id, INT_ID &old_int_id, ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&entry) |
Performs rebind. Must be called with locks held. | |
int | rebind_i (const EXT_ID &ext_id, const INT_ID &int_id, EXT_ID &old_ext_id, INT_ID &old_int_id) |
Performs rebind. Must be called with locks held. | |
int | rebind_i (const EXT_ID &ext_id, const INT_ID &int_id, EXT_ID &old_ext_id, INT_ID &old_int_id, ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&entry) |
Performs rebind. Must be called with locks held. | |
int | find_i (const EXT_ID &ext_id, INT_ID &int_id) |
int | find_i (const EXT_ID &ext_id) |
int | find_i (const EXT_ID &ext_id, ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&entry) |
int | unbind_i (const EXT_ID &ext_id, INT_ID &int_id) |
Performs unbind. Must be called with locks held. | |
int | unbind_i (const EXT_ID &ext_id) |
Performs unbind. Must be called with locks held. | |
int | unbind_i (ACE_Hash_Map_Entry< EXT_ID, INT_ID > *entry) |
Performs unbind. Must be called with locks held. | |
int | create_buckets (size_t size) |
int | close_i (void) |
int | unbind_all_i (void) |
int | shared_find (const EXT_ID &ext_id, ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&entry, size_t &loc) |
Returns the <ACE_Hash_Map_Entry> that corresponds to ext_id. | |
ACE_Hash_Map_Entry< EXT_ID, INT_ID > * | table (void) |
Accessor of the underlying table. | |
size_t | cur_size (void) const |
Accessor of the current size attribute. | |
Protected Attributes | |
ACE_Allocator * | table_allocator_ |
ACE_Allocator * | entry_allocator_ |
ACE_LOCK | lock_ |
HASH_KEY | hash_key_ |
Function object used for hashing keys. | |
COMPARE_KEYS | compare_keys_ |
Function object used for comparing keys. | |
Private Member Functions | |
void | operator= (const ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > &) |
ACE_Hash_Map_Manager_Ex (const ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > &) | |
Private Attributes | |
ACE_Hash_Map_Entry< EXT_ID, INT_ID > * | table_ |
size_t | total_size_ |
Total size of the hash table. | |
size_t | cur_size_ |
Friends | |
class | ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > |
class | ACE_Hash_Map_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > |
class | ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > |
class | ACE_Hash_Map_Const_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > |
class | ACE_Hash_Map_Reverse_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > |
class | ACE_Hash_Map_Const_Reverse_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > |
class | ACE_Hash_Map_Bucket_Iterator< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > |
EXT_ID
type objects with INT_ID
type objects.
This implementation of a map uses a hash table. Key hashing is achieved through the HASH_KEY
object and key comparison is achieved through the COMPARE_KEYS
object. This class uses an ACE_Allocator to allocate memory. The user can make this a persistent class by providing an ACE_Allocator with a persistable memory pool.
Definition at line 123 of file Hash_Map_Manager_T.h.
typedef ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::const_iterator |
Definition at line 156 of file Hash_Map_Manager_T.h.
typedef ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::CONST_ITERATOR |
Definition at line 146 of file Hash_Map_Manager_T.h.
typedef value_type const* ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::const_pointer |
Definition at line 169 of file Hash_Map_Manager_T.h.
typedef value_type const& ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::const_reference |
Definition at line 167 of file Hash_Map_Manager_T.h.
typedef ACE_Hash_Map_Const_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::const_reverse_iterator |
Definition at line 160 of file Hash_Map_Manager_T.h.
typedef ACE_Hash_Map_Const_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::CONST_REVERSE_ITERATOR |
Definition at line 150 of file Hash_Map_Manager_T.h.
typedef INT_ID ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::data_type |
Definition at line 164 of file Hash_Map_Manager_T.h.
typedef ptrdiff_t ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::difference_type |
Definition at line 170 of file Hash_Map_Manager_T.h.
typedef ACE_Hash_Map_Entry<EXT_ID, INT_ID> ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ENTRY |
Definition at line 140 of file Hash_Map_Manager_T.h.
typedef ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::iterator |
Definition at line 154 of file Hash_Map_Manager_T.h.
typedef ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ITERATOR |
Definition at line 144 of file Hash_Map_Manager_T.h.
typedef EXT_ID ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::KEY |
Definition at line 135 of file Hash_Map_Manager_T.h.
typedef EXT_ID ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::key_type |
Definition at line 163 of file Hash_Map_Manager_T.h.
typedef ACE_LOCK ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::lock_type |
Definition at line 138 of file Hash_Map_Manager_T.h.
typedef value_type* ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::pointer |
Definition at line 168 of file Hash_Map_Manager_T.h.
typedef value_type& ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::reference |
Definition at line 166 of file Hash_Map_Manager_T.h.
typedef ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::reverse_iterator |
Definition at line 158 of file Hash_Map_Manager_T.h.
typedef ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::REVERSE_ITERATOR |
Definition at line 148 of file Hash_Map_Manager_T.h.
typedef size_t ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::size_type |
Definition at line 171 of file Hash_Map_Manager_T.h.
typedef INT_ID ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::VALUE |
Definition at line 137 of file Hash_Map_Manager_T.h.
typedef ACE_Hash_Map_Entry<EXT_ID, INT_ID> ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::value_type |
Definition at line 165 of file Hash_Map_Manager_T.h.
ACE_INLINE ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ACE_Hash_Map_Manager_Ex | ( | ACE_Allocator * | table_alloc = 0 , |
|
ACE_Allocator * | entry_alloc = 0 | |||
) |
Initialize an ACE_Hash_Map_Manager_Ex with a default number of elements.
table_alloc | is a pointer to a memory allocator used for table_, so it should supply size*sizeof (ACE_Hash_Map_Entry<EXT_ID, INT_ID>). If table_alloc is 0 it defaults to ACE_Allocator::instance(). | |
entry_alloc | is a pointer to an additional allocator for entries, so it should be able to allocate 'size' / chunks of sizeof(ACE_Hash_Map_Entry<EXT_ID, INT_ID>) bytes each. If entry_alloc is 0 it defaults to the same allocator as table_alloc. |
Definition at line 24 of file Hash_Map_Manager_T.inl.
References ACE_DEFAULT_MAP_SIZE, ACE_ERROR, ACE_TEXT, and LM_ERROR.
00026 : table_allocator_ (table_alloc), 00027 entry_allocator_ (entry_alloc), 00028 table_ (0), 00029 total_size_ (0), 00030 cur_size_ (0) 00031 { 00032 if (this->open (ACE_DEFAULT_MAP_SIZE, table_alloc, entry_alloc) == -1) 00033 ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), 00034 ACE_TEXT ("ACE_Hash_Map_Manager_Ex open"))); 00035 }
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ACE_Hash_Map_Manager_Ex | ( | size_t | size, | |
ACE_Allocator * | table_alloc = 0 , |
|||
ACE_Allocator * | entry_alloc = 0 | |||
) |
Initialize an ACE_Hash_Map_Manager_Ex with size elements.
table_alloc | is a pointer to a memory allocator used for table_, so it should supply size*sizeof (ACE_Hash_Map_Entry<EXT_ID, INT_ID>). If table_alloc is 0 it defaults to ACE_Allocator::instance(). | |
entry_alloc | is a pointer to an additional allocator for entries, so it should be able to allocate 'size' / chunks of sizeof(ACE_Hash_Map_Entry<EXT_ID, INT_ID>) bytes each. If entry_alloc is 0 it defaults to the same allocator as table_alloc. |
Definition at line 10 of file Hash_Map_Manager_T.inl.
References ACE_ERROR, ACE_TEXT, and LM_ERROR.
00013 : table_allocator_ (table_alloc), 00014 entry_allocator_ (entry_alloc), 00015 table_ (0), 00016 total_size_ (0), 00017 cur_size_ (0) 00018 { 00019 if (this->open (size, table_alloc, entry_alloc) == -1) 00020 ACE_ERROR ((LM_ERROR, ACE_TEXT ("ACE_Hash_Map_Manager_Ex\n"))); 00021 }
ACE_INLINE ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::~ACE_Hash_Map_Manager_Ex | ( | void | ) |
Cleanup the ACE_Hash_Map_Manager_Ex.
Definition at line 54 of file Hash_Map_Manager_T.inl.
References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close().
00055 { 00056 this->close (); 00057 }
ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ACE_Hash_Map_Manager_Ex | ( | const ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > & | ) | [private] |
ACE_INLINE ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::const_iterator ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::begin | ( | void | ) | const |
Definition at line 392 of file Hash_Map_Manager_T.inl.
00393 { 00394 return const_iterator (*this); 00395 }
ACE_INLINE ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::iterator ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::begin | ( | void | ) |
Return forward iterator.
Definition at line 378 of file Hash_Map_Manager_T.inl.
Referenced by ACE_Configuration_Heap::enumerate_sections(), and ACE_Configuration_Heap::remove_section().
00379 { 00380 return iterator (*this); 00381 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind | ( | const EXT_ID & | ext_id, | |
const INT_ID & | int_id, | |||
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *& | entry | |||
) |
Same as a normal bind, except the map entry is also passed back to the caller. The entry in this case will either be the newly created entry, or the existing one.
Definition at line 110 of file Hash_Map_Manager_T.inl.
References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i().
00113 { 00114 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00115 00116 return this->bind_i (ext_id, int_id, entry); 00117 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind | ( | const EXT_ID & | item, | |
const INT_ID & | int_id | |||
) |
Associate item with int_id. If item is already in the map then the map is not changed.
0 | if a new entry is bound successfully. | |
1 | if an attempt is made to bind an existing entry. | |
-1 | if a failure occurs; check errno for more information. |
Definition at line 101 of file Hash_Map_Manager_T.inl.
References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i().
Referenced by ACE::Monitor_Control::Monitor_Point_Registry::add(), ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::bind(), ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::bind_create_key(), ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::bind_modify_key(), and ACE_Filecache::finish().
00103 { 00104 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00105 00106 return this->bind_i (ext_id, int_id); 00107 }
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i | ( | const EXT_ID & | ext_id, | |
const INT_ID & | int_id, | |||
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *& | entry | |||
) | [protected] |
Performs bind. Must be called with locks held.
Definition at line 211 of file Hash_Map_Manager_T.cpp.
References ACE_ALLOCATOR_RETURN, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::cur_size_, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_.
00214 { 00215 size_t loc = 0; 00216 if (this->shared_find (ext_id, entry, loc) == -1) 00217 { 00218 void *ptr = 0; 00219 // Not found. 00220 ACE_ALLOCATOR_RETURN (ptr, 00221 this->entry_allocator_->malloc (sizeof (ACE_Hash_Map_Entry<EXT_ID, INT_ID>)), 00222 -1); 00223 00224 entry = new (ptr) ACE_Hash_Map_Entry<EXT_ID, INT_ID> (ext_id, 00225 int_id, 00226 this->table_[loc].next_, 00227 &this->table_[loc]); 00228 this->table_[loc].next_ = entry; 00229 entry->next_->prev_ = entry; 00230 this->cur_size_++; 00231 return 0; 00232 } 00233 else 00234 return 1; 00235 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i | ( | const EXT_ID & | ext_id, | |
const INT_ID & | int_id | |||
) | [protected] |
Performs bind. Must be called with locks held.
Definition at line 92 of file Hash_Map_Manager_T.inl.
Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind().
00094 { 00095 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *temp; 00096 00097 return this->bind_i (ext_id, int_id, temp); 00098 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close | ( | void | ) |
Close down the ACE_Hash_Map_Manager_Ex and release dynamically allocated resources.
Definition at line 38 of file Hash_Map_Manager_T.inl.
References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close_i().
Referenced by ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::close(), ACE_Configuration_Heap::remove_section(), ACE_Capabilities::resetcaps(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::~ACE_Hash_Map_Manager_Ex().
00039 { 00040 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00041 00042 return this->close_i (); 00043 }
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close_i | ( | void | ) | [protected] |
Close down a <Map_Manager_Ex>. Must be called with locks held.
Definition at line 147 of file Hash_Map_Manager_T.cpp.
References ACE_DES_FREE_TEMPLATE2, ACE_NOOP, ACE_Allocator::free(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_allocator_, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::total_size_, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_all_i().
Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::open().
00148 { 00149 // Protect against "double-deletion" in case the destructor also 00150 // gets called. 00151 if (this->table_ != 0) 00152 { 00153 // Remove all the entries. 00154 this->unbind_all_i (); 00155 00156 // Iterate through the buckets cleaning up the sentinels. 00157 for (size_t i = 0; i < this->total_size_; i++) 00158 { 00159 // Destroy the dummy entry. 00160 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *entry = &this->table_[i]; 00161 00162 // The second argument results in a no-op instead of 00163 // deallocation. 00164 ACE_DES_FREE_TEMPLATE2 (entry, ACE_NOOP, 00165 ACE_Hash_Map_Entry, EXT_ID, INT_ID); 00166 } 00167 00168 // Reset size. 00169 this->total_size_ = 0; 00170 00171 // Free table memory. 00172 this->table_allocator_->free (this->table_); 00173 00174 // Should be done last... 00175 this->table_ = 0; 00176 } 00177 00178 return 0; 00179 }
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::create_buckets | ( | size_t | size | ) | [protected] |
Resize the map. Must be called with locks held.
Definition at line 93 of file Hash_Map_Manager_T.cpp.
References ACE_ALLOCATOR_RETURN, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::total_size_.
Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::open().
00094 { 00095 size_t bytes = size * sizeof (ACE_Hash_Map_Entry<EXT_ID, INT_ID>); 00096 void *ptr = 0; 00097 00098 ACE_ALLOCATOR_RETURN (ptr, 00099 this->table_allocator_->malloc (bytes), 00100 -1); 00101 00102 this->table_ = (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *) ptr; 00103 00104 this->total_size_ = size; 00105 00106 // Initialize each entry in the hash table to be a circular linked 00107 // list with the dummy node in the front serving as the anchor of 00108 // the list. 00109 for (size_t i = 0; i < size; i++) 00110 new (&this->table_[i]) ACE_Hash_Map_Entry<EXT_ID, INT_ID> (&this->table_[i], 00111 &this->table_[i]); 00112 return 0; 00113 }
ACE_INLINE size_t ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::cur_size | ( | void | ) | const [protected] |
Accessor of the current size attribute.
Definition at line 441 of file Hash_Map_Manager_T.inl.
References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::cur_size_.
00442 { 00443 return this->cur_size_; 00444 }
ACE_INLINE size_t ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::current_size | ( | void | ) | const |
Returns the current number of ACE_Hash_Map_Entry objects in the hash table.
Definition at line 60 of file Hash_Map_Manager_T.inl.
References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::cur_size_.
Referenced by ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::current_size().
00061 { 00062 return this->cur_size_; 00063 }
void ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::dump | ( | void | ) | const |
Dump the state of an object.
Definition at line 79 of file Hash_Map_Manager_T.cpp.
References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_TEXT, ACE_Allocator::dump(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::entry_allocator_, LM_DEBUG, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::lock_, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_allocator_.
Referenced by ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::dump().
00080 { 00081 #if defined (ACE_HAS_DUMP) 00082 ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); 00083 ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("total_size_ = %d"), this->total_size_)); 00084 ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ncur_size_ = %d"), this->cur_size_)); 00085 this->table_allocator_->dump (); 00086 this->entry_allocator_->dump (); 00087 this->lock_.dump (); 00088 ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); 00089 #endif /* ACE_HAS_DUMP */ 00090 }
ACE_INLINE ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::const_iterator ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::end | ( | void | ) | const |
Definition at line 399 of file Hash_Map_Manager_T.inl.
00400 { 00401 return const_iterator (*this, 1); 00402 }
ACE_INLINE ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::iterator ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::end | ( | void | ) |
Definition at line 385 of file Hash_Map_Manager_T.inl.
Referenced by ACE::Monitor_Control::Monitor_Point_Registry::cleanup().
00386 { 00387 return iterator (*this, 1); 00388 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::equal | ( | const EXT_ID & | id1, | |
const EXT_ID & | id2 | |||
) | [protected] |
Returns 1 if <id1> == <id2>, else 0. This is defined as a separate method to facilitate template specialization.
Reimplemented in ACE_Hash_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >.
Definition at line 85 of file Hash_Map_Manager_T.inl.
References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::compare_keys_.
00087 { 00088 return this->compare_keys_ (id1, id2); 00089 }
void ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find | ( | EXT_ID const & | ext_id, | |
iterator & | pos | |||
) | const |
pos | pos will be set to end() if not found. |
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find | ( | const EXT_ID & | ext_id, | |
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *& | entry | |||
) | const |
Locate ext_id and pass out parameter via entry. If found, return 0, returns -1 if not found.
Definition at line 262 of file Hash_Map_Manager_T.inl.
References ACE_READ_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find_i().
00264 { 00265 ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *nc_this = 00266 const_cast <ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *> 00267 (this); 00268 00269 ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00270 00271 return nc_this->find_i (ext_id, entry); 00272 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find | ( | const EXT_ID & | ext_id | ) | const |
Returns 0 if the ext_id is in the mapping, otherwise -1.
Definition at line 242 of file Hash_Map_Manager_T.inl.
References ACE_READ_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find_i().
00243 { 00244 ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *nc_this = 00245 const_cast <ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *> 00246 (this); 00247 00248 ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00249 00250 return nc_this->find_i (ext_id); 00251 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find | ( | const EXT_ID & | ext_id, | |
INT_ID & | int_id | |||
) | const |
Locate ext_id and pass out parameter via int_id. Return 0 if found, returns -1 if not found.
Definition at line 229 of file Hash_Map_Manager_T.inl.
References ACE_READ_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find_i().
Referenced by ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::find(), ACE_Filecache::find(), ACE::Monitor_Control::Monitor_Point_Registry::get(), and ACE_Configuration_Heap::remove_section().
00231 { 00232 ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *nc_this = 00233 const_cast <ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *> 00234 (this); 00235 00236 ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00237 00238 return nc_this->find_i (ext_id, int_id); 00239 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find_i | ( | const EXT_ID & | ext_id, | |
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *& | entry | |||
) | [protected] |
Performs a find using ext_id as the key. Must be called with locks held.
Definition at line 254 of file Hash_Map_Manager_T.inl.
References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find().
00256 { 00257 size_t dummy; 00258 return this->shared_find (ext_id, entry, dummy); 00259 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find_i | ( | const EXT_ID & | ext_id | ) | [protected] |
Performs a find using ext_id as the key. Must be called with locks held.
Definition at line 220 of file Hash_Map_Manager_T.inl.
References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find().
00221 { 00222 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *entry; 00223 00224 size_t dummy; 00225 return this->shared_find (ext_id, entry, dummy); 00226 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find_i | ( | const EXT_ID & | ext_id, | |
INT_ID & | int_id | |||
) | [protected] |
Performs a find of int_id using ext_id as the key. Must be called with locks held.
Definition at line 204 of file Hash_Map_Manager_T.inl.
References ACE_Hash_Map_Entry< EXT_ID, INT_ID >::int_id_.
Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find().
00206 { 00207 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *entry; 00208 00209 size_t dummy; 00210 if (this->shared_find (ext_id, entry, dummy) == -1) 00211 return -1; 00212 else 00213 { 00214 int_id = entry->int_id_; 00215 return 0; 00216 } 00217 }
ACE_INLINE u_long ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::hash | ( | const EXT_ID & | ext_id | ) | [protected] |
Compute the hash value of the ext_id. This is defined as a separate method to facilitate template specialization.
Reimplemented in ACE_Hash_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >.
Definition at line 79 of file Hash_Map_Manager_T.inl.
References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::hash_key_.
Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find().
00080 { 00081 return this->hash_key_ (ext_id); 00082 }
ACE_INLINE ACE_LOCK & ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::mutex | ( | void | ) |
Returns a reference to the underlying <ACE_LOCK>. This makes it possible to acquire the lock explicitly, which can be useful in some cases if you instantiate the ACE_Atomic_Op with an ACE_Recursive_Mutex or ACE_Process_Mutex, or if you need to guard the state of an iterator.
Definition at line 72 of file Hash_Map_Manager_T.inl.
References ACE_TRACE, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::lock_.
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::open | ( | size_t | size = ACE_DEFAULT_MAP_SIZE , |
|
ACE_Allocator * | table_alloc = 0 , |
|||
ACE_Allocator * | entry_alloc = 0 | |||
) |
Initialize an ACE_Hash_Map_Manager_Ex with size elements.
table_alloc | is a pointer to a memory allocator used for table_, so it should supply size*sizeof (ACE_Hash_Map_Entry<EXT_ID, INT_ID>). If table_alloc is 0 it defaults to ACE_Allocator::instance(). | |
entry_alloc | is a pointer to an additional allocator for entries, so it should be able to allocate 'size' / chunks of sizeof(ACE_Hash_Map_Entry<EXT_ID, INT_ID>) bytes each. If entry_alloc is 0 then it defaults to the same allocator as table_alloc. |
Definition at line 116 of file Hash_Map_Manager_T.cpp.
References ACE_WRITE_GUARD_RETURN, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close_i(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::create_buckets(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::entry_allocator_, ACE_Allocator::instance(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_allocator_.
Referenced by ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::open(), and ACE_Capabilities::resetcaps().
00119 { 00120 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00121 00122 // Calling this->close_i () to ensure we release previous allocated 00123 // memory before allocating new one. 00124 this->close_i (); 00125 00126 if (table_alloc == 0) 00127 table_alloc = ACE_Allocator::instance (); 00128 00129 this->table_allocator_ = table_alloc; 00130 00131 if (entry_alloc == 0) 00132 entry_alloc = table_alloc; 00133 00134 this->entry_allocator_ = entry_alloc; 00135 00136 // This assertion is here to help track a situation that shouldn't 00137 // happen, but did with Sun C++ 4.1 (before a change to this class 00138 // was made: it used to have an enum that was supposed to be defined 00139 // to be ACE_DEFAULT_MAP_SIZE, but instead was defined to be 0). 00140 if (size == 0) 00141 return -1; 00142 00143 return this->create_buckets (size); 00144 }
void ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator= | ( | const ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > & | ) | [private] |
ACE_INLINE ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::const_reverse_iterator ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rbegin | ( | void | ) | const |
Definition at line 420 of file Hash_Map_Manager_T.inl.
00421 { 00422 return const_reverse_iterator (*this); 00423 }
ACE_INLINE ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::reverse_iterator ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rbegin | ( | void | ) |
Return reverse iterator.
Definition at line 406 of file Hash_Map_Manager_T.inl.
00407 { 00408 return reverse_iterator (*this); 00409 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind | ( | const EXT_ID & | ext_id, | |
const INT_ID & | int_id, | |||
EXT_ID & | old_ext_id, | |||
INT_ID & | old_int_id, | |||
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *& | entry | |||
) |
Same as a normal rebind, except the map entry is also passed back to the caller. The entry in this case will either be the newly created entry, or the existing one.
Definition at line 365 of file Hash_Map_Manager_T.inl.
References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().
00370 { 00371 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00372 00373 return this->rebind_i (ext_id, int_id, old_ext_id, old_int_id, entry); 00374 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind | ( | const EXT_ID & | ext_id, | |
const INT_ID & | int_id, | |||
EXT_ID & | old_ext_id, | |||
INT_ID & | old_int_id | |||
) |
Associate ext_id with int_id. If ext_id is not in the map then behaves just like <bind>. Otherwise, store the old values of ext_id and int_id into the "out" parameters and rebind the new parameters. This is very useful if you need to have an atomic way of updating ACE_Hash_Map_Entrys and you also need full control over memory allocation. Returns 0 if a new entry is bound successfully, returns 1 if an existing entry was rebound, and returns -1 if failures occur.
Definition at line 354 of file Hash_Map_Manager_T.inl.
References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().
00358 { 00359 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00360 00361 return this->rebind_i (ext_id, int_id, old_ext_id, old_int_id); 00362 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind | ( | const EXT_ID & | ext_id, | |
const INT_ID & | int_id, | |||
INT_ID & | old_int_id, | |||
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *& | entry | |||
) |
Same as a normal rebind, except the map entry is also passed back to the caller. The entry in this case will either be the newly created entry, or the existing one.
Definition at line 343 of file Hash_Map_Manager_T.inl.
References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().
00347 { 00348 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00349 00350 return this->rebind_i (ext_id, int_id, old_int_id, entry); 00351 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind | ( | const EXT_ID & | ext_id, | |
const INT_ID & | int_id, | |||
INT_ID & | old_int_id | |||
) |
Associate ext_id with int_id. If ext_id is not in the map then behaves just like <bind>. Otherwise, store the old value of int_id into the "out" parameter and rebind the new parameters. Returns 0 if a new entry is bound successfully, returns 1 if an existing entry was rebound, and returns -1 if failures occur.
Definition at line 333 of file Hash_Map_Manager_T.inl.
References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().
00336 { 00337 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00338 00339 return this->rebind_i (ext_id, int_id, old_int_id); 00340 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind | ( | const EXT_ID & | ext_id, | |
const INT_ID & | int_id, | |||
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *& | entry | |||
) |
Same as a normal rebind, except the map entry is also passed back to the caller. The entry in this case will either be the newly created entry, or the existing one.
Definition at line 323 of file Hash_Map_Manager_T.inl.
References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().
00326 { 00327 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00328 00329 return this->rebind_i (ext_id, int_id, entry); 00330 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind | ( | const EXT_ID & | ext_id, | |
const INT_ID & | int_id | |||
) |
Reassociate ext_id with int_id. If ext_id is not in the map then behaves just like <bind>. Returns 0 if a new entry is bound successfully, returns 1 if an existing entry was rebound, and returns -1 if failures occur.
Definition at line 314 of file Hash_Map_Manager_T.inl.
References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().
Referenced by ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::rebind().
00316 { 00317 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00318 00319 return this->rebind_i (ext_id, int_id); 00320 }
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i | ( | const EXT_ID & | ext_id, | |
const INT_ID & | int_id, | |||
EXT_ID & | old_ext_id, | |||
INT_ID & | old_int_id, | |||
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *& | entry | |||
) | [protected] |
Performs rebind. Must be called with locks held.
Definition at line 360 of file Hash_Map_Manager_T.cpp.
References ACE_Hash_Map_Entry< EXT_ID, INT_ID >::ext_id_, and ACE_Hash_Map_Entry< EXT_ID, INT_ID >::int_id_.
00365 { 00366 size_t dummy = 0; 00367 if (this->shared_find (ext_id, entry, dummy) == -1) 00368 return this->bind_i (ext_id, int_id); 00369 else 00370 { 00371 old_ext_id = entry->ext_id_; 00372 old_int_id = entry->int_id_; 00373 entry->ext_id_ = ext_id; 00374 entry->int_id_ = int_id; 00375 return 1; 00376 } 00377 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i | ( | const EXT_ID & | ext_id, | |
const INT_ID & | int_id, | |||
EXT_ID & | old_ext_id, | |||
INT_ID & | old_int_id | |||
) | [protected] |
Performs rebind. Must be called with locks held.
Definition at line 299 of file Hash_Map_Manager_T.inl.
References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().
00303 { 00304 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *node; 00305 00306 return this->rebind_i (ext_id, 00307 int_id, 00308 old_ext_id, 00309 old_int_id, 00310 node); 00311 }
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i | ( | const EXT_ID & | ext_id, | |
const INT_ID & | int_id, | |||
INT_ID & | old_int_id, | |||
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *& | entry | |||
) | [protected] |
Performs rebind. Must be called with locks held.
Definition at line 342 of file Hash_Map_Manager_T.cpp.
References ACE_Hash_Map_Entry< EXT_ID, INT_ID >::ext_id_, and ACE_Hash_Map_Entry< EXT_ID, INT_ID >::int_id_.
00346 { 00347 size_t dummy = 0; 00348 if (this->shared_find (ext_id, entry, dummy) == -1) 00349 return this->bind_i (ext_id, int_id); 00350 else 00351 { 00352 old_int_id = entry->int_id_; 00353 entry->ext_id_ = ext_id; 00354 entry->int_id_ = int_id; 00355 return 1; 00356 } 00357 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i | ( | const EXT_ID & | ext_id, | |
const INT_ID & | int_id, | |||
INT_ID & | old_int_id | |||
) | [protected] |
Performs rebind. Must be called with locks held.
Definition at line 286 of file Hash_Map_Manager_T.inl.
References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().
00289 { 00290 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *node; 00291 00292 return this->rebind_i (ext_id, 00293 int_id, 00294 old_int_id, 00295 node); 00296 }
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i | ( | const EXT_ID & | ext_id, | |
const INT_ID & | int_id, | |||
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *& | entry | |||
) | [protected] |
Performs rebind. Must be called with locks held.
Definition at line 326 of file Hash_Map_Manager_T.cpp.
References ACE_Hash_Map_Entry< EXT_ID, INT_ID >::ext_id_, and ACE_Hash_Map_Entry< EXT_ID, INT_ID >::int_id_.
00329 { 00330 size_t dummy = 0; 00331 if (this->shared_find (ext_id, entry, dummy) == -1) 00332 return this->bind_i (ext_id, int_id); 00333 else 00334 { 00335 entry->ext_id_ = ext_id; 00336 entry->int_id_ = int_id; 00337 return 1; 00338 } 00339 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i | ( | const EXT_ID & | ext_id, | |
const INT_ID & | int_id | |||
) | [protected] |
Performs rebind. Must be called with locks held.
Definition at line 275 of file Hash_Map_Manager_T.inl.
Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().
00277 { 00278 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *node; 00279 00280 return this->rebind_i (ext_id, 00281 int_id, 00282 node); 00283 }
ACE_INLINE ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::const_reverse_iterator ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rend | ( | void | ) | const |
Definition at line 427 of file Hash_Map_Manager_T.inl.
00428 { 00429 return const_reverse_iterator (*this, 1); 00430 }
ACE_INLINE ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::reverse_iterator ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rend | ( | void | ) |
Definition at line 413 of file Hash_Map_Manager_T.inl.
00414 { 00415 return reverse_iterator (*this, 1); 00416 }
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find | ( | const EXT_ID & | ext_id, | |
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *& | entry, | |||
size_t & | loc | |||
) | [protected] |
Returns the <ACE_Hash_Map_Entry> that corresponds to ext_id.
Definition at line 297 of file Hash_Map_Manager_T.cpp.
References ACE_Hash_Map_Entry< EXT_ID, INT_ID >::ext_id_, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::hash(), ACE_Hash_Map_Entry< EXT_ID, INT_ID >::next_, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::total_size_.
Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find_i().
00300 { 00301 if (this->total_size_ == 0) 00302 { 00303 return -1; 00304 } 00305 00306 loc = this->hash (ext_id) % this->total_size_; 00307 00308 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *temp = this->table_[loc].next_; 00309 00310 while (temp != &this->table_[loc] && this->equal (temp->ext_id_, ext_id) == 0) 00311 temp = temp->next_; 00312 00313 if (temp == &this->table_[loc]) 00314 { 00315 errno = ENOENT; 00316 return -1; 00317 } 00318 else 00319 { 00320 entry = temp; 00321 return 0; 00322 } 00323 }
ACE_INLINE ACE_Hash_Map_Entry< EXT_ID, INT_ID > * ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table | ( | void | ) | [protected] |
Accessor of the underlying table.
Definition at line 434 of file Hash_Map_Manager_T.inl.
References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_.
00435 { 00436 return this->table_; 00437 }
ACE_INLINE size_t ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::total_size | ( | void | ) | const |
Return the size of the array that's used to point to the linked lists of ACE_Hash_Map_Entry objects in the hash table.
Definition at line 66 of file Hash_Map_Manager_T.inl.
References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::total_size_.
Referenced by ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::total_size().
00067 { 00068 return this->total_size_; 00069 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::trybind | ( | const EXT_ID & | ext_id, | |
INT_ID & | int_id, | |||
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *& | entry | |||
) |
Same as a normal trybind, except the map entry is also passed back to the caller. The entry in this case will either be the newly created entry, or the existing one.
Definition at line 141 of file Hash_Map_Manager_T.inl.
References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::trybind_i().
00144 { 00145 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00146 00147 return this->trybind_i (ext_id, int_id, entry); 00148 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::trybind | ( | const EXT_ID & | ext_id, | |
INT_ID & | int_id | |||
) |
Associate ext_id with int_id if and only if ext_id is not in the map. If ext_id is already in the map then the int_id parameter is assigned the existing value in the map. Returns 0 if a new entry is bound successfully, returns 1 if an attempt is made to bind an existing entry, and returns -1 if failures occur.
Definition at line 132 of file Hash_Map_Manager_T.inl.
References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::trybind_i().
Referenced by ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::trybind().
00134 { 00135 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00136 00137 return this->trybind_i (ext_id, int_id); 00138 }
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::trybind_i | ( | const EXT_ID & | ext_id, | |
INT_ID & | int_id, | |||
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *& | entry | |||
) | [protected] |
Performs trybind. Must be called with locks held.
Definition at line 238 of file Hash_Map_Manager_T.cpp.
References ACE_ALLOCATOR_RETURN, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::cur_size_, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_.
00241 { 00242 size_t loc = 0; 00243 if (this->shared_find (ext_id, entry, loc) == -1) 00244 { 00245 // Not found. 00246 void *ptr = 0; 00247 ACE_ALLOCATOR_RETURN (ptr, 00248 this->entry_allocator_->malloc (sizeof (ACE_Hash_Map_Entry<EXT_ID, INT_ID>)), 00249 -1); 00250 00251 entry = new (ptr) ACE_Hash_Map_Entry<EXT_ID, INT_ID> (ext_id, 00252 int_id, 00253 this->table_[loc].next_, 00254 &this->table_[loc]); 00255 this->table_[loc].next_ = entry; 00256 entry->next_->prev_ = entry; 00257 this->cur_size_++; 00258 return 0; 00259 } 00260 else 00261 return 1; 00262 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::trybind_i | ( | const EXT_ID & | ext_id, | |
INT_ID & | int_id | |||
) | [protected] |
Performs trybind. Must be called with locks held.
Definition at line 120 of file Hash_Map_Manager_T.inl.
References ACE_Hash_Map_Entry< EXT_ID, INT_ID >::int_id_.
Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::trybind().
00122 { 00123 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *temp; 00124 00125 int result = this->trybind_i (ext_id, int_id, temp); 00126 if (result == 1) 00127 int_id = temp->int_id_; 00128 return result; 00129 }
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind | ( | iterator | pos | ) |
Remove entry from map pointed to by iterator
pos.
This unbind operation is fast relative to those that accept an external ID parameter since no map lookup is performed.
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind | ( | ACE_Hash_Map_Entry< EXT_ID, INT_ID > * | entry | ) |
Remove entry from map.
This unbind operation is fast relative to those that accept an external ID parameter since no map lookup is performed.
Definition at line 196 of file Hash_Map_Manager_T.inl.
References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i().
00197 { 00198 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00199 00200 return this->unbind_i (entry) == -1 ? -1 : 0; 00201 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind | ( | const EXT_ID & | ext_id, | |
INT_ID & | int_id | |||
) |
Break any association of ext_id. Returns the value of int_id in case the caller needs to deallocate memory. Return 0 if the unbind was successful, and returns -1 if failures occur.
Definition at line 159 of file Hash_Map_Manager_T.inl.
References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i().
00161 { 00162 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00163 00164 return this->unbind_i (ext_id, int_id); 00165 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind | ( | const EXT_ID & | ext_id | ) |
Unbind (remove) the ext_id from the map. Don't return the int_id to the caller (this is useful for collections where the int_ids are *not* dynamically allocated...)
Definition at line 188 of file Hash_Map_Manager_T.inl.
References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i().
Referenced by ACE_Cached_Connect_Strategy< SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX >::purge_i(), ACE::Monitor_Control::Monitor_Point_Registry::remove(), and ACE_Hash_Map_Manager_Ex_Adapter< KEY, VALUE, HASH_KEY, COMPARE_KEYS, KEY_GENERATOR >::unbind().
00189 { 00190 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00191 00192 return this->unbind_i (ext_id) == -1 ? -1 : 0; 00193 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_all | ( | void | ) |
Removes all the entries in the ACE_Hash_Map_Manager_Ex.
Definition at line 46 of file Hash_Map_Manager_T.inl.
References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_all_i().
00047 { 00048 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00049 00050 return this->unbind_all_i (); 00051 }
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_all_i | ( | void | ) | [protected] |
Removes all the entries in <Map_Manager_Ex>. Must be called with locks held.
Definition at line 182 of file Hash_Map_Manager_T.cpp.
References ACE_DES_FREE_TEMPLATE2, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::total_size_.
Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close_i(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_all().
00183 { 00184 // Iterate through the entire map calling the destuctor of each 00185 // <ACE_Hash_Map_Entry>. 00186 for (size_t i = 0; i < this->total_size_; i++) 00187 { 00188 for (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *temp_ptr = this->table_[i].next_; 00189 temp_ptr != &this->table_[i]; 00190 ) 00191 { 00192 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *hold_ptr = temp_ptr; 00193 temp_ptr = temp_ptr->next_; 00194 00195 // Explicitly call the destructor. 00196 ACE_DES_FREE_TEMPLATE2 (hold_ptr, this->entry_allocator_->free, 00197 ACE_Hash_Map_Entry, EXT_ID, INT_ID); 00198 } 00199 00200 // Restore the sentinel. 00201 this->table_[i].next_ = &this->table_[i]; 00202 this->table_[i].prev_ = &this->table_[i]; 00203 } 00204 00205 this->cur_size_ = 0; 00206 00207 return 0; 00208 }
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i | ( | ACE_Hash_Map_Entry< EXT_ID, INT_ID > * | entry | ) | [protected] |
Performs unbind. Must be called with locks held.
Definition at line 283 of file Hash_Map_Manager_T.cpp.
References ACE_DES_FREE_TEMPLATE2, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::cur_size_, ACE_Hash_Map_Entry< EXT_ID, INT_ID >::next_, and ACE_Hash_Map_Entry< EXT_ID, INT_ID >::prev_.
00284 { 00285 entry->next_->prev_ = entry->prev_; 00286 entry->prev_->next_ = entry->next_; 00287 00288 // Explicitly call the destructor. 00289 ACE_DES_FREE_TEMPLATE2 (entry, this->entry_allocator_->free, 00290 ACE_Hash_Map_Entry, EXT_ID, INT_ID); 00291 00292 --this->cur_size_; 00293 return 0; 00294 }
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i | ( | const EXT_ID & | ext_id | ) | [protected] |
Performs unbind. Must be called with locks held.
Definition at line 151 of file Hash_Map_Manager_T.inl.
References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i().
00152 { 00153 INT_ID int_id; 00154 00155 return this->unbind_i (ext_id, int_id); 00156 }
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i | ( | const EXT_ID & | ext_id, | |
INT_ID & | int_id | |||
) | [protected] |
Performs unbind. Must be called with locks held.
Definition at line 265 of file Hash_Map_Manager_T.cpp.
References ACE_Hash_Map_Entry< EXT_ID, INT_ID >::int_id_.
Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i().
00267 { 00268 ACE_Hash_Map_Entry<EXT_ID, INT_ID> *temp; 00269 00270 size_t loc = 0; 00271 if (this->shared_find (ext_id, temp, loc) == -1) 00272 { 00273 errno = ENOENT; 00274 return -1; 00275 } 00276 00277 int_id = temp->int_id_; 00278 00279 return this->unbind_i (temp); 00280 }
friend class ACE_Hash_Map_Bucket_Iterator< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > [friend] |
Definition at line 132 of file Hash_Map_Manager_T.h.
friend class ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > [friend] |
Definition at line 128 of file Hash_Map_Manager_T.h.
friend class ACE_Hash_Map_Const_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > [friend] |
Definition at line 129 of file Hash_Map_Manager_T.h.
friend class ACE_Hash_Map_Const_Reverse_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > [friend] |
Definition at line 131 of file Hash_Map_Manager_T.h.
friend class ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > [friend] |
Definition at line 126 of file Hash_Map_Manager_T.h.
friend class ACE_Hash_Map_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > [friend] |
Definition at line 127 of file Hash_Map_Manager_T.h.
friend class ACE_Hash_Map_Reverse_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > [friend] |
Definition at line 130 of file Hash_Map_Manager_T.h.
COMPARE_KEYS ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::compare_keys_ [protected] |
Function object used for comparing keys.
Definition at line 545 of file Hash_Map_Manager_T.h.
Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::equal().
size_t ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::cur_size_ [private] |
Current number of entries in the table
Definition at line 573 of file Hash_Map_Manager_T.h.
Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::cur_size(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::current_size(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::trybind_i(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i().
ACE_Allocator* ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::entry_allocator_ [protected] |
Addidtional allocator for entries, so it should be able to allocate 'size' / chunks of sizeof(ACE_Hash_Map_Entry<EXT_ID, INT_ID>) bytes each.
Definition at line 535 of file Hash_Map_Manager_T.h.
Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::dump(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::open().
HASH_KEY ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::hash_key_ [protected] |
Function object used for hashing keys.
Definition at line 542 of file Hash_Map_Manager_T.h.
Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::hash().
ACE_LOCK ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::lock_ [mutable, protected] |
Synchronization variable for the MT_SAFE ACE_Hash_Map_Manager_Ex
.
Definition at line 539 of file Hash_Map_Manager_T.h.
Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::dump(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::mutex().
ACE_Hash_Map_Entry<EXT_ID, INT_ID>* ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_ [private] |
Array of <ACE_Hash_Map_Entry> *s, each of which points to an <ACE_Hash_Map_Entry> that serves as the beginning of a linked list of <EXT_ID>s that hash to that bucket.
Definition at line 565 of file Hash_Map_Manager_T.h.
Referenced by ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ACE_Hash_Map_Const_Iterator_Base_Ex(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close_i(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::create_buckets(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::trybind_i(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_all_i().
ACE_Allocator* ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_allocator_ [protected] |
Pointer to a memory allocator used for table_, so it should supply size*sizeof (ACE_Hash_Map_Entry<EXT_ID, INT_ID>),
Definition at line 530 of file Hash_Map_Manager_T.h.
Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close_i(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::dump(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::open().
size_t ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::total_size_ [private] |
Total size of the hash table.
Definition at line 568 of file Hash_Map_Manager_T.h.
Referenced by ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ACE_Hash_Map_Const_Iterator_Base_Ex(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close_i(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::create_buckets(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::total_size(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_all_i().