NAME

ACE_Name_Space_Map - This class serves as a Proxy that ensures our process always has the appropriate allocator in place for every operation that accesses or updates the Map Manager.

SYNOPSIS


#include <ACE/ACE_Local_Name_Space_T.h>


template<class ALLOCATOR>
class ACE_Name_Space_Map : public MAP_MANAGER
{
  public:
    ACE_Name_Space_Map (ALLOCATOR *allocator);
    int bind (
        const ACE_NS_String &,
        const ACE_NS_Internal &,
        ALLOCATOR *allocator
        );
    int unbind (
        const ACE_NS_String &,
        ACE_NS_Internal &,
        ALLOCATOR *allocator
        );
    int rebind (
        const ACE_NS_String &,
        const ACE_NS_Internal &,
        ACE_NS_String &,
        ACE_NS_Internal &,
        ALLOCATOR *allocator
        );
    int find (
        const ACE_NS_String &,
        ACE_NS_Internal &,
        ALLOCATOR *allocator
        );
    int close (ALLOCATOR* allocator);
  private:
    int remap (EXCEPTION_POINTERS *ep, ALLOCATOR *allocator);
};

DESCRIPTION

We need this class because otherwise the SHARED_MALLOC pointer will be stored in the Map_Manager that resides within shared memory. Naturally, this will cause horrible problems since only the first process to set that pointer will be guaranteed the address of the SHARED_MALLOC allocator is meaningful!

The following methods are Proxies to the underlying methods

provided by ACE_Map_Manager. When they are called, they acquire the lock, set the allocator to the one specific to this process, and then call down to perform the intended operation.
int bind (
    const ACE_NS_String &,
    const ACE_NS_Internal &,
    ALLOCATOR *allocator
    );
int unbind (
    const ACE_NS_String &,
    ACE_NS_Internal &,
    ALLOCATOR *allocator
    );
int rebind (
    const ACE_NS_String &,
    const ACE_NS_Internal &,
    ACE_NS_String &,
    ACE_NS_Internal &,
    ALLOCATOR *allocator
    );
int find (
    const ACE_NS_String &,
    ACE_NS_Internal &,
    ALLOCATOR *allocator
    );
int close (ALLOCATOR* allocator);

AUTHOR

Prashant Jain (pjain@cs.wustl.edu), Irfan Pyarali (irfan@wuerl.wustl.edu), and Douglas C. Schmidt (schmidt@cs.wustl.edu).

LIBRARY

ACE