ACE_Hash_Map_With_Allocator< EXT_ID, INT_ID > Class Template Reference

This class is a thin wrapper around ACE_Hash_Map_Manager, which comes handy when ACE_Hash_Map_Manager is to be used with a non-nil ACE_Allocator. This wrapper insures that the appropriate allocator is in place for every operation that accesses or updates the hash map. More...

#include <Hash_Map_With_Allocator_T.h>

Inheritance diagram for ACE_Hash_Map_With_Allocator< EXT_ID, INT_ID >:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ACE_Hash_Map_With_Allocator (ACE_Allocator *alloc)
 Constructor.

 ACE_Hash_Map_With_Allocator (size_t size, ACE_Allocator *alloc)
 Constructor that specifies hash table size.

int bind (const EXT_ID &, const INT_ID &, ACE_Allocator *alloc)
int unbind (const EXT_ID &, INT_ID &, ACE_Allocator *alloc)
int unbind (const EXT_ID &, ACE_Allocator *alloc)
int rebind (const EXT_ID &, const INT_ID &, EXT_ID &, INT_ID &, ACE_Allocator *alloc)
int find (const EXT_ID &, INT_ID &, ACE_Allocator *alloc)
int find (const EXT_ID &ext_id, ACE_Allocator *alloc)
 Returns 0 if the ext_id is in the mapping, otherwise -1.

int close (ACE_Allocator *alloc)

Detailed Description

template<class EXT_ID, class INT_ID>
class ACE_Hash_Map_With_Allocator< EXT_ID, INT_ID >

This class is a thin wrapper around ACE_Hash_Map_Manager, which comes handy when ACE_Hash_Map_Manager is to be used with a non-nil ACE_Allocator. This wrapper insures that the appropriate allocator is in place for every operation that accesses or updates the hash map.

If we use ACE_Hash_Map_Manager with a shared memory allocator (or memory-mapped file allocator, for example), the allocator pointer used by ACE_Hash_Map_Manager gets stored with it, in shared memory (or memory-mapped file). Naturally, this will cause horrible problems, since only the first process to set that pointer will be guaranteed the address of the allocator is meaningful! That is why we need this wrapper, which insures that appropriate allocator pointer is in place for each call.

At some point it would be a good idea to update this class to use the new "two allocator" technique provided by ACE_Hash_Map_Manager_Ex.

Definition at line 51 of file Hash_Map_With_Allocator_T.h.


Constructor & Destructor Documentation

template<class EXT_ID, class INT_ID>
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Hash_Map_With_Allocator< EXT_ID, INT_ID >::ACE_Hash_Map_With_Allocator ACE_Allocator alloc  ) 
 

Constructor.

Definition at line 19 of file Hash_Map_With_Allocator_T.cpp.

References ACE_TRACE.

00020   : ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_Null_Mutex> (alloc)
00021 {
00022   ACE_TRACE ("ACE_Hash_Map_With_Allocator<EXT_ID, INT_ID>::ACE_Hash_Map_With_Allocator");
00023 }

template<class EXT_ID, class INT_ID>
ACE_Hash_Map_With_Allocator< EXT_ID, INT_ID >::ACE_Hash_Map_With_Allocator size_t  size,
ACE_Allocator alloc
 

Constructor that specifies hash table size.

Definition at line 26 of file Hash_Map_With_Allocator_T.cpp.

References ACE_TRACE.

00028   : ACE_Hash_Map_Manager_Ex<EXT_ID, INT_ID, ACE_Hash<EXT_ID>, ACE_Equal_To<EXT_ID>, ACE_Null_Mutex> (size, alloc)
00029 {
00030   ACE_TRACE ("ACE_Hash_Map_With_Allocator<EXT_ID, INT_ID>::ACE_Hash_Map_With_Allocator");
00031 }


Member Function Documentation

template<class EXT_ID, class INT_ID>
ACE_INLINE int ACE_Hash_Map_With_Allocator< EXT_ID, INT_ID >::bind const EXT_ID &  ,
const INT_ID &  ,
ACE_Allocator alloc
 

Definition at line 17 of file Hash_Map_With_Allocator_T.inl.

References ACE_TRACE, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_Null_Mutex >::bind_i().

Referenced by ACE_Configuration_Heap::add_section(), ACE_Configuration_Heap::new_section(), ACE_Configuration_Heap::set_binary_value(), ACE_Configuration_Heap::set_integer_value(), and ACE_Configuration_Heap::set_string_value().

00020 {
00021   ACE_TRACE ("ACE_Hash_Map_With_Allocator<EXT_ID, INT_ID>::bind");
00022   this->table_allocator_ = alloc;
00023   this->entry_allocator_ = alloc;
00024   return this->bind_i (ext_id, int_id);
00025 }

template<class EXT_ID, class INT_ID>
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int ACE_Hash_Map_With_Allocator< EXT_ID, INT_ID >::close ACE_Allocator alloc  ) 
 

Definition at line 8 of file Hash_Map_With_Allocator_T.inl.

References ACE_TRACE, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_Null_Mutex >::close_i().

00009 {
00010   ACE_TRACE ("ACE_Hash_Map_With_Allocator<EXT_ID, INT_ID>::close");
00011   this->table_allocator_ = alloc;
00012   this->entry_allocator_ = alloc;
00013   return this->close_i ();
00014 }

template<class EXT_ID, class INT_ID>
ACE_INLINE int ACE_Hash_Map_With_Allocator< EXT_ID, INT_ID >::find const EXT_ID &  ext_id,
ACE_Allocator alloc
 

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

Definition at line 73 of file Hash_Map_With_Allocator_T.inl.

References ACE_TRACE, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_Null_Mutex >::find_i().

00075 {
00076   ACE_TRACE ("ACE_Hash_Map_With_Allocator<EXT_ID, INT_ID>::find");
00077   this->table_allocator_ = alloc;
00078   this->entry_allocator_ = alloc;
00079   return this->find_i (ext_id);
00080 }

template<class EXT_ID, class INT_ID>
ACE_INLINE int ACE_Hash_Map_With_Allocator< EXT_ID, INT_ID >::find const EXT_ID &  ,
INT_ID &  ,
ACE_Allocator alloc
 

Definition at line 62 of file Hash_Map_With_Allocator_T.inl.

References ACE_TRACE, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_Null_Mutex >::find_i().

Referenced by ACE_Configuration_Heap::add_section(), ACE_Configuration_Heap::enumerate_sections(), ACE_Configuration_Heap::enumerate_values(), ACE_Configuration_Heap::find_value(), ACE_Configuration_Heap::get_binary_value(), ACE_Configuration_Heap::get_integer_value(), ACE_Configuration_Heap::get_string_value(), ACE_Configuration_Heap::open_simple_section(), ACE_Configuration_Heap::remove_section(), ACE_Configuration_Heap::remove_value(), ACE_Configuration_Heap::set_binary_value(), ACE_Configuration_Heap::set_integer_value(), and ACE_Configuration_Heap::set_string_value().

00065 {
00066   ACE_TRACE ("ACE_Hash_Map_With_Allocator<EXT_ID, INT_ID>::find");
00067   this->table_allocator_ = alloc;
00068   this->entry_allocator_ = alloc;
00069   return this->find_i (ext_id, int_id);
00070 }

template<class EXT_ID, class INT_ID>
ACE_INLINE int ACE_Hash_Map_With_Allocator< EXT_ID, INT_ID >::rebind const EXT_ID &  ,
const INT_ID &  ,
EXT_ID &  ,
INT_ID &  ,
ACE_Allocator alloc
 

Definition at line 49 of file Hash_Map_With_Allocator_T.inl.

References ACE_TRACE, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_Null_Mutex >::rebind_i().

00054 {
00055   ACE_TRACE ("ACE_Hash_Map_With_Allocator<EXT_ID, INT_ID>::rebind");
00056   this->table_allocator_ = alloc;
00057   this->entry_allocator_ = alloc;
00058   return this->rebind_i (ext_id, int_id, old_ext_id, old_int_id);
00059 }

template<class EXT_ID, class INT_ID>
ACE_INLINE int ACE_Hash_Map_With_Allocator< EXT_ID, INT_ID >::unbind const EXT_ID &  ,
ACE_Allocator alloc
 

Definition at line 39 of file Hash_Map_With_Allocator_T.inl.

References ACE_TRACE, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_Null_Mutex >::unbind_i().

00041 {
00042   ACE_TRACE ("ACE_Hash_Map_With_Allocator<EXT_ID>::unbind");
00043   this->table_allocator_ = alloc;
00044   this->entry_allocator_ = alloc;
00045   return this->unbind_i (ext_id);
00046 }

template<class EXT_ID, class INT_ID>
ACE_INLINE int ACE_Hash_Map_With_Allocator< EXT_ID, INT_ID >::unbind const EXT_ID &  ,
INT_ID &  ,
ACE_Allocator alloc
 

Definition at line 28 of file Hash_Map_With_Allocator_T.inl.

References ACE_TRACE, and ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_Null_Mutex >::unbind_i().

Referenced by ACE_Configuration_Heap::remove_section(), and ACE_Configuration_Heap::remove_value().

00031 {
00032   ACE_TRACE ("ACE_Hash_Map_With_Allocator<EXT_ID, INT_ID>::unbind");
00033   this->table_allocator_ = alloc;
00034   this->entry_allocator_ = alloc;
00035   return this->unbind_i (ext_id, int_id);
00036 }


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