#include <Hash_Multi_Map_Manager_T.h>
Collaboration diagram for ACE_Hash_Multi_Map_Manager< 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_Multi_Map_Entry< EXT_ID, INT_ID > | ENTRY |
typedef ACE_Hash_Multi_Map_Iterator< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > | ITERATOR |
typedef ACE_Hash_Multi_Map_Const_Iterator< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > | CONST_ITERATOR |
typedef ACE_Hash_Multi_Map_Reverse_Iterator< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > | REVERSE_ITERATOR |
typedef ACE_Hash_Multi_Map_Iterator< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > | iterator |
typedef ACE_Hash_Multi_Map_Const_Iterator< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > | const_iterator |
typedef ACE_Hash_Multi_Map_Reverse_Iterator< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > | reverse_iterator |
Public Member Functions | |
ACE_Hash_Multi_Map_Manager (ACE_Allocator *table_alloc=0, ACE_Allocator *entry_alloc=0) | |
ACE_Hash_Multi_Map_Manager (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 Hash_Multi_Map_Manager. | |
~ACE_Hash_Multi_Map_Manager (void) | |
Cleanup the Hash_Multi_Map_Manager. | |
int | bind (const EXT_ID &ext_id, const INT_ID &int_id) |
int | bind (const EXT_ID &ext_id, const INT_ID &int_id, ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID > *&entry) |
int | bind (const EXT_ID &ext_id, const ACE_Unbounded_Set< INT_ID > &int_id_set) |
int | bind (const EXT_ID &ext_id, const ACE_Unbounded_Set< INT_ID > &int_id_set, ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID > *&entry) |
int | trybind (const EXT_ID &ext_id, ACE_Unbounded_Set< INT_ID > &int_id_set) |
int | trybind (const EXT_ID &ext_id, ACE_Unbounded_Set< INT_ID > &int_id_set, ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID > *&entry) |
int | rebind (const EXT_ID &ext_id, const ACE_Unbounded_Set< INT_ID > &int_id_set) |
int | rebind (const EXT_ID &ext_id, const ACE_Unbounded_Set< INT_ID > &int_id_set, ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID > *&entry) |
int | rebind (const EXT_ID &ext_id, const ACE_Unbounded_Set< INT_ID > &int_id_set, ACE_Unbounded_Set< INT_ID > &old_int_id_set) |
int | rebind (const EXT_ID &ext_id, const ACE_Unbounded_Set< INT_ID > &int_id_set, ACE_Unbounded_Set< INT_ID > &old_int_id_set, ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID > *&entry) |
int | rebind (const EXT_ID &ext_id, const ACE_Unbounded_Set< INT_ID > &int_id_set, EXT_ID &old_ext_id, ACE_Unbounded_Set< INT_ID > &old_int_id_set) |
int | rebind (const EXT_ID &ext_id, const ACE_Unbounded_Set< INT_ID > &int_id_set, EXT_ID &old_ext_id, ACE_Unbounded_Set< INT_ID > &old_int_id_set, ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID > *&entry) |
int | find (const EXT_ID &ext_id, ACE_Unbounded_Set< INT_ID > &int_id_set) const |
int | find (const EXT_ID &ext_id, const 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_Multi_Map_Entry< EXT_ID, INT_ID > *&entry) const |
int | unbind (const EXT_ID &ext_id) |
int | unbind (const EXT_ID &ext_id, ACE_Unbounded_Set< INT_ID > &int_id_set) |
int | unbind (const EXT_ID &ext_id, const INT_ID &int_id) |
int | unbind (ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID > *entry) |
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. | |
ACE_Hash_Multi_Map_Iterator< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > | begin (void) |
Return forward iterator. | |
ACE_Hash_Multi_Map_Iterator< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > | end (void) |
ACE_Hash_Multi_Map_Reverse_Iterator< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > | rbegin (void) |
Return reverse iterator. | |
ACE_Hash_Multi_Map_Reverse_Iterator< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > | rend (void) |
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_Multi_Map_Entry< EXT_ID, INT_ID > *&entry) |
Performs bind. Must be called with locks held. | |
int | bind_i (const EXT_ID &ext_id, const ACE_Unbounded_Set< INT_ID > &int_id_set) |
Performs bind. Must be called with locks held. | |
int | bind_i (const EXT_ID &ext_id, const ACE_Unbounded_Set< INT_ID > &int_id_set, ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID > *&entry) |
Performs bind. Must be called with locks held. | |
int | trybind_i (const EXT_ID &ext_id, ACE_Unbounded_Set< INT_ID > &int_id_set) |
Performs trybind. Must be called with locks held. | |
int | trybind_i (const EXT_ID &ext_id, ACE_Unbounded_Set< INT_ID > &int_id_set, ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID > *&entry) |
Performs trybind. Must be called with locks held. | |
int | rebind_i (const EXT_ID &ext_id, const ACE_Unbounded_Set< INT_ID > &int_id_set) |
Performs rebind. Must be called with locks held. | |
int | rebind_i (const EXT_ID &ext_id, const ACE_Unbounded_Set< INT_ID > &int_id_set, ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID > *&entry) |
Performs rebind. Must be called with locks held. | |
int | rebind_i (const EXT_ID &ext_id, const ACE_Unbounded_Set< INT_ID > &int_id_set, ACE_Unbounded_Set< INT_ID > &old_int_id) |
Performs rebind. Must be called with locks held. | |
int | rebind_i (const EXT_ID &ext_id, const ACE_Unbounded_Set< INT_ID > &int_id_set, ACE_Unbounded_Set< INT_ID > &old_int_id_set, ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID > *&entry) |
Performs rebind. Must be called with locks held. | |
int | rebind_i (const EXT_ID &ext_id, const ACE_Unbounded_Set< INT_ID > &int_id_set, EXT_ID &old_ext_id, ACE_Unbounded_Set< INT_ID > &old_int_id_set) |
Performs rebind. Must be called with locks held. | |
int | rebind_i (const EXT_ID &ext_id, const ACE_Unbounded_Set< INT_ID > &int_id_set, EXT_ID &old_ext_id, ACE_Unbounded_Set< INT_ID > &old_int_id_set, ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID > *&entry) |
Performs rebind. Must be called with locks held. | |
int | find_i (const EXT_ID &ext_id, ACE_Unbounded_Set< INT_ID > &int_id_set) |
int | find_i (const EXT_ID &ext_id, const INT_ID &int_id) |
int | find_i (const EXT_ID &ext_id) |
int | find_i (const EXT_ID &ext_id, ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID > *&entry) |
int | unbind_i (const EXT_ID &ext_id, ACE_Unbounded_Set< INT_ID > &int_id_set) |
Performs unbind. Must be called with locks held. | |
int | unbind_i (const EXT_ID &ext_id, const 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_Multi_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_Multi_Map_Entry< EXT_ID, INT_ID > *&entry, size_t &loc) |
ACE_Hash_Multi_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_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > &) |
ACE_Hash_Multi_Map_Manager (const ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > &) | |
Private Attributes | |
ACE_Hash_Multi_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_Multi_Map_Iterator_Base< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > |
class | ACE_Hash_Multi_Map_Iterator< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > |
class | ACE_Hash_Multi_Map_Const_Iterator_Base< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > |
class | ACE_Hash_Multi_Map_Const_Iterator< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > |
class | ACE_Hash_Multi_Map_Reverse_Iterator< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > |
class | ACE_Hash_Multi_Map_Bucket_Iterator< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > |
This implementation of a multi-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 139 of file Hash_Multi_Map_Manager_T.h.
|
Definition at line 169 of file Hash_Multi_Map_Manager_T.h. |
|
Definition at line 161 of file Hash_Multi_Map_Manager_T.h. |
|
Definition at line 155 of file Hash_Multi_Map_Manager_T.h. |
|
Definition at line 167 of file Hash_Multi_Map_Manager_T.h. |
|
Definition at line 159 of file Hash_Multi_Map_Manager_T.h. |
|
Definition at line 150 of file Hash_Multi_Map_Manager_T.h. |
|
Definition at line 153 of file Hash_Multi_Map_Manager_T.h. |
|
Definition at line 171 of file Hash_Multi_Map_Manager_T.h. |
|
Definition at line 163 of file Hash_Multi_Map_Manager_T.h. |
|
Definition at line 152 of file Hash_Multi_Map_Manager_T.h. |
|
Initialize a
Definition at line 24 of file Hash_Multi_Map_Manager_T.inl. References ACE_DEFAULT_MAP_SIZE, ACE_ERROR, ACE_TEXT, LM_ERROR, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::open().
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 ("ACE_Hash_Multi_Map_Manager\n"))); 00034 } |
|
Initialize a
Definition at line 10 of file Hash_Multi_Map_Manager_T.inl. References ACE_ERROR, ACE_TEXT, LM_ERROR, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::open().
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_Multi_Map_Manager\n"))); 00021 } |
|
Cleanup the Hash_Multi_Map_Manager.
Definition at line 53 of file Hash_Multi_Map_Manager_T.inl. References ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close().
00054 { 00055 this->close (); 00056 } |
|
|
|
Return forward iterator.
Definition at line 425 of file Hash_Multi_Map_Manager_T.inl.
00426 { 00427 return ACE_Hash_Multi_Map_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> (*this); 00428 } |
|
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 137 of file Hash_Multi_Map_Manager_T.inl. References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i().
00140 { 00141 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00142 00143 return this->bind_i (ext_id, int_id_set, entry); 00144 } |
|
Associate ext_id with int_id_set. If ext_id is already in the map then the Definition at line 128 of file Hash_Multi_Map_Manager_T.inl. References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i().
00130 { 00131 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00132 00133 return this->bind_i (ext_id, int_id_set); 00134 } |
|
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 118 of file Hash_Multi_Map_Manager_T.inl. References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i().
00121 { 00122 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00123 00124 return this->bind_i (ext_id, int_id, entry); 00125 } |
|
Associate ext_id with int_id. If ext_id and int_id is already in the map then the Definition at line 109 of file Hash_Multi_Map_Manager_T.inl. References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i().
00111 { 00112 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00113 00114 return this->bind_i (ext_id, int_id); 00115 } |
|
Performs bind. Must be called with locks held.
Definition at line 256 of file Hash_Multi_Map_Manager_T.cpp. References ACE_ALLOCATOR_RETURN, ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID >::next_, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find().
00259 { 00260 size_t loc; 00261 int result = this->shared_find (ext_id, entry, loc); 00262 00263 if (result == -1) 00264 { 00265 void *ptr; 00266 // Not found. 00267 ACE_ALLOCATOR_RETURN (ptr, 00268 this->entry_allocator_->malloc (sizeof (ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID>)), 00269 -1); 00270 00271 entry = new (ptr) ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID> (ext_id, 00272 int_id_set, 00273 this->table_[loc].next_, 00274 &this->table_[loc]); 00275 this->table_[loc].next_ = entry; 00276 entry->next_->prev_ = entry; 00277 this->cur_size_++; 00278 return 0; 00279 } 00280 else 00281 return 1; 00282 } |
|
Performs bind. Must be called with locks held.
Definition at line 100 of file Hash_Multi_Map_Manager_T.inl. References ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i().
00102 { 00103 ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID> *temp; 00104 00105 return this->bind_i (ext_id, int_id_set, temp); 00106 } |
|
Performs bind. Must be called with locks held.
Definition at line 214 of file Hash_Multi_Map_Manager_T.cpp. References ACE_ALLOCATOR_RETURN, ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i(), ACE_Unbounded_Set< T >::insert(), ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID >::next_, ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find(), and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i().
00217 { 00218 size_t loc; 00219 int result = this->shared_find (ext_id, entry, loc); 00220 00221 ACE_Unbounded_Set<INT_ID> int_id_set; 00222 if (result == -1) 00223 { 00224 void *ptr; 00225 // Not found. 00226 ACE_ALLOCATOR_RETURN (ptr, 00227 this->entry_allocator_->malloc (sizeof (ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID>)), 00228 -1); 00229 00230 int_id_set.insert (int_id); 00231 00232 entry = new (ptr) ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID> (ext_id, 00233 int_id_set, 00234 this->table_[loc].next_, 00235 &this->table_[loc]); 00236 this->table_[loc].next_ = entry; 00237 entry->next_->prev_ = entry; 00238 this->cur_size_++; 00239 return 0; 00240 } 00241 else 00242 { 00243 int_id_set = (*entry).int_id_set_; 00244 00245 if (0 == int_id_set.insert (int_id)) 00246 { 00247 this->unbind_i (entry); 00248 return this->bind_i (ext_id, int_id_set); 00249 } 00250 else 00251 return 1; 00252 } 00253 } |
|
Performs bind. Must be called with locks held.
Definition at line 91 of file Hash_Multi_Map_Manager_T.inl. Referenced by ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind(), ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i(), ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i(), and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i().
00093 { 00094 ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID> *temp; 00095 00096 return this->bind_i (ext_id, int_id, temp); 00097 } |
|
Close down a Hash_Multi_Map_Manager and release dynamically allocated resources. Definition at line 37 of file Hash_Multi_Map_Manager_T.inl. References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close_i(). Referenced by ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::~ACE_Hash_Multi_Map_Manager().
00038 { 00039 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00040 00041 return this->close_i (); 00042 } |
|
Close down a Map_Manager. Must be called with locks held. Definition at line 150 of file Hash_Multi_Map_Manager_T.cpp. References ACE_DES_FREE_TEMPLATE2, ACE_NOOP, ACE_Allocator::free(), and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_all_i(). Referenced by ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close(), and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::open().
00151 { 00152 // Protect against "double-deletion" in case the destructor also 00153 // gets called. 00154 if (this->table_ != 0) 00155 { 00156 // Remove all the entries. 00157 this->unbind_all_i (); 00158 00159 // Iterate through the buckets cleaning up the sentinels. 00160 for (size_t i = 0; i < this->total_size_; i++) 00161 { 00162 // Destroy the dummy entry. 00163 ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID> *entry = &this->table_[i]; 00164 00165 // The second argument results in a no-op instead of 00166 // deallocation. 00167 ACE_DES_FREE_TEMPLATE2 (entry, ACE_NOOP, 00168 ACE_Hash_Multi_Map_Entry, EXT_ID, INT_ID); 00169 } 00170 00171 // Reset size. 00172 this->total_size_ = 0; 00173 00174 // Free table memory. 00175 this->table_allocator_->free (this->table_); 00176 00177 // Should be done last... 00178 this->table_ = 0; 00179 } 00180 00181 return 0; 00182 } |
|
Resize the map. Must be called with locks held.
Definition at line 96 of file Hash_Multi_Map_Manager_T.cpp. References ACE_ALLOCATOR_RETURN. Referenced by ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::open().
00097 { 00098 size_t bytes = size * sizeof (ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID>); 00099 void *ptr; 00100 00101 ACE_ALLOCATOR_RETURN (ptr, 00102 this->table_allocator_->malloc (bytes), 00103 -1); 00104 00105 this->table_ = (ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID> *) ptr; 00106 00107 this->total_size_ = size; 00108 00109 // Initialize each entry in the hash table to be a circular linked 00110 // list with the dummy node in the front serving as the anchor of 00111 // the list. 00112 for (size_t i = 0; i < size; i++) 00113 new (&this->table_[i]) ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID> (&this->table_[i], 00114 &this->table_[i]); 00115 return 0; 00116 } |
|
Accessor of the current size attribute.
Definition at line 460 of file Hash_Multi_Map_Manager_T.inl.
00461 { 00462 return this->cur_size_; 00463 } |
|
Returns the current number of Definition at line 59 of file Hash_Multi_Map_Manager_T.inl.
00060 { 00061 return this->cur_size_; 00062 } |
|
Dump the state of an object.
Definition at line 82 of file Hash_Multi_Map_Manager_T.cpp. References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_TEXT, ACE_Allocator::dump(), and LM_DEBUG.
00083 { 00084 #if defined (ACE_HAS_DUMP) 00085 ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); 00086 ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("total_size_ = %d"), this->total_size_)); 00087 ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ncur_size_ = %d"), this->cur_size_)); 00088 this->table_allocator_->dump (); 00089 this->entry_allocator_->dump (); 00090 this->lock_.dump (); 00091 ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); 00092 #endif /* ACE_HAS_DUMP */ 00093 } |
|
Definition at line 432 of file Hash_Multi_Map_Manager_T.inl.
00433 { 00434 return ACE_Hash_Multi_Map_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> (*this, 1); 00435 } |
|
Returns 1 if id1 == id2, else 0. This is defined as a separate method to facilitate template specialization. Definition at line 84 of file Hash_Multi_Map_Manager_T.inl. References ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::compare_keys_. Referenced by ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find().
00086 { 00087 return this->compare_keys_ (id1, id2); 00088 } |
|
Locate ext_id and pass out parameter via entry. If found, return 0, returns -1 if not found. Definition at line 309 of file Hash_Multi_Map_Manager_T.inl. References ACE_READ_GUARD_RETURN, ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find_i(), and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::lock_.
00311 { 00312 ACE_Hash_Multi_Map_Manager<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *nc_this = 00313 const_cast <ACE_Hash_Multi_Map_Manager<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *> 00314 (this); 00315 00316 ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, nc_this->lock_, -1); 00317 00318 return nc_this->find_i (ext_id, entry); 00319 } |
|
Returns 0 if the ext_id is in the mapping, otherwise -1.
Definition at line 289 of file Hash_Multi_Map_Manager_T.inl. References ACE_READ_GUARD_RETURN, ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find_i(), and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::lock_.
00290 { 00291 ACE_Hash_Multi_Map_Manager<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *nc_this = 00292 const_cast <ACE_Hash_Multi_Map_Manager<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *> 00293 (this); 00294 00295 ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, nc_this->lock_, -1); 00296 00297 return nc_this->find_i (ext_id); 00298 } |
|
Locate ext_id and int_id. Return 0 if found, returns -1 if not found. Definition at line 276 of file Hash_Multi_Map_Manager_T.inl. References ACE_READ_GUARD_RETURN, ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find_i(), and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::lock_.
00278 { 00279 ACE_Hash_Multi_Map_Manager<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *nc_this = 00280 const_cast <ACE_Hash_Multi_Map_Manager<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *> 00281 (this); 00282 00283 ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, nc_this->lock_, -1); 00284 00285 return nc_this->find_i (ext_id, int_id); 00286 } |
|
Locate ext_id and pass out parameter via int_id_set. Return 0 if found, returns -1 if not found. Definition at line 263 of file Hash_Multi_Map_Manager_T.inl. References ACE_READ_GUARD_RETURN, ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find_i(), and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::lock_.
00265 { 00266 ACE_Hash_Multi_Map_Manager<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *nc_this = 00267 const_cast <ACE_Hash_Multi_Map_Manager<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *> 00268 (this); 00269 00270 ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, nc_this->lock_, -1); 00271 00272 return nc_this->find_i (ext_id, int_id_set); 00273 } |
|
Performs a find using ext_id as the key. Must be called with locks held. Definition at line 301 of file Hash_Multi_Map_Manager_T.inl. References ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find().
00303 { 00304 size_t dummy; 00305 return this->shared_find (ext_id, entry, dummy); 00306 } |
|
Performs a find using ext_id as the key. Must be called with locks held. Definition at line 254 of file Hash_Multi_Map_Manager_T.inl. References ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find().
00255 { 00256 ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID> *entry; 00257 00258 size_t dummy; 00259 return this->shared_find (ext_id, entry, dummy); 00260 } |
|
Performs a find of ext_id and int_id. Must be called with locks held. Definition at line 236 of file Hash_Multi_Map_Manager_T.inl. References ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID >::int_id_set_, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find().
00238 { 00239 ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID> *entry; 00240 00241 size_t dummy; 00242 if (this->shared_find (ext_id, entry, dummy) == -1) 00243 return -1; 00244 else 00245 { 00246 if (0 == entry->int_id_set_.find (int_id)) 00247 return 0; 00248 else 00249 return -1; 00250 } 00251 } |
|
Performs a find of int_id_set using ext_id as the key. Must be called with locks held. Definition at line 220 of file Hash_Multi_Map_Manager_T.inl. References ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID >::int_id_set_, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find(). Referenced by ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find().
00222 { 00223 ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID> *entry; 00224 00225 size_t dummy; 00226 if (this->shared_find (ext_id, entry, dummy) == -1) 00227 return -1; 00228 else 00229 { 00230 int_id_set = entry->int_id_set_; 00231 return 0; 00232 } 00233 } |
|
Compute the hash value of the ext_id. This is defined as a separate method to facilitate template specialization. Definition at line 78 of file Hash_Multi_Map_Manager_T.inl. References ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::hash_key_. Referenced by ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find().
00079 { 00080 return this->hash_key_ (ext_id); 00081 } |
|
Returns a reference to the underlying
Definition at line 71 of file Hash_Multi_Map_Manager_T.inl. References ACE_TRACE.
|
|
Initialize a
Definition at line 119 of file Hash_Multi_Map_Manager_T.cpp. References ACE_WRITE_GUARD_RETURN, ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close_i(), ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::create_buckets(), and ACE_Allocator::instance(). Referenced by ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ACE_Hash_Multi_Map_Manager().
00122 { 00123 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00124 00125 // Calling this->close_i () to ensure we release previous allocated 00126 // memory before allocating new one. 00127 this->close_i (); 00128 00129 if (table_alloc == 0) 00130 table_alloc = ACE_Allocator::instance (); 00131 00132 this->table_allocator_ = table_alloc; 00133 00134 if (entry_alloc == 0) 00135 entry_alloc = table_alloc; 00136 00137 this->entry_allocator_ = entry_alloc; 00138 00139 // This assertion is here to help track a situation that shouldn't 00140 // happen, but did with Sun C++ 4.1 (before a change to this class 00141 // was made: it used to have an enum that was supposed to be defined 00142 // to be ACE_DEFAULT_MAP_SIZE, but instead was defined to be 0). 00143 if (size == 0) 00144 return -1; 00145 00146 return this->create_buckets (size); 00147 } |
|
|
|
Return reverse iterator.
Definition at line 439 of file Hash_Multi_Map_Manager_T.inl.
00440 { 00441 return ACE_Hash_Multi_Map_Reverse_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> (*this); 00442 } |
|
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 412 of file Hash_Multi_Map_Manager_T.inl. References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().
00417 { 00418 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00419 00420 return this->rebind_i (ext_id, int_id_set, old_ext_id, old_int_id_set, entry); 00421 } |
|
Associate ext_id with int_id_set. If ext_id is not in the map then behaves just like bind. Otherwise, store the old values of ext_id and int_id_set into the "out" parameters and rebind the new parameters. This is very useful if you need to have an atomic way of updating Definition at line 401 of file Hash_Multi_Map_Manager_T.inl. References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().
00405 { 00406 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00407 00408 return this->rebind_i (ext_id, int_id_set, old_ext_id, old_int_id_set); 00409 } |
|
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 390 of file Hash_Multi_Map_Manager_T.inl. References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().
00394 { 00395 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00396 00397 return this->rebind_i (ext_id, int_id_set, old_int_id_set, entry); 00398 } |
|
Associate ext_id with int_id_set. If ext_id is not in the map then behaves just like bind. Otherwise, store the old value of int_id_set 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 380 of file Hash_Multi_Map_Manager_T.inl. References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().
00383 { 00384 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00385 00386 return this->rebind_i (ext_id, int_id_set, old_int_id_set); 00387 } |
|
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 370 of file Hash_Multi_Map_Manager_T.inl. References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().
00373 { 00374 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00375 00376 return this->rebind_i (ext_id, int_id_set, entry); 00377 } |
|
Reassociate ext_id with int_id_set. 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 361 of file Hash_Multi_Map_Manager_T.inl. References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().
00363 { 00364 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00365 00366 return this->rebind_i (ext_id, int_id_set); 00367 } |
|
Performs rebind. Must be called with locks held.
Definition at line 436 of file Hash_Multi_Map_Manager_T.cpp. References ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i(), ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID >::ext_id_, ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID >::int_id_set_, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find().
00441 { 00442 size_t dummy; 00443 if (this->shared_find (ext_id, entry, dummy) == -1) 00444 return this->bind_i (ext_id, int_id_set); 00445 else 00446 { 00447 old_ext_id = entry->ext_id_; 00448 old_int_id_set = entry->int_id_set_; 00449 entry->ext_id_ = ext_id; 00450 entry->int_id_set_ = int_id_set; 00451 return 1; 00452 } 00453 } |
|
Performs rebind. Must be called with locks held.
Definition at line 346 of file Hash_Multi_Map_Manager_T.inl. References ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().
00350 { 00351 ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID> *node; 00352 00353 return this->rebind_i (ext_id, 00354 int_id_set, 00355 old_ext_id, 00356 old_int_id_set, 00357 node); 00358 } |
|
Performs rebind. Must be called with locks held.
Definition at line 418 of file Hash_Multi_Map_Manager_T.cpp. References ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i(), ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID >::ext_id_, ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID >::int_id_set_, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find().
00422 { 00423 size_t dummy; 00424 if (this->shared_find (ext_id, entry, dummy) == -1) 00425 return this->bind_i (ext_id, int_id_set); 00426 else 00427 { 00428 old_int_id_set = entry->int_id_set_; 00429 entry->ext_id_ = ext_id; 00430 entry->int_id_set_ = int_id_set; 00431 return 1; 00432 } 00433 } |
|
Performs rebind. Must be called with locks held.
Definition at line 333 of file Hash_Multi_Map_Manager_T.inl. References ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().
00336 { 00337 ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID> *node; 00338 00339 return this->rebind_i (ext_id, 00340 int_id_set, 00341 old_int_id_set, 00342 node); 00343 } |
|
Performs rebind. Must be called with locks held.
Definition at line 402 of file Hash_Multi_Map_Manager_T.cpp. References ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i(), ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID >::ext_id_, ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID >::int_id_set_, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find().
00405 { 00406 size_t dummy; 00407 if (this->shared_find (ext_id, entry, dummy) == -1) 00408 return this->bind_i (ext_id, int_id_set); 00409 else 00410 { 00411 entry->ext_id_ = ext_id; 00412 entry->int_id_set_ = int_id_set; 00413 return 1; 00414 } 00415 } |
|
Performs rebind. Must be called with locks held.
Definition at line 322 of file Hash_Multi_Map_Manager_T.inl. Referenced by ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind(), and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().
00324 { 00325 ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID> *node; 00326 00327 return this->rebind_i (ext_id, 00328 int_id_set, 00329 node); 00330 } |
|
Definition at line 446 of file Hash_Multi_Map_Manager_T.inl.
00447 { 00448 return ACE_Hash_Multi_Map_Reverse_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> (*this, 1); 00449 } |
|
|
Accessor of the underlying table.
Definition at line 453 of file Hash_Multi_Map_Manager_T.inl.
00454 { 00455 return this->table_; 00456 } |
|
Return the size of the array that's used to point to the linked lists of Definition at line 65 of file Hash_Multi_Map_Manager_T.inl.
00066 { 00067 return this->total_size_; 00068 } |
|
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 168 of file Hash_Multi_Map_Manager_T.inl. References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::trybind_i().
00171 { 00172 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00173 00174 return this->trybind_i (ext_id, int_id_set, entry); 00175 } |
|
Associate ext_id with int_id_set if and only if ext_id is not in the map. If ext_id is already in the map then the int_id_set 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 159 of file Hash_Multi_Map_Manager_T.inl. References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::trybind_i().
00161 { 00162 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00163 00164 return this->trybind_i (ext_id, int_id_set); 00165 } |
|
Performs trybind. Must be called with locks held.
Definition at line 285 of file Hash_Multi_Map_Manager_T.cpp. References ACE_ALLOCATOR_RETURN, ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID >::next_, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find().
00288 { 00289 size_t loc; 00290 int result = this->shared_find (ext_id, entry, loc); 00291 00292 if (result == -1) 00293 { 00294 // Not found. 00295 void *ptr; 00296 ACE_ALLOCATOR_RETURN (ptr, 00297 this->entry_allocator_->malloc (sizeof (ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID>)), 00298 -1); 00299 00300 entry = new (ptr) ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID> (ext_id, 00301 int_id_set, 00302 this->table_[loc].next_, 00303 &this->table_[loc]); 00304 this->table_[loc].next_ = entry; 00305 entry->next_->prev_ = entry; 00306 this->cur_size_++; 00307 return 0; 00308 } 00309 else 00310 return 1; 00311 } |
|
Performs trybind. Must be called with locks held.
Definition at line 147 of file Hash_Multi_Map_Manager_T.inl. References ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID >::int_id_set_. Referenced by ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::trybind().
00149 { 00150 ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID> *temp; 00151 00152 int result = this->trybind_i (ext_id, int_id_set, temp); 00153 if (result == 1) 00154 int_id_set = temp->int_id_set_; 00155 return result; 00156 } |
|
Remove entry from map. Return 0 if the unbind was successfully, and returns -1 if failures occur. Definition at line 212 of file Hash_Multi_Map_Manager_T.inl. References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i().
00213 { 00214 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00215 00216 return this->unbind_i (entry) == -1 ? -1 : 0; 00217 } |
|
Break any association of ext_id and int_id. Return 0 if the unbind was successfully, and returns -1 if failures occur. Definition at line 195 of file Hash_Multi_Map_Manager_T.inl. References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Multi_Map_Manager< 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 (ext_id, int_id); 00201 } |
|
Break any association of ext_id. Returns the value of int_id_set in case the caller needs to deallocate memory. Return 0 if the unbind was successfully, and returns -1 if failures occur. Definition at line 186 of file Hash_Multi_Map_Manager_T.inl. References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i().
00188 { 00189 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00190 00191 return this->unbind_i (ext_id, int_id_set); 00192 } |
|
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 204 of file Hash_Multi_Map_Manager_T.inl. References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i().
00205 { 00206 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00207 00208 return this->unbind_i (ext_id) == -1 ? -1 : 0; 00209 } |
|
Removes all the entries in Hash_Multi_Map_Manager.
Definition at line 45 of file Hash_Multi_Map_Manager_T.inl. References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_all_i().
00046 { 00047 ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1); 00048 00049 return this->unbind_all_i (); 00050 } |
|
Removes all the entries in Map_Manager. Must be called with locks held. Definition at line 185 of file Hash_Multi_Map_Manager_T.cpp. References ACE_DES_FREE_TEMPLATE2, ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID >::next_, and ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID >::prev_. Referenced by ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close_i(), and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_all().
00186 { 00187 // Iterate through the entire map calling the destuctor of each 00188 // <ACE_Hash_Multi_Map_Entry>. 00189 for (size_t i = 0; i < this->total_size_; i++) 00190 { 00191 for (ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID> *temp_ptr = this->table_[i].next_; 00192 temp_ptr != &this->table_[i]; 00193 ) 00194 { 00195 ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID> *hold_ptr = temp_ptr; 00196 temp_ptr = temp_ptr->next_; 00197 00198 // Explicitly call the destructor. 00199 ACE_DES_FREE_TEMPLATE2 (hold_ptr, this->entry_allocator_->free, 00200 ACE_Hash_Multi_Map_Entry, EXT_ID, INT_ID); 00201 } 00202 00203 // Restore the sentinel. 00204 this->table_[i].next_ = &this->table_[i]; 00205 this->table_[i].prev_ = &this->table_[i]; 00206 } 00207 00208 this->cur_size_ = 0; 00209 00210 return 0; 00211 } |
|
Performs unbind. Must be called with locks held.
Definition at line 334 of file Hash_Multi_Map_Manager_T.cpp. References ACE_DES_FREE_TEMPLATE2, ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID >::next_, and ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID >::prev_.
00335 { 00336 entry->next_->prev_ = entry->prev_; 00337 entry->prev_->next_ = entry->next_; 00338 00339 // Explicitly call the destructor. 00340 ACE_DES_FREE_TEMPLATE2 (entry, this->entry_allocator_->free, 00341 ACE_Hash_Multi_Map_Entry, EXT_ID, INT_ID); 00342 00343 this->cur_size_--; 00344 return 0; 00345 } |
|
Performs unbind. Must be called with locks held.
Definition at line 178 of file Hash_Multi_Map_Manager_T.inl. References ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i().
00179 { 00180 ACE_Unbounded_Set<INT_ID> int_id_set; 00181 00182 return this->unbind_i (ext_id, int_id_set); 00183 } |
|
Performs unbind. Must be called with locks held.
Definition at line 348 of file Hash_Multi_Map_Manager_T.cpp. References ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i(), ACE_Unbounded_Set< T >::remove(), ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find(), ACE_Unbounded_Set< T >::size(), and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i().
00350 { 00351 ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID> *temp; 00352 00353 size_t loc; 00354 int result = this->shared_find (ext_id, temp, loc); 00355 00356 if (result == -1) 00357 { 00358 errno = ENOENT; 00359 return -1; 00360 } 00361 00362 ACE_Unbounded_Set<INT_ID> int_id_set = (*temp).int_id_set_; 00363 if (0 == int_id_set.remove (int_id)) 00364 { 00365 this->unbind_i (temp); 00366 00367 if (0 != int_id_set.size ()) 00368 return this->bind_i (ext_id, int_id_set); 00369 else 00370 return 0; 00371 } 00372 else 00373 return -1; 00374 } |
|
Performs unbind. Must be called with locks held.
Definition at line 314 of file Hash_Multi_Map_Manager_T.cpp. References ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID >::int_id_set_, and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find(). Referenced by ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i(), ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind(), and ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i().
00316 { 00317 ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID> *temp; 00318 00319 size_t loc; 00320 int result = this->shared_find (ext_id, temp, loc); 00321 00322 if (result == -1) 00323 { 00324 errno = ENOENT; 00325 return -1; 00326 } 00327 00328 int_id_set = temp->int_id_set_; 00329 00330 return this->unbind_i (temp); 00331 } |
|
Definition at line 147 of file Hash_Multi_Map_Manager_T.h. |
|
Definition at line 145 of file Hash_Multi_Map_Manager_T.h. |
|
Definition at line 144 of file Hash_Multi_Map_Manager_T.h. |
|
Definition at line 143 of file Hash_Multi_Map_Manager_T.h. |
|
Definition at line 142 of file Hash_Multi_Map_Manager_T.h. |
|
Definition at line 146 of file Hash_Multi_Map_Manager_T.h. |
|
Function object used for comparing keys.
Definition at line 568 of file Hash_Multi_Map_Manager_T.h. Referenced by ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::equal(). |
|
Current number of entries in the table
Definition at line 597 of file Hash_Multi_Map_Manager_T.h. |
|
Addidtional allocator for entries, so it should be able to allocate 'size' / chunks of sizeof ( Definition at line 558 of file Hash_Multi_Map_Manager_T.h. |
|
Function object used for hashing keys.
Definition at line 565 of file Hash_Multi_Map_Manager_T.h. Referenced by ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::hash(). |
|
Synchronization variable for the MT_SAFE Definition at line 562 of file Hash_Multi_Map_Manager_T.h. Referenced by ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find(). |
|
Array of the pointers to Definition at line 589 of file Hash_Multi_Map_Manager_T.h. Referenced by ACE_Hash_Multi_Map_Const_Iterator_Base< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ACE_Hash_Multi_Map_Const_Iterator_Base(), and ACE_Hash_Multi_Map_Iterator_Base< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ACE_Hash_Multi_Map_Iterator_Base(). |
|
Pointer to a memory allocator used for table_, so it should supply size*sizeof ( Definition at line 553 of file Hash_Multi_Map_Manager_T.h. |
|
Total size of the hash table.
Definition at line 592 of file Hash_Multi_Map_Manager_T.h. Referenced by ACE_Hash_Multi_Map_Const_Iterator_Base< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ACE_Hash_Multi_Map_Const_Iterator_Base(), and ACE_Hash_Multi_Map_Iterator_Base< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ACE_Hash_Multi_Map_Iterator_Base(). |