ACE 7.1.4
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ACE_Hash_Map_Manager< EXT_ID, INT_ID, ACE_LOCK > Class Template Reference

Wrapper for backward compatibility. More...

#include <Hash_Map_Manager_T.h>

Inheritance diagram for ACE_Hash_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >:
Inheritance graph
[legend]
Collaboration diagram for ACE_Hash_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >:
Collaboration graph
[legend]

Public Member Functions

 ACE_Hash_Map_Manager (ACE_Allocator *table_alloc=0, ACE_Allocator *entry_alloc=0)
 
 ACE_Hash_Map_Manager (size_t size, ACE_Allocator *table_alloc=0, ACE_Allocator *entry_alloc=0)
 
int equal (const EXT_ID &id1, const EXT_ID &id2)
 
u_long hash (const EXT_ID &ext_id)
 
- Public Member Functions inherited from ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >
 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 ()
 
int unbind_all ()
 Removes all the entries in the ACE_Hash_Map_Manager_Ex.
 
 ~ACE_Hash_Map_Manager_Ex ()
 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 () const
 
size_t total_size () const
 
ACE_LOCK & mutex ()
 
void dump () const
 Dump the state of an object.
 
iterator begin ()
 Return forward iterator.
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reverse_iterator rbegin ()
 Return reverse iterator.
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 

Additional Inherited Members

- Public Types inherited from ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >
typedef EXT_ID KEY
 
typedef INT_ID VALUE
 
typedef ACE_LOCK lock_type
 
typedef ACE_Hash_Map_Entry< EXT_ID, INT_IDENTRY
 
typedef ACE_Hash_Map_Iterator_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK > ITERATOR
 
typedef ACE_Hash_Map_Const_Iterator_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK > CONST_ITERATOR
 
typedef ACE_Hash_Map_Reverse_Iterator_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK > REVERSE_ITERATOR
 
typedef ACE_Hash_Map_Const_Reverse_Iterator_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK > CONST_REVERSE_ITERATOR
 
typedef ACE_Hash_Map_Iterator_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK > iterator
 
typedef ACE_Hash_Map_Const_Iterator_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK > const_iterator
 
typedef ACE_Hash_Map_Reverse_Iterator_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK > reverse_iterator
 
typedef ACE_Hash_Map_Const_Reverse_Iterator_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK > const_reverse_iterator
 
typedef EXT_ID key_type
 
typedef INT_ID data_type
 
typedef ACE_Hash_Map_Entry< EXT_ID, INT_IDvalue_type
 
typedef value_typereference
 
typedef value_type const & const_reference
 
typedef value_typepointer
 
typedef value_type const * const_pointer
 
typedef ptrdiff_t difference_type
 
typedef size_t size_type
 
- Public Attributes inherited from ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >
 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.
 
- Protected Member Functions inherited from ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >
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 ()
 
int unbind_all_i ()
 
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 ()
 Accessor of the underlying table.
 
- Protected Attributes inherited from ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_LOCK >
ACE_Allocatortable_allocator_
 
ACE_Allocatorentry_allocator_
 
ACE_LOCK lock_
 
ACE_Hash< EXT_IDhash_key_
 Function object used for hashing keys.
 
ACE_Equal_To< EXT_IDcompare_keys_
 Function object used for comparing keys.
 

Detailed Description

template<class EXT_ID, class INT_ID, class ACE_LOCK>
class ACE_Hash_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >

Wrapper for backward compatibility.

This implementation of a map uses a hash table. This class expects that the <EXT_ID> contains a method called <hash>. In addition, the <EXT_ID> must support <operator==>. Both of these constraints can be alleviated via template specialization, as shown in the $ACE_ROOT/tests/Conn_Test.cpp test.

Requirements and Performance Characteristics

Constructor & Destructor Documentation

◆ ACE_Hash_Map_Manager() [1/2]

template<class EXT_ID , class INT_ID , class ACE_LOCK >
ACE_Hash_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::ACE_Hash_Map_Manager ( ACE_Allocator * table_alloc = 0,
ACE_Allocator * entry_alloc = 0 )

Initialize a Hash_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_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_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_Map_Manager() [2/2]

template<class EXT_ID , class INT_ID , class ACE_LOCK >
ACE_Hash_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::ACE_Hash_Map_Manager ( size_t size,
ACE_Allocator * table_alloc = 0,
ACE_Allocator * entry_alloc = 0 )

Initialize a Hash_Map_Manager with size elements.

Parameters
table_allocis a pointer to a memory allocator used for table_, so it should supply size*sizeof (ACE_Hash_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_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.

Member Function Documentation

◆ equal()

template<class EXT_ID , class INT_ID , class ACE_LOCK >
int ACE_Hash_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::equal ( const EXT_ID & id1,
const EXT_ID & id2 )

◆ hash()

template<class EXT_ID , class INT_ID , class ACE_LOCK >
u_long ACE_Hash_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >::hash ( const EXT_ID & ext_id)

The documentation for this class was generated from the following files: