ACE  6.0.6
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends
ACE_Hash_Multi_Map_Manager Class Reference

Define a multi-map abstraction that efficiently associates the keys with their different values. More...

#include <Hash_Multi_Map_Manager_T.h>

Collaboration diagram for ACE_Hash_Multi_Map_Manager:
Collaboration graph
[legend]

List of all members.

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_Allocatortable_allocator_
ACE_Allocatorentry_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 >

Detailed Description

Define a multi-map abstraction that efficiently associates the keys with their different values.

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.


Member Typedef Documentation

typedef ACE_Hash_Multi_Map_Const_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_Hash_Multi_Map_Manager::CONST_ITERATOR
typedef ACE_Hash_Multi_Map_Const_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_Hash_Multi_Map_Manager::const_iterator
typedef ACE_Hash_Multi_Map_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_Hash_Multi_Map_Manager::ITERATOR
typedef ACE_Hash_Multi_Map_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_Hash_Multi_Map_Manager::iterator
typedef ACE_Hash_Multi_Map_Reverse_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_Hash_Multi_Map_Manager::REVERSE_ITERATOR
typedef ACE_Hash_Multi_Map_Reverse_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_Hash_Multi_Map_Manager::reverse_iterator

Constructor & Destructor Documentation

ACE_Hash_Multi_Map_Manager::ACE_Hash_Multi_Map_Manager ( ACE_Allocator table_alloc = 0,
ACE_Allocator entry_alloc = 0 
)

Initialize a Hash_Multi_Map_Manager with default size elements.

Parameters:
table_allocis a pointer to a memory allocator used for table_, so it should supply size*sizeof ( ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID>).
entry_allocis a pointer to an additional allocator for entries, so it should be able to allocate 'size' / chunks of sizeof (ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID>) bytes each. If table_alloc is 0 it defaults to ACE_Allocator::instance(). If entry_alloc is 0 then it defaults to the same allocator as table_alloc.
ACE_Hash_Multi_Map_Manager::ACE_Hash_Multi_Map_Manager ( size_t  size,
ACE_Allocator table_alloc = 0,
ACE_Allocator entry_alloc = 0 
)

Initialize a Hash_Multi_Map_Manager with size elements.

Parameters:
sizeis the number of elements in a Hash_Multi_Map_Manager.
table_allocis a pointer to a memory allocator used for table_, so it should supply size*sizeof ( ACE_Hash_Multi_Map_Entry<EXT_ID, <INT_ID>).
entry_allocis a pointer to an additional allocator for entries, so it should be able to allocate 'size' / chunks of sizeof (ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID>) bytes each. If table_alloc is 0 it defaults to ACE_Allocator::instance(). If entry_alloc is 0 then it defaults to the same allocator as table_alloc.
ACE_Hash_Multi_Map_Manager::~ACE_Hash_Multi_Map_Manager ( void  )

Cleanup the Hash_Multi_Map_Manager.

ACE_Hash_Multi_Map_Manager::ACE_Hash_Multi_Map_Manager ( const ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > &  ) [private]

Member Function Documentation

ACE_Hash_Multi_Map_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_Hash_Multi_Map_Manager::begin ( void  )

Return forward iterator.

int ACE_Hash_Multi_Map_Manager::bind ( const EXT_ID &  ext_id,
const INT_ID &  int_id 
)

Associate ext_id with int_id. If ext_id and int_id is already in the map then the ACE_Hash_Multi_Map_Entry is not changed. 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.

int ACE_Hash_Multi_Map_Manager::bind ( const EXT_ID &  ext_id,
const INT_ID &  int_id,
ACE_Hash_Multi_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.

int ACE_Hash_Multi_Map_Manager::bind ( const EXT_ID &  ext_id,
const ACE_Unbounded_Set< INT_ID > &  int_id_set 
)

Associate ext_id with int_id_set. If ext_id is already in the map then the ACE_Hash_Multi_Map_Entry is not changed. 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.

int ACE_Hash_Multi_Map_Manager::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 
)

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.

int ACE_Hash_Multi_Map_Manager::bind_i ( const EXT_ID &  ext_id,
const INT_ID &  int_id 
) [protected]

Performs bind. Must be called with locks held.

int ACE_Hash_Multi_Map_Manager::bind_i ( const EXT_ID &  ext_id,
const INT_ID &  int_id,
ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID > *&  entry 
) [protected]

Performs bind. Must be called with locks held.

int ACE_Hash_Multi_Map_Manager::bind_i ( const EXT_ID &  ext_id,
const ACE_Unbounded_Set< INT_ID > &  int_id_set 
) [protected]

Performs bind. Must be called with locks held.

int ACE_Hash_Multi_Map_Manager::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 
) [protected]

Performs bind. Must be called with locks held.

int ACE_Hash_Multi_Map_Manager::close ( void  )

Close down a Hash_Multi_Map_Manager and release dynamically allocated resources.

int ACE_Hash_Multi_Map_Manager::close_i ( void  ) [protected]

Close down a Map_Manager. Must be called with locks held.

int ACE_Hash_Multi_Map_Manager::create_buckets ( size_t  size) [protected]

Resize the map. Must be called with locks held.

Note:
This method should never be called more than once or else all the hashing will get screwed up as the size will change.
size_t ACE_Hash_Multi_Map_Manager::cur_size ( void  ) const [protected]

Accessor of the current size attribute.

size_t ACE_Hash_Multi_Map_Manager::current_size ( void  ) const

Returns the current number of ACE_Hash_Multi_Map_Entry objects in the hash table.

void ACE_Hash_Multi_Map_Manager::dump ( void  ) const

Dump the state of an object.

ACE_Hash_Multi_Map_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_Hash_Multi_Map_Manager::end ( void  )
int ACE_Hash_Multi_Map_Manager::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.

int ACE_Hash_Multi_Map_Manager::find ( const EXT_ID &  ext_id,
ACE_Unbounded_Set< INT_ID > &  int_id_set 
) const

Locate ext_id and pass out parameter via int_id_set. Return 0 if found, returns -1 if not found.

int ACE_Hash_Multi_Map_Manager::find ( const EXT_ID &  ext_id,
const INT_ID &  int_id 
) const

Locate ext_id and int_id. Return 0 if found, returns -1 if not found.

int ACE_Hash_Multi_Map_Manager::find ( const EXT_ID &  ext_id) const

Returns 0 if the ext_id is in the mapping, otherwise -1.

int ACE_Hash_Multi_Map_Manager::find ( const EXT_ID &  ext_id,
ACE_Hash_Multi_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.

int ACE_Hash_Multi_Map_Manager::find_i ( const EXT_ID &  ext_id,
ACE_Unbounded_Set< INT_ID > &  int_id_set 
) [protected]

Performs a find of int_id_set using ext_id as the key. Must be called with locks held.

int ACE_Hash_Multi_Map_Manager::find_i ( const EXT_ID &  ext_id,
const INT_ID &  int_id 
) [protected]

Performs a find of ext_id and int_id. Must be called with locks held.

int ACE_Hash_Multi_Map_Manager::find_i ( const EXT_ID &  ext_id) [protected]

Performs a find using ext_id as the key. Must be called with locks held.

int ACE_Hash_Multi_Map_Manager::find_i ( const EXT_ID &  ext_id,
ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID > *&  entry 
) [protected]

Performs a find using ext_id as the key. Must be called with locks held.

u_long ACE_Hash_Multi_Map_Manager::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.

ACE_LOCK& ACE_Hash_Multi_Map_Manager::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.

Note:
The right name would be lock, but HP/C++ will choke on that!
int ACE_Hash_Multi_Map_Manager::open ( size_t  size = ACE_DEFAULT_MAP_SIZE,
ACE_Allocator table_alloc = 0,
ACE_Allocator entry_alloc = 0 
)

Initialize a Hash_Multi_Map_Manager with size elements.

Parameters:
sizeis the number of elements in a Hash_Multi_Map_Manager.
table_allocis a pointer to a memory allocator used for table_, so it should supply size*sizeof (ACE_Hash_Multi_Map_Entry<EXT_ID, <INT_ID>).
entry_allocis a pointer to an additional allocator for entries, so it should be able to allocate 'size' / chunks of sizeof (ACE_Hash_Multi_Map_Entry<EXT_ID, <INT_ID>) bytes each. If table_alloc is 0 it defaults to ACE_Allocator::instance(). If entry_alloc is 0 then it defaults to the same allocator as table_alloc.
Returns:
-1 on failure, 0 on success
void ACE_Hash_Multi_Map_Manager::operator= ( const ACE_Hash_Multi_Map_Manager< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > &  ) [private]
ACE_Hash_Multi_Map_Reverse_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_Hash_Multi_Map_Manager::rbegin ( void  )

Return reverse iterator.

int ACE_Hash_Multi_Map_Manager::rebind ( const EXT_ID &  ext_id,
const ACE_Unbounded_Set< INT_ID > &  int_id_set 
)

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.

int ACE_Hash_Multi_Map_Manager::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 
)

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.

int ACE_Hash_Multi_Map_Manager::rebind ( const EXT_ID &  ext_id,
const ACE_Unbounded_Set< INT_ID > &  int_id_set,
ACE_Unbounded_Set< INT_ID > &  old_int_id_set 
)

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.

int ACE_Hash_Multi_Map_Manager::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 
)

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.

int ACE_Hash_Multi_Map_Manager::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 
)

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 ACE_Hash_Multi_Map_Entry objects 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.

int ACE_Hash_Multi_Map_Manager::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 
)

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.

int ACE_Hash_Multi_Map_Manager::rebind_i ( const EXT_ID &  ext_id,
const ACE_Unbounded_Set< INT_ID > &  int_id_set 
) [protected]

Performs rebind. Must be called with locks held.

int ACE_Hash_Multi_Map_Manager::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 
) [protected]

Performs rebind. Must be called with locks held.

int ACE_Hash_Multi_Map_Manager::rebind_i ( const EXT_ID &  ext_id,
const ACE_Unbounded_Set< INT_ID > &  int_id_set,
ACE_Unbounded_Set< INT_ID > &  old_int_id 
) [protected]

Performs rebind. Must be called with locks held.

int ACE_Hash_Multi_Map_Manager::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 
) [protected]

Performs rebind. Must be called with locks held.

int ACE_Hash_Multi_Map_Manager::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 
) [protected]

Performs rebind. Must be called with locks held.

int ACE_Hash_Multi_Map_Manager::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 
) [protected]

Performs rebind. Must be called with locks held.

ACE_Hash_Multi_Map_Reverse_Iterator<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_Hash_Multi_Map_Manager::rend ( void  )
int ACE_Hash_Multi_Map_Manager::shared_find ( const EXT_ID &  ext_id,
ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID > *&  entry,
size_t &  loc 
) [protected]

Returns the ACE_Hash_Multi_Map_Entry object that corresponds to ext_id.

ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID>* ACE_Hash_Multi_Map_Manager::table ( void  ) [protected]

Accessor of the underlying table.

size_t ACE_Hash_Multi_Map_Manager::total_size ( void  ) const

Return the size of the array that's used to point to the linked lists of ACE_Hash_Multi_Map_Entry objects in the hash table.

int ACE_Hash_Multi_Map_Manager::trybind ( const EXT_ID &  ext_id,
ACE_Unbounded_Set< INT_ID > &  int_id_set 
)

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.

int ACE_Hash_Multi_Map_Manager::trybind ( const EXT_ID &  ext_id,
ACE_Unbounded_Set< INT_ID > &  int_id_set,
ACE_Hash_Multi_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.

int ACE_Hash_Multi_Map_Manager::trybind_i ( const EXT_ID &  ext_id,
ACE_Unbounded_Set< INT_ID > &  int_id_set 
) [protected]

Performs trybind. Must be called with locks held.

int ACE_Hash_Multi_Map_Manager::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 
) [protected]

Performs trybind. Must be called with locks held.

int ACE_Hash_Multi_Map_Manager::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...)

int ACE_Hash_Multi_Map_Manager::unbind ( const EXT_ID &  ext_id,
ACE_Unbounded_Set< INT_ID > &  int_id_set 
)

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.

int ACE_Hash_Multi_Map_Manager::unbind ( const EXT_ID &  ext_id,
const INT_ID &  int_id 
)

Break any association of ext_id and int_id. Return 0 if the unbind was successfully, and returns -1 if failures occur.

int ACE_Hash_Multi_Map_Manager::unbind ( ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID > *  entry)

Remove entry from map. Return 0 if the unbind was successfully, and returns -1 if failures occur.

int ACE_Hash_Multi_Map_Manager::unbind_all ( void  )

Removes all the entries in Hash_Multi_Map_Manager.

int ACE_Hash_Multi_Map_Manager::unbind_all_i ( void  ) [protected]

Removes all the entries in Map_Manager. Must be called with locks held.

int ACE_Hash_Multi_Map_Manager::unbind_i ( const EXT_ID &  ext_id,
ACE_Unbounded_Set< INT_ID > &  int_id_set 
) [protected]

Performs unbind. Must be called with locks held.

int ACE_Hash_Multi_Map_Manager::unbind_i ( const EXT_ID &  ext_id,
const INT_ID &  int_id 
) [protected]

Performs unbind. Must be called with locks held.

int ACE_Hash_Multi_Map_Manager::unbind_i ( const EXT_ID &  ext_id) [protected]

Performs unbind. Must be called with locks held.

int ACE_Hash_Multi_Map_Manager::unbind_i ( ACE_Hash_Multi_Map_Entry< EXT_ID, INT_ID > *  entry) [protected]

Performs unbind. Must be called with locks held.


Friends And Related Function Documentation

friend class ACE_Hash_Multi_Map_Bucket_Iterator< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > [friend]
friend class ACE_Hash_Multi_Map_Const_Iterator< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > [friend]
friend class ACE_Hash_Multi_Map_Const_Iterator_Base< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > [friend]
friend class ACE_Hash_Multi_Map_Iterator< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > [friend]
friend class ACE_Hash_Multi_Map_Iterator_Base< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > [friend]
friend class ACE_Hash_Multi_Map_Reverse_Iterator< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > [friend]

Member Data Documentation

Function object used for comparing keys.

Current number of entries in the table

Note:
That this can be larger than total_size_ due to the bucket chaining).

Addidtional allocator for entries, so it should be able to allocate 'size' / chunks of sizeof (ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID>) bytes each.

Function object used for hashing keys.

ACE_LOCK ACE_Hash_Multi_Map_Manager::lock_ [protected]

Synchronization variable for the MT_SAFE ACE_Hash_Multi_Map_Manager.

Array of the pointers to ACE_Hash_Multi_Map_Entry objects, each of which points to an ACE_Hash_Multi_Map_Entry that serves as the beginning of a linked list of EXT_ID that hash to that bucket.

Pointer to a memory allocator used for table_, so it should supply size*sizeof (ACE_Hash_Multi_Map_Entry<EXT_ID, INT_ID>),

Total size of the hash table.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines