Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Hash_Map_With_Allocator 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:

Inheritance graph
[legend]
Collaboration diagram for ACE_Hash_Map_With_Allocator:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_Hash_Map_With_Allocator (ACE_Allocator *alloc)
 Constructor. More...

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

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 &, ACE_Allocator *alloc)
 Returns 0 if the <ext_id> is in the mapping, otherwise -1. More...

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.

Definition at line 44 of file Hash_Map_With_Allocator_T.h.


Constructor & Destructor Documentation

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

Constructor.

Definition at line 18 of file Hash_Map_With_Allocator_T.cpp.

References ACE_TRACE.

00019   : ACE_Hash_Map_Manager<EXT_ID, INT_ID, ACE_Null_Mutex> (alloc)
00020 {
00021   ACE_TRACE ("ACE_Hash_Map_With_Allocator<EXT_ID, INT_ID>::ACE_Hash_Map_With_Allocator");
00022 }

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 25 of file Hash_Map_With_Allocator_T.cpp.

References ACE_TRACE.

00027   : ACE_Hash_Map_Manager<EXT_ID, INT_ID, ACE_Null_Mutex> (size, alloc)
00028 {
00029   ACE_TRACE ("ACE_Hash_Map_With_Allocator<EXT_ID, INT_ID>::ACE_Hash_Map_With_Allocator");
00030 }


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 16 of file Hash_Map_With_Allocator_T.i.

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

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

template<class EXT_ID, class INT_ID>
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.i.

References ACE_TRACE, ACE_Hash_Map_Manager_Ex< EXT_ID, INT_ID, ACE_Hash< EXT_ID >, ACE_Equal_To< EXT_ID >, ACE_Null_Mutex >::allocator_, 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->allocator_ = alloc;
00012   return this->close_i ();
00013 }

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

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

Definition at line 67 of file Hash_Map_With_Allocator_T.i.

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

00069 {
00070   ACE_TRACE ("ACE_Hash_Map_With_Allocator<EXT_ID, INT_ID>::find");
00071   this->allocator_ = alloc;
00072   return this->find_i (ext_id);
00073 }

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 57 of file Hash_Map_With_Allocator_T.i.

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

00060 {
00061   ACE_TRACE ("ACE_Hash_Map_With_Allocator<EXT_ID, INT_ID>::find");
00062   this->allocator_ = alloc;
00063   return this->find_i (ext_id, int_id);
00064 }

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 45 of file Hash_Map_With_Allocator_T.i.

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

00050 {
00051   ACE_TRACE ("ACE_Hash_Map_With_Allocator<EXT_ID, INT_ID>::rebind");
00052   this->allocator_ = alloc;
00053   return this->rebind_i (ext_id, int_id, old_ext_id, old_int_id);
00054 }

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 36 of file Hash_Map_With_Allocator_T.i.

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

00038 {
00039   ACE_TRACE ("ACE_Hash_Map_With_Allocator<EXT_ID>::unbind");
00040   this->allocator_ = alloc;
00041   return this->unbind_i (ext_id);
00042 }

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 26 of file Hash_Map_With_Allocator_T.i.

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

00029 {
00030   ACE_TRACE ("ACE_Hash_Map_With_Allocator<EXT_ID, INT_ID>::unbind");
00031   this->allocator_ = alloc;
00032   return this->unbind_i (ext_id, int_id);
00033 }


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:48:57 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002