Public Types |
typedef EXT_ID | KEY |
typedef INT_ID | VALUE |
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_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 |
Public Methods |
| ACE_Hash_Map_Manager_Ex (ACE_Allocator *alloc=0) |
| Initialize a <Hash_Map_Manager_Ex> with default size. More...
|
| ACE_Hash_Map_Manager_Ex (size_t size, ACE_Allocator *alloc=0) |
| Initialize a <Hash_Map_Manager_Ex> with size <length>. More...
|
int | open (size_t size=ACE_DEFAULT_MAP_SIZE, ACE_Allocator *alloc=0) |
| Initialize a <Hash_Map_Manager_Ex> with <size> elements. More...
|
int | close (void) |
| Close down a <Hash_Map_Manager_Ex> and release dynamically allocated resources. More...
|
int | unbind_all (void) |
| Removes all the entries in <Map_Manager_Ex>. More...
|
| ~ACE_Hash_Map_Manager_Ex (void) |
| Cleanup the <Hash_Map_Manager_Ex>. More...
|
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 |
| Locate <ext_id> and pass out parameter via <int_id>. Return 0 if found, returns -1 if not found. More...
|
int | find (const EXT_ID &ext_id) const |
| Returns 0 if the <ext_id> is in the mapping, otherwise -1. More...
|
int | 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. More...
|
int | unbind (const EXT_ID &ext_id) |
int | 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 successfully, and returns -1 if failures occur. More...
|
int | unbind (ACE_Hash_Map_Entry< EXT_ID, INT_ID > *entry) |
| Remove entry from map. Return 0 if the unbind was successfully, and returns -1 if failures occur. More...
|
size_t | current_size (void) const |
| Return the current size of the map. More...
|
size_t | total_size (void) const |
| Return the total size of the map. More...
|
ACE_LOCK & | mutex (void) |
void | dump (void) const |
| Dump the state of an object. More...
|
ACE_Hash_Map_Iterator_Ex<
EXT_ID, INT_ID, HASH_KEY,
COMPARE_KEYS, ACE_LOCK > | begin (void) |
| Return forward iterator. More...
|
ACE_Hash_Map_Iterator_Ex<
EXT_ID, INT_ID, HASH_KEY,
COMPARE_KEYS, ACE_LOCK > | end (void) |
ACE_Hash_Map_Reverse_Iterator_Ex<
EXT_ID, INT_ID, HASH_KEY,
COMPARE_KEYS, ACE_LOCK > | rbegin (void) |
| Return reverse iterator. More...
|
ACE_Hash_Map_Reverse_Iterator_Ex<
EXT_ID, INT_ID, HASH_KEY,
COMPARE_KEYS, ACE_LOCK > | rend (void) |
Protected Methods |
int | equal (const EXT_ID &id1, const EXT_ID &id2) |
| Returns 1 if <id1> == <id2>, else 0. This is defined as a separate method to facilitate template specialization. More...
|
u_long | hash (const EXT_ID &ext_id) |
| Compute the hash value of the <ext_id>. This is defined as a separate method to facilitate template specialization. More...
|
int | bind_i (const EXT_ID &ext_id, const INT_ID &int_id) |
| Performs bind. Must be called with locks held. More...
|
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. More...
|
int | trybind_i (const EXT_ID &ext_id, INT_ID &int_id) |
| Performs trybind. Must be called with locks held. More...
|
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. More...
|
int | rebind_i (const EXT_ID &ext_id, const INT_ID &int_id) |
| Performs rebind. Must be called with locks held. More...
|
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. More...
|
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. More...
|
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. More...
|
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. More...
|
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. More...
|
int | find_i (const EXT_ID &ext_id, INT_ID &int_id) |
| Performs a find of <int_id> using <ext_id> as the key. Must be called with locks held. More...
|
int | find_i (const EXT_ID &ext_id) |
| Performs a find using <ext_id> as the key. Must be called with locks held. More...
|
int | find_i (const EXT_ID &ext_id, ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&entry) |
| Performs a find using <ext_id> as the key. Must be called with locks held. More...
|
int | unbind_i (const EXT_ID &ext_id, INT_ID &int_id) |
| Performs unbind. Must be called with locks held. More...
|
int | unbind_i (const EXT_ID &ext_id) |
| Performs unbind. Must be called with locks held. More...
|
int | unbind_i (ACE_Hash_Map_Entry< EXT_ID, INT_ID > *entry) |
| Performs unbind. Must be called with locks held. More...
|
int | create_buckets (size_t size) |
int | close_i (void) |
| Close down a <Map_Manager_Ex>. Must be called with locks held. More...
|
int | unbind_all_i (void) |
| Removes all the entries in <Map_Manager_Ex>. Must be called with locks held. More...
|
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>. More...
|
Protected Attributes |
ACE_Allocator * | allocator_ |
| Pointer to a memory allocator. More...
|
ACE_LOCK | lock_ |
| Synchronization variable for the MT_SAFE <ACE_Hash_Map_Manager_Ex>. More...
|
HASH_KEY | hash_key_ |
| Function object used for hashing keys. More...
|
COMPARE_KEYS | compare_keys_ |
| Function object used for comparing keys. More...
|
Private Methods |
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. More...
|
size_t | cur_size_ |
| Current number of entries in the table (note that this can be larger than <total_size_> due to the bucket chaining). More...
|
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_Bucket_Iterator< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > |
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.