ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > Class Template Reference

Define a map abstraction that efficiently associates s with s. More...

#include <Hash_Map_Manager_T.h>

Collaboration diagram for ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >:

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_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 Member Functions

 ACE_Hash_Map_Manager_Ex (ACE_Allocator *table_alloc=0, ACE_Allocator *entry_alloc=0)
 ACE_Hash_Map_Manager_Ex (size_t size, ACE_Allocator *table_alloc=0, ACE_Allocator *entry_alloc=0)
int open (size_t size=ACE_DEFAULT_MAP_SIZE, ACE_Allocator *table_alloc=0, ACE_Allocator *entry_alloc=0)
int close (void)
int unbind_all (void)
 Removes all the entries in .

 ~ACE_Hash_Map_Manager_Ex (void)
 Cleanup the .

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 is in the mapping, otherwise -1.

int find (const EXT_ID &ext_id, ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&entry) 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)
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_Map_Iterator_Ex<
EXT_ID, INT_ID, HASH_KEY,
COMPARE_KEYS, ACE_LOCK > 
begin (void)
 Return forward iterator.

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.

ACE_Hash_Map_Reverse_Iterator_Ex<
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_Map_Entry< EXT_ID, INT_ID > *&entry)
 Performs bind. Must be called with locks held.

int trybind_i (const EXT_ID &ext_id, INT_ID &int_id)
 Performs trybind. Must be called with locks held.

int trybind_i (const EXT_ID &ext_id, INT_ID &int_id, ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&entry)
 Performs trybind. Must be called with locks held.

int rebind_i (const EXT_ID &ext_id, const INT_ID &int_id)
 Performs rebind. Must be called with locks held.

int rebind_i (const EXT_ID &ext_id, const INT_ID &int_id, ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&entry)
 Performs rebind. Must be called with locks held.

int rebind_i (const EXT_ID &ext_id, const INT_ID &int_id, INT_ID &old_int_id)
 Performs rebind. Must be called with locks held.

int rebind_i (const EXT_ID &ext_id, const INT_ID &int_id, INT_ID &old_int_id, ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&entry)
 Performs rebind. Must be called with locks held.

int rebind_i (const EXT_ID &ext_id, const INT_ID &int_id, EXT_ID &old_ext_id, INT_ID &old_int_id)
 Performs rebind. Must be called with locks held.

int rebind_i (const EXT_ID &ext_id, const INT_ID &int_id, EXT_ID &old_ext_id, INT_ID &old_int_id, ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&entry)
 Performs rebind. Must be called with locks held.

int find_i (const EXT_ID &ext_id, INT_ID &int_id)
int find_i (const EXT_ID &ext_id)
int find_i (const EXT_ID &ext_id, ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&entry)
int unbind_i (const EXT_ID &ext_id, INT_ID &int_id)
 Performs unbind. Must be called with locks held.

int unbind_i (const EXT_ID &ext_id)
 Performs unbind. Must be called with locks held.

int unbind_i (ACE_Hash_Map_Entry< EXT_ID, INT_ID > *entry)
 Performs unbind. Must be called with locks held.

int create_buckets (size_t size)
int close_i (void)
int unbind_all_i (void)
int shared_find (const EXT_ID &ext_id, ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&entry, size_t &loc)
 Returns the that corresponds to .

ACE_Hash_Map_Entry< EXT_ID,
INT_ID > * 
table (void)
 Accessor of the underlying table.

size_t cur_size (void) const
 Accessor of the current size attribute.


Protected Attributes

ACE_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_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > &)
 ACE_Hash_Map_Manager_Ex (const ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > &)

Private Attributes

ACE_Hash_Map_Entry< EXT_ID,
INT_ID > * 
table_
size_t total_size_
 Total size of the hash table.

size_t cur_size_

Friends

class ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >
class ACE_Hash_Map_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >
class ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >
class ACE_Hash_Map_Const_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >
class ACE_Hash_Map_Reverse_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >
class ACE_Hash_Map_Bucket_Iterator< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >

Detailed Description

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
class ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >

Define a map abstraction that efficiently associates s with s.

This implementation of a map uses a hash table. Key hashing is achieved through the HASH_KEY object and key comparison is achieved through the COMPARE_KEYS object. This class uses an ACE_Allocator to allocate memory. The user can make this a persistent class by providing an ACE_Allocator with a persistable memory pool.

Definition at line 120 of file Hash_Map_Manager_T.h.


Member Typedef Documentation

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
typedef ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::const_iterator
 

Definition at line 150 of file Hash_Map_Manager_T.h.

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
typedef ACE_Hash_Map_Const_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::CONST_ITERATOR
 

Definition at line 142 of file Hash_Map_Manager_T.h.

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
typedef ACE_Hash_Map_Entry<EXT_ID, INT_ID> ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ENTRY
 

Definition at line 136 of file Hash_Map_Manager_T.h.

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
typedef ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::iterator
 

Definition at line 148 of file Hash_Map_Manager_T.h.

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
typedef ACE_Hash_Map_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ITERATOR
 

Definition at line 140 of file Hash_Map_Manager_T.h.

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
typedef EXT_ID ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::KEY
 

Definition at line 131 of file Hash_Map_Manager_T.h.

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
typedef ACE_LOCK ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::lock_type
 

Definition at line 134 of file Hash_Map_Manager_T.h.

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
typedef ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::reverse_iterator
 

Definition at line 152 of file Hash_Map_Manager_T.h.

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
typedef ACE_Hash_Map_Reverse_Iterator_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::REVERSE_ITERATOR
 

Definition at line 144 of file Hash_Map_Manager_T.h.

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
typedef INT_ID ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::VALUE
 

Definition at line 133 of file Hash_Map_Manager_T.h.


Constructor & Destructor Documentation

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ACE_Hash_Map_Manager_Ex ACE_Allocator table_alloc = 0,
ACE_Allocator entry_alloc = 0
 

Initialize a Hash_Map_Manager_Ex with default size elements.

Parameters:
table_alloc is a pointer to a memory allocator used for table_, so it should supply size*sizeof (ACE_Hash_Map_Entry<EXT_ID, INT_ID>).
entry_alloc is a pointer to an additional allocator for entries, so it should be able to allocate 'size' / chunks of sizeof(ACE_Hash_Map_Entry<EXT_ID, INT_ID>) bytes each. If 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.

Definition at line 24 of file Hash_Map_Manager_T.inl.

References ACE_DEFAULT_MAP_SIZE, ACE_ERROR, ACE_LIB_TEXT, LM_ERROR, and ACE_Hash_Map_Manager_Ex< 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_LIB_TEXT ("ACE_Hash_Map_Manager_Ex\n")));
00034 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ACE_Hash_Map_Manager_Ex size_t  size,
ACE_Allocator table_alloc = 0,
ACE_Allocator entry_alloc = 0
 

Initialize a Hash_Map_Manager_Ex with size elements.

Parameters:
table_alloc is a pointer to a memory allocator used for table_, so it should supply size*sizeof (ACE_Hash_Map_Entry<EXT_ID, INT_ID>).
entry_alloc is a pointer to an additional allocator for entries, so it should be able to allocate 'size' / chunks of sizeof(ACE_Hash_Map_Entry<EXT_ID, INT_ID>) bytes each. If 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.

Definition at line 10 of file Hash_Map_Manager_T.inl.

References ACE_ERROR, ACE_LIB_TEXT, LM_ERROR, and ACE_Hash_Map_Manager_Ex< 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_LIB_TEXT ("ACE_Hash_Map_Manager_Ex\n")));
00021 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::~ACE_Hash_Map_Manager_Ex void   ) 
 

Cleanup the .

Definition at line 53 of file Hash_Map_Manager_T.inl.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close().

00054 {
00055   this->close ();
00056 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
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]
 


Member Function Documentation

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE ACE_Hash_Map_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::begin void   ) 
 

Return forward iterator.

Definition at line 357 of file Hash_Map_Manager_T.inl.

Referenced by ACE_Future_Set< T >::~ACE_Future_Set().

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind const EXT_ID &  ext_id,
const INT_ID &  int_id,
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&  entry
 

Same as a normal bind, except the map entry is also passed back to the caller. The entry in this case will either be the newly created entry, or the existing one.

Definition at line 109 of file Hash_Map_Manager_T.inl.

References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i().

00112 {
00113   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00114 
00115   return this->bind_i (ext_id, int_id, entry);
00116 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind const EXT_ID &  item,
const INT_ID &  int_id
 

Associate with . If is already in the map then the 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.

Definition at line 100 of file Hash_Map_Manager_T.inl.

References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i().

Referenced by ACE_Capabilities::fillent(), ACE_Filecache::finish(), ACE_Future_Set< T >::insert(), and ACE_Filecache::insert_i().

00102 {
00103   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00104 
00105   return this->bind_i (ext_id, int_id);
00106 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i const EXT_ID &  ext_id,
const INT_ID &  int_id,
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&  entry
[protected]
 

Performs bind. Must be called with locks held.

Definition at line 216 of file Hash_Map_Manager_T.cpp.

References ACE_ALLOCATOR_RETURN, ACE_Hash_Map_Entry< EXT_ID, INT_ID >::next_, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_.

00219 {
00220   size_t loc;
00221   int result = this->shared_find (ext_id, entry, loc);
00222 
00223   if (result == -1)
00224     {
00225       void *ptr;
00226       // Not found.
00227       ACE_ALLOCATOR_RETURN (ptr,
00228                             this->entry_allocator_->malloc (sizeof (ACE_Hash_Map_Entry<EXT_ID, INT_ID>)),
00229                             -1);
00230 
00231       entry = new (ptr) ACE_Hash_Map_Entry<EXT_ID, INT_ID> (ext_id,
00232                                                             int_id,
00233                                                             this->table_[loc].next_,
00234                                                             &this->table_[loc]);
00235       this->table_[loc].next_ = entry;
00236       entry->next_->prev_ = entry;
00237       this->cur_size_++;
00238       return 0;
00239     }
00240   else
00241     return 1;
00242 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i const EXT_ID &  ext_id,
const INT_ID &  int_id
[protected]
 

Performs bind. Must be called with locks held.

Definition at line 91 of file Hash_Map_Manager_T.inl.

Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().

00093 {
00094   ACE_Hash_Map_Entry<EXT_ID, INT_ID> *temp;
00095 
00096   return this->bind_i (ext_id, int_id, temp);
00097 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close void   ) 
 

Close down a and release dynamically allocated resources.

Definition at line 37 of file Hash_Map_Manager_T.inl.

References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close_i().

Referenced by ACE_Capabilities::resetcaps(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::~ACE_Hash_Map_Manager_Ex().

00038 {
00039   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00040 
00041   return this->close_i ();
00042 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close_i void   )  [protected]
 

Close down a . Must be called with locks held.

Definition at line 152 of file Hash_Map_Manager_T.cpp.

References ACE_DES_FREE_TEMPLATE2, ACE_NOOP, ACE_Allocator::free(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_allocator_, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_all_i().

Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::open().

00153 {
00154   // Protect against "double-deletion" in case the destructor also
00155   // gets called.
00156   if (this->table_ != 0)
00157     {
00158       // Remove all the entries.
00159       this->unbind_all_i ();
00160 
00161       // Iterate through the buckets cleaning up the sentinels.
00162       for (size_t i = 0; i < this->total_size_; i++)
00163         {
00164           // Destroy the dummy entry.
00165           ACE_Hash_Map_Entry<EXT_ID, INT_ID> *entry = &this->table_[i];
00166 
00167           // The second argument results in a no-op instead of
00168           // deallocation.
00169           ACE_DES_FREE_TEMPLATE2 (entry, ACE_NOOP,
00170                                   ACE_Hash_Map_Entry, EXT_ID, INT_ID);
00171         }
00172 
00173       // Reset size.
00174       this->total_size_ = 0;
00175 
00176       // Free table memory.
00177       this->table_allocator_->free (this->table_);
00178 
00179       // Should be done last...
00180       this->table_ = 0;
00181     }
00182 
00183   return 0;
00184 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::create_buckets size_t  size  )  [protected]
 

Resize the map. Must be called with locks held.

Note:
This method should never be called more than once or else all the hashing will get screwed up as the size will change.

Definition at line 98 of file Hash_Map_Manager_T.cpp.

References ACE_ALLOCATOR_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_.

Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::open().

00099 {
00100   size_t bytes = size * sizeof (ACE_Hash_Map_Entry<EXT_ID, INT_ID>);
00101   void *ptr;
00102 
00103   ACE_ALLOCATOR_RETURN (ptr,
00104                         this->table_allocator_->malloc (bytes),
00105                         -1);
00106 
00107   this->table_ = (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *) ptr;
00108 
00109   this->total_size_ = size;
00110 
00111   // Initialize each entry in the hash table to be a circular linked
00112   // list with the dummy node in the front serving as the anchor of
00113   // the list.
00114   for (size_t i = 0; i < size; i++)
00115     new (&this->table_[i]) ACE_Hash_Map_Entry<EXT_ID, INT_ID> (&this->table_[i],
00116                                                                &this->table_[i]);
00117   return 0;
00118 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE size_t ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::cur_size void   )  const [protected]
 

Accessor of the current size attribute.

Definition at line 392 of file Hash_Map_Manager_T.inl.

00393 {
00394   return this->cur_size_;
00395 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE size_t ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::current_size void   )  const
 

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

Definition at line 59 of file Hash_Map_Manager_T.inl.

00060 {
00061   return this->cur_size_;
00062 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
void ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::dump void   )  const
 

Dump the state of an object.

Definition at line 84 of file Hash_Map_Manager_T.cpp.

References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_LIB_TEXT, ACE_Allocator::dump(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::entry_allocator_, LM_DEBUG, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_allocator_.

00085 {
00086 #if defined (ACE_HAS_DUMP)
00087   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00088   ACE_DEBUG ((LM_DEBUG,  ACE_LIB_TEXT ("total_size_ = %d"), this->total_size_));
00089   ACE_DEBUG ((LM_DEBUG,  ACE_LIB_TEXT ("\ncur_size_ = %d"), this->cur_size_));
00090   this->table_allocator_->dump ();
00091   this->entry_allocator_->dump ();
00092   this->lock_.dump ();
00093   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00094 #endif /* ACE_HAS_DUMP */
00095 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE ACE_Hash_Map_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::end void   ) 
 

Definition at line 364 of file Hash_Map_Manager_T.inl.

Referenced by ACE_Future_Set< T >::~ACE_Future_Set().

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::equal const EXT_ID &  id1,
const EXT_ID &  id2
[protected]
 

Returns 1 if == , else 0. This is defined as a separate method to facilitate template specialization.

Reimplemented in ACE_Hash_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >.

Definition at line 84 of file Hash_Map_Manager_T.inl.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::compare_keys_.

Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find().

00086 {
00087   return this->compare_keys_ (id1, id2);
00088 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find const EXT_ID &  ext_id,
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&  entry
const
 

Locate and pass out parameter via . If found, return 0, returns -1 if not found.

Definition at line 241 of file Hash_Map_Manager_T.inl.

References ACE_READ_GUARD_RETURN, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find_i(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::lock_.

00243 {
00244   ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *nc_this =
00245     const_cast <ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *>
00246     (this);
00247 
00248   ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, nc_this->lock_, -1);
00249 
00250   return nc_this->find_i (ext_id, entry);
00251 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find const EXT_ID &  ext_id  )  const
 

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

Definition at line 221 of file Hash_Map_Manager_T.inl.

References ACE_READ_GUARD_RETURN, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find_i(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::lock_.

00222 {
00223   ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *nc_this =
00224     const_cast <ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *>
00225     (this);
00226 
00227   ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, nc_this->lock_, -1);
00228 
00229   return nc_this->find_i (ext_id);
00230 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find const EXT_ID &  ext_id,
INT_ID &  int_id
const
 

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

Definition at line 208 of file Hash_Map_Manager_T.inl.

References ACE_READ_GUARD_RETURN, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find_i(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::lock_.

Referenced by ACE_Filecache::fetch(), ACE_Filecache::find(), ACE_Capabilities::getval(), ACE_Filecache::insert_i(), ACE_Future_Set< T >::next_readable(), and ACE_Filecache::remove().

00210 {
00211   ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *nc_this =
00212     const_cast <ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK> *>
00213     (this);
00214 
00215   ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, nc_this->lock_, -1);
00216 
00217   return nc_this->find_i (ext_id, int_id);
00218 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find_i const EXT_ID &  ext_id,
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&  entry
[protected]
 

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

Definition at line 233 of file Hash_Map_Manager_T.inl.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find().

00235 {
00236   size_t dummy;
00237   return this->shared_find (ext_id, entry, dummy);
00238 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find_i const EXT_ID &  ext_id  )  [protected]
 

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

Definition at line 199 of file Hash_Map_Manager_T.inl.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find().

00200 {
00201   ACE_Hash_Map_Entry<EXT_ID, INT_ID> *entry;
00202 
00203   size_t dummy;
00204   return this->shared_find (ext_id, entry, dummy);
00205 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find_i const EXT_ID &  ext_id,
INT_ID &  int_id
[protected]
 

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

Definition at line 183 of file Hash_Map_Manager_T.inl.

References ACE_Hash_Map_Entry< EXT_ID, INT_ID >::int_id_, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find().

Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find().

00185 {
00186   ACE_Hash_Map_Entry<EXT_ID, INT_ID> *entry;
00187 
00188   size_t dummy;
00189   if (this->shared_find (ext_id, entry, dummy) == -1)
00190     return -1;
00191   else
00192     {
00193       int_id = entry->int_id_;
00194       return 0;
00195     }
00196 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE u_long ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::hash const EXT_ID &  ext_id  )  [protected]
 

Compute the hash value of the . This is defined as a separate method to facilitate template specialization.

Reimplemented in ACE_Hash_Map_Manager< EXT_ID, INT_ID, ACE_LOCK >.

Definition at line 78 of file Hash_Map_Manager_T.inl.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::hash_key_.

Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find().

00079 {
00080   return this->hash_key_ (ext_id);
00081 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE ACE_LOCK & ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::mutex void   ) 
 

Returns a reference to the underlying . 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 , but HP/C++ will choke on that!

Definition at line 71 of file Hash_Map_Manager_T.inl.

References ACE_TRACE.

00072 {
00073   ACE_TRACE ("ACE_Hash_Map_Manager_Ex::mutex");
00074   return this->lock_;
00075 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::open size_t  size = ACE_DEFAULT_MAP_SIZE,
ACE_Allocator table_alloc = 0,
ACE_Allocator entry_alloc = 0
 

Initialize a Hash_Map_Manager_Ex with size elements.

Parameters:
table_alloc is a pointer to a memory allocator used for table_, so it should supply size*sizeof (ACE_Hash_Map_Entry<EXT_ID, INT_ID>).
entry_alloc is a pointer to an additional allocator for entries, so it should be able to allocate 'size' / chunks of sizeof(ACE_Hash_Map_Entry<EXT_ID, INT_ID>) bytes each. If 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

Definition at line 121 of file Hash_Map_Manager_T.cpp.

References ACE_WRITE_GUARD_RETURN, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close_i(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::create_buckets(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::entry_allocator_, ACE_Allocator::instance(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_allocator_.

Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ACE_Hash_Map_Manager_Ex(), and ACE_Capabilities::resetcaps().

00124 {
00125   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00126 
00127   // Calling this->close_i () to ensure we release previous allocated
00128   // memory before allocating new one.
00129   this->close_i ();
00130 
00131   if (table_alloc == 0)
00132     table_alloc = ACE_Allocator::instance ();
00133 
00134   this->table_allocator_ = table_alloc;
00135 
00136   if (entry_alloc == 0)
00137     entry_alloc = table_alloc;
00138 
00139   this->entry_allocator_ = entry_alloc;
00140 
00141   // This assertion is here to help track a situation that shouldn't
00142   // happen, but did with Sun C++ 4.1 (before a change to this class
00143   // was made: it used to have an enum that was supposed to be defined
00144   // to be ACE_DEFAULT_MAP_SIZE, but instead was defined to be 0).
00145   if (size == 0)
00146     return -1;
00147 
00148   return this->create_buckets (size);
00149 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
void ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::operator= const ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > &   )  [private]
 

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE ACE_Hash_Map_Reverse_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rbegin void   ) 
 

Return reverse iterator.

Definition at line 371 of file Hash_Map_Manager_T.inl.

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind const EXT_ID &  ext_id,
const INT_ID &  int_id,
EXT_ID &  old_ext_id,
INT_ID &  old_int_id,
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&  entry
 

Same as a normal rebind, except the map entry is also passed back to the caller. The entry in this case will either be the newly created entry, or the existing one.

Definition at line 344 of file Hash_Map_Manager_T.inl.

References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().

00349 {
00350   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00351 
00352   return this->rebind_i (ext_id, int_id, old_ext_id, old_int_id, entry);
00353 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind const EXT_ID &  ext_id,
const INT_ID &  int_id,
EXT_ID &  old_ext_id,
INT_ID &  old_int_id
 

Associate with . If is not in the map then behaves just like . Otherwise, store the old values of and into the "out" parameters and rebind the new parameters. This is very useful if you need to have an atomic way of updating and you also need full control over memory allocation. Returns 0 if a new entry is bound successfully, returns 1 if an existing entry was rebound, and returns -1 if failures occur.

Definition at line 333 of file Hash_Map_Manager_T.inl.

References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().

00337 {
00338   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00339 
00340   return this->rebind_i (ext_id, int_id, old_ext_id, old_int_id);
00341 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind const EXT_ID &  ext_id,
const INT_ID &  int_id,
INT_ID &  old_int_id,
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&  entry
 

Same as a normal rebind, except the map entry is also passed back to the caller. The entry in this case will either be the newly created entry, or the existing one.

Definition at line 322 of file Hash_Map_Manager_T.inl.

References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().

00326 {
00327   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00328 
00329   return this->rebind_i (ext_id, int_id, old_int_id, entry);
00330 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind const EXT_ID &  ext_id,
const INT_ID &  int_id,
INT_ID &  old_int_id
 

Associate with . If is not in the map then behaves just like . Otherwise, store the old value of 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 312 of file Hash_Map_Manager_T.inl.

References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().

00315 {
00316   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00317 
00318   return this->rebind_i (ext_id, int_id, old_int_id);
00319 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind const EXT_ID &  ext_id,
const INT_ID &  int_id,
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&  entry
 

Same as a normal rebind, except the map entry is also passed back to the caller. The entry in this case will either be the newly created entry, or the existing one.

Definition at line 302 of file Hash_Map_Manager_T.inl.

References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().

00305 {
00306   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00307 
00308   return this->rebind_i (ext_id, int_id, entry);
00309 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind const EXT_ID &  ext_id,
const INT_ID &  int_id
 

Reassociate with . If is not in the map then behaves just like . 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 293 of file Hash_Map_Manager_T.inl.

References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().

00295 {
00296   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00297 
00298   return this->rebind_i (ext_id, int_id);
00299 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i const EXT_ID &  ext_id,
const INT_ID &  int_id,
EXT_ID &  old_ext_id,
INT_ID &  old_int_id,
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&  entry
[protected]
 

Performs rebind. Must be called with locks held.

Definition at line 366 of file Hash_Map_Manager_T.cpp.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i(), ACE_Hash_Map_Entry< EXT_ID, INT_ID >::ext_id_, ACE_Hash_Map_Entry< EXT_ID, INT_ID >::int_id_, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find().

00371 {
00372   size_t dummy;
00373   if (this->shared_find (ext_id, entry, dummy) == -1)
00374     return this->bind_i (ext_id, int_id);
00375   else
00376     {
00377       old_ext_id = entry->ext_id_;
00378       old_int_id = entry->int_id_;
00379       entry->ext_id_ = ext_id;
00380       entry->int_id_ = int_id;
00381       return 1;
00382     }
00383 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i const EXT_ID &  ext_id,
const INT_ID &  int_id,
EXT_ID &  old_ext_id,
INT_ID &  old_int_id
[protected]
 

Performs rebind. Must be called with locks held.

Definition at line 278 of file Hash_Map_Manager_T.inl.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().

00282 {
00283   ACE_Hash_Map_Entry<EXT_ID, INT_ID> *node;
00284 
00285   return this->rebind_i (ext_id,
00286                          int_id,
00287                          old_ext_id,
00288                          old_int_id,
00289                          node);
00290 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i const EXT_ID &  ext_id,
const INT_ID &  int_id,
INT_ID &  old_int_id,
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&  entry
[protected]
 

Performs rebind. Must be called with locks held.

Definition at line 348 of file Hash_Map_Manager_T.cpp.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i(), ACE_Hash_Map_Entry< EXT_ID, INT_ID >::ext_id_, ACE_Hash_Map_Entry< EXT_ID, INT_ID >::int_id_, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find().

00352 {
00353   size_t dummy;
00354   if (this->shared_find (ext_id, entry, dummy) == -1)
00355     return this->bind_i (ext_id, int_id);
00356   else
00357     {
00358       old_int_id = entry->int_id_;
00359       entry->ext_id_ = ext_id;
00360       entry->int_id_ = int_id;
00361       return 1;
00362     }
00363 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i const EXT_ID &  ext_id,
const INT_ID &  int_id,
INT_ID &  old_int_id
[protected]
 

Performs rebind. Must be called with locks held.

Definition at line 265 of file Hash_Map_Manager_T.inl.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().

00268 {
00269   ACE_Hash_Map_Entry<EXT_ID, INT_ID> *node;
00270 
00271   return this->rebind_i (ext_id,
00272                          int_id,
00273                          old_int_id,
00274                          node);
00275 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i const EXT_ID &  ext_id,
const INT_ID &  int_id,
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&  entry
[protected]
 

Performs rebind. Must be called with locks held.

Definition at line 332 of file Hash_Map_Manager_T.cpp.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i(), ACE_Hash_Map_Entry< EXT_ID, INT_ID >::ext_id_, ACE_Hash_Map_Entry< EXT_ID, INT_ID >::int_id_, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find().

00335 {
00336   size_t dummy;
00337   if (this->shared_find (ext_id, entry, dummy) == -1)
00338     return this->bind_i (ext_id, int_id);
00339   else
00340     {
00341       entry->ext_id_ = ext_id;
00342       entry->int_id_ = int_id;
00343       return 1;
00344     }
00345 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i const EXT_ID &  ext_id,
const INT_ID &  int_id
[protected]
 

Performs rebind. Must be called with locks held.

Definition at line 254 of file Hash_Map_Manager_T.inl.

Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i().

00256 {
00257   ACE_Hash_Map_Entry<EXT_ID, INT_ID> *node;
00258 
00259   return this->rebind_i (ext_id,
00260                          int_id,
00261                          node);
00262 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE ACE_Hash_Map_Reverse_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rend void   ) 
 

Definition at line 378 of file Hash_Map_Manager_T.inl.

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find const EXT_ID &  ext_id,
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&  entry,
size_t &  loc
[protected]
 

Returns the that corresponds to .

Definition at line 308 of file Hash_Map_Manager_T.cpp.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::equal(), ACE_Hash_Map_Entry< EXT_ID, INT_ID >::ext_id_, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::hash(), ACE_Hash_Map_Entry< EXT_ID, INT_ID >::next_, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_.

Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find_i(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::rebind_i(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::trybind_i(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i().

00311 {
00312   loc = this->hash (ext_id) % this->total_size_;
00313 
00314   ACE_Hash_Map_Entry<EXT_ID, INT_ID> *temp = this->table_[loc].next_;
00315 
00316   while (temp != &this->table_[loc] && this->equal (temp->ext_id_, ext_id) == 0)
00317     temp = temp->next_;
00318 
00319   if (temp == &this->table_[loc])
00320     {
00321       errno = ENOENT;
00322       return -1;
00323     }
00324   else
00325     {
00326       entry = temp;
00327       return 0;
00328     }
00329 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE ACE_Hash_Map_Entry< EXT_ID, INT_ID > * ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table void   )  [protected]
 

Accessor of the underlying table.

Definition at line 385 of file Hash_Map_Manager_T.inl.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_.

00386 {
00387   return this->table_;
00388 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE size_t ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::total_size void   )  const
 

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

Definition at line 65 of file Hash_Map_Manager_T.inl.

00066 {
00067   return this->total_size_;
00068 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::trybind const EXT_ID &  ext_id,
INT_ID &  int_id,
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&  entry
 

Same as a normal trybind, except the map entry is also passed back to the caller. The entry in this case will either be the newly created entry, or the existing one.

Definition at line 140 of file Hash_Map_Manager_T.inl.

References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::trybind_i().

00143 {
00144   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00145 
00146   return this->trybind_i (ext_id, int_id, entry);
00147 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::trybind const EXT_ID &  ext_id,
INT_ID &  int_id
 

Associate with if and only if is not in the map. If is already in the map then the 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 131 of file Hash_Map_Manager_T.inl.

References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::trybind_i().

00133 {
00134   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00135 
00136   return this->trybind_i (ext_id, int_id);
00137 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::trybind_i const EXT_ID &  ext_id,
INT_ID &  int_id,
ACE_Hash_Map_Entry< EXT_ID, INT_ID > *&  entry
[protected]
 

Performs trybind. Must be called with locks held.

Definition at line 245 of file Hash_Map_Manager_T.cpp.

References ACE_ALLOCATOR_RETURN, ACE_Hash_Map_Entry< EXT_ID, INT_ID >::next_, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_.

00248 {
00249   size_t loc;
00250   int result = this->shared_find (ext_id, entry, loc);
00251 
00252   if (result == -1)
00253     {
00254       // Not found.
00255       void *ptr;
00256       ACE_ALLOCATOR_RETURN (ptr,
00257                             this->entry_allocator_->malloc (sizeof (ACE_Hash_Map_Entry<EXT_ID, INT_ID>)),
00258                             -1);
00259 
00260       entry = new (ptr) ACE_Hash_Map_Entry<EXT_ID, INT_ID> (ext_id,
00261                                                             int_id,
00262                                                             this->table_[loc].next_,
00263                                                             &this->table_[loc]);
00264       this->table_[loc].next_ = entry;
00265       entry->next_->prev_ = entry;
00266       this->cur_size_++;
00267       return 0;
00268     }
00269   else
00270     return 1;
00271 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::trybind_i const EXT_ID &  ext_id,
INT_ID &  int_id
[protected]
 

Performs trybind. Must be called with locks held.

Definition at line 119 of file Hash_Map_Manager_T.inl.

References ACE_Hash_Map_Entry< EXT_ID, INT_ID >::int_id_.

Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::trybind().

00121 {
00122   ACE_Hash_Map_Entry<EXT_ID, INT_ID> *temp;
00123 
00124   int result = this->trybind_i (ext_id, int_id, temp);
00125   if (result == 1)
00126     int_id = temp->int_id_;
00127   return result;
00128 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind ACE_Hash_Map_Entry< EXT_ID, INT_ID > *  entry  ) 
 

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

Definition at line 175 of file Hash_Map_Manager_T.inl.

References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i().

00176 {
00177   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00178 
00179   return this->unbind_i (entry) == -1 ? -1 : 0;
00180 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind const EXT_ID &  ext_id,
INT_ID &  int_id
 

Break any association of . Returns the value of in case the caller needs to deallocate memory. Return 0 if the unbind was successfully, and returns -1 if failures occur.

Definition at line 158 of file Hash_Map_Manager_T.inl.

References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i().

00160 {
00161   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00162 
00163   return this->unbind_i (ext_id, int_id);
00164 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind const EXT_ID &  ext_id  ) 
 

Unbind (remove) the from the map. Don't return the to the caller (this is useful for collections where the s are *not* dynamically allocated...)

Definition at line 167 of file Hash_Map_Manager_T.inl.

References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i().

Referenced by ACE_Future_Set< T >::next_readable(), ACE_Cached_Connect_Strategy< SVC_HANDLER, ACE_PEER_CONNECTOR_2, MUTEX >::purge_i(), and ACE_Filecache::remove_i().

00168 {
00169   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00170 
00171   return this->unbind_i (ext_id) == -1 ? -1 : 0;
00172 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_all void   ) 
 

Removes all the entries in .

Definition at line 45 of file Hash_Map_Manager_T.inl.

References ACE_WRITE_GUARD_RETURN, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_all_i().

00046 {
00047   ACE_WRITE_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, -1);
00048 
00049   return this->unbind_all_i ();
00050 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_all_i void   )  [protected]
 

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

Definition at line 187 of file Hash_Map_Manager_T.cpp.

References ACE_DES_FREE_TEMPLATE2, ACE_Hash_Map_Entry< EXT_ID, INT_ID >::next_, ACE_Hash_Map_Entry< EXT_ID, INT_ID >::prev_, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_.

Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close_i(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_all().

00188 {
00189   // Iterate through the entire map calling the destuctor of each
00190   // <ACE_Hash_Map_Entry>.
00191   for (size_t i = 0; i < this->total_size_; i++)
00192     {
00193       for (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *temp_ptr = this->table_[i].next_;
00194            temp_ptr != &this->table_[i];
00195            )
00196         {
00197           ACE_Hash_Map_Entry<EXT_ID, INT_ID> *hold_ptr = temp_ptr;
00198           temp_ptr = temp_ptr->next_;
00199 
00200           // Explicitly call the destructor.
00201           ACE_DES_FREE_TEMPLATE2 (hold_ptr, this->entry_allocator_->free,
00202                                   ACE_Hash_Map_Entry, EXT_ID, INT_ID);
00203         }
00204 
00205       // Restore the sentinel.
00206       this->table_[i].next_ = &this->table_[i];
00207       this->table_[i].prev_ = &this->table_[i];
00208     }
00209 
00210   this->cur_size_ = 0;
00211 
00212   return 0;
00213 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i ACE_Hash_Map_Entry< EXT_ID, INT_ID > *  entry  )  [protected]
 

Performs unbind. Must be called with locks held.

Definition at line 294 of file Hash_Map_Manager_T.cpp.

References ACE_DES_FREE_TEMPLATE2, ACE_Hash_Map_Entry< EXT_ID, INT_ID >::next_, and ACE_Hash_Map_Entry< EXT_ID, INT_ID >::prev_.

00295 {
00296   entry->next_->prev_ = entry->prev_;
00297   entry->prev_->next_ = entry->next_;
00298 
00299   // Explicitly call the destructor.
00300   ACE_DES_FREE_TEMPLATE2 (entry, this->entry_allocator_->free,
00301                           ACE_Hash_Map_Entry, EXT_ID, INT_ID);
00302 
00303   this->cur_size_--;
00304   return 0;
00305 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_INLINE int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i const EXT_ID &  ext_id  )  [protected]
 

Performs unbind. Must be called with locks held.

Definition at line 150 of file Hash_Map_Manager_T.inl.

References ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i().

00151 {
00152   INT_ID int_id;
00153 
00154   return this->unbind_i (ext_id, int_id);
00155 }

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
int ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i const EXT_ID &  ext_id,
INT_ID &  int_id
[protected]
 

Performs unbind. Must be called with locks held.

Definition at line 274 of file Hash_Map_Manager_T.cpp.

References ACE_Hash_Map_Entry< EXT_ID, INT_ID >::int_id_, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find().

Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_i().

00276 {
00277   ACE_Hash_Map_Entry<EXT_ID, INT_ID> *temp;
00278 
00279   size_t loc;
00280   int result = this->shared_find (ext_id, temp, loc);
00281 
00282   if (result == -1)
00283     {
00284       errno = ENOENT;
00285       return -1;
00286     }
00287 
00288   int_id = temp->int_id_;
00289 
00290   return this->unbind_i (temp);
00291 }


Friends And Related Function Documentation

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
friend class ACE_Hash_Map_Bucket_Iterator< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > [friend]
 

Definition at line 128 of file Hash_Map_Manager_T.h.

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
friend class ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > [friend]
 

Definition at line 125 of file Hash_Map_Manager_T.h.

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
friend class ACE_Hash_Map_Const_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > [friend]
 

Definition at line 126 of file Hash_Map_Manager_T.h.

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
friend class ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > [friend]
 

Definition at line 123 of file Hash_Map_Manager_T.h.

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
friend class ACE_Hash_Map_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > [friend]
 

Definition at line 124 of file Hash_Map_Manager_T.h.

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
friend class ACE_Hash_Map_Reverse_Iterator_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK > [friend]
 

Definition at line 127 of file Hash_Map_Manager_T.h.


Member Data Documentation

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
COMPARE_KEYS ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::compare_keys_ [protected]
 

Function object used for comparing keys.

Definition at line 495 of file Hash_Map_Manager_T.h.

Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::equal().

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
size_t ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::cur_size_ [private]
 

Current number of entries in the table

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

Definition at line 523 of file Hash_Map_Manager_T.h.

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_Allocator* ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::entry_allocator_ [protected]
 

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

Definition at line 485 of file Hash_Map_Manager_T.h.

Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::dump(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::open().

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
HASH_KEY ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::hash_key_ [protected]
 

Function object used for hashing keys.

Definition at line 492 of file Hash_Map_Manager_T.h.

Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::hash().

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_LOCK ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::lock_ [protected]
 

Synchronization variable for the MT_SAFE ACE_Hash_Map_Manager_Ex.

Definition at line 489 of file Hash_Map_Manager_T.h.

Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::find().

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_Hash_Map_Entry<EXT_ID, INT_ID>* ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_ [private]
 

Array of *s, each of which points to an that serves as the beginning of a linked list of s that hash to that bucket.

Definition at line 515 of file Hash_Map_Manager_T.h.

Referenced by ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ACE_Hash_Map_Const_Iterator_Base_Ex(), ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ACE_Hash_Map_Iterator_Base_Ex(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::bind_i(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close_i(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::create_buckets(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::shared_find(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::trybind_i(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::unbind_all_i().

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
ACE_Allocator* ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::table_allocator_ [protected]
 

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

Definition at line 480 of file Hash_Map_Manager_T.h.

Referenced by ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::close_i(), ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::dump(), and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::open().

template<class EXT_ID, class INT_ID, class HASH_KEY, class COMPARE_KEYS, class ACE_LOCK>
size_t ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::total_size_ [private]
 

Total size of the hash table.

Definition at line 518 of file Hash_Map_Manager_T.h.

Referenced by ACE_Hash_Map_Const_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ACE_Hash_Map_Const_Iterator_Base_Ex(), and ACE_Hash_Map_Iterator_Base_Ex< EXT_ID, INT_ID, HASH_KEY, COMPARE_KEYS, ACE_LOCK >::ACE_Hash_Map_Iterator_Base_Ex().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:23:08 2006 for ACE by doxygen 1.3.6