---
name: "ACE_Local_Name_Space"
section: "3"
platform: "linux"
package: "libace-doc"
version: "5.0.7-4"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/ACE_Local_Name_Space"
---

# ACE\_Local\_Name\_Space(3)

Maintaining accesses Local Name Server Database. Allows to add NameBindings, change them, remove them and resolve NameBindings.

## NAME

ACE\_Local\_Name\_Space -  Maintaining accesses Local Name Server Database.  Allows to add NameBindings, change them, remove them and resolve NameBindings.

## SYNOPSIS

```
#include <ACE/Local_Name_Space_T.h>
template<ACE_MEM_POOL_1, class ACE_LOCK>
class ACE_Local_Name_Space : public ACE_Name_Space
{
  public:
    ACE_Local_Name_Space (void);
    ACE_Local_Name_Space (
        ACE_Naming_Context::Context_Scope_Type scope_in,
        ACE_Name_Options *name_options
        );
    int open (ACE_Naming_Context::Context_Scope_Type scope_in);
    ~ACE_Local_Name_Space (void);
    virtual int bind (
        const ACE_WString &name,
        const ACE_WString &value,
        const char *type = ""
        );
    virtual int rebind (
        const ACE_WString &name,
        const ACE_WString &value,
        const char *type = ""
        );
    virtual int unbind (const ACE_WString &name);
    virtual int unbind_i (const ACE_WString &name);
    virtual int resolve (
        const ACE_WString &name,
        ACE_WString &value,
        char *&type
        );
    virtual int resolve_i (
        const ACE_WString &name,
        ACE_WString &value,
        char *&type
        );
    virtual int list_names (
        ACE_WSTRING_SET &set,
        const ACE_WString &pattern
        );
    virtual int list_names_i (
        ACE_WSTRING_SET &set,
        const ACE_WString &pattern
        );
    virtual int list_values (
        ACE_WSTRING_SET &set,
        const ACE_WString &pattern
        );
    virtual int list_values_i (
        ACE_WSTRING_SET &set,
        const ACE_WString &pattern
        );
    virtual int list_types (
        ACE_WSTRING_SET &set,
        const ACE_WString &pattern
        );
    virtual int list_types_i (
        ACE_WSTRING_SET &set,
        const ACE_WString &pattern
        );
    virtual int list_name_entries (
        ACE_BINDING_SET &set,
        const ACE_WString &pattern
        );
    virtual int list_name_entries_i (
        ACE_BINDING_SET &set,
        const ACE_WString &pattern
        );
    virtual int list_value_entries (
        ACE_BINDING_SET &set,
        const ACE_WString &pattern
        );
    virtual int list_value_entries_i (
        ACE_BINDING_SET &set,
        const ACE_WString &pattern
        );
    virtual int list_type_entries (
        ACE_BINDING_SET &set,
        const ACE_WString &pattern
        );
    virtual int list_type_entries_i (
        ACE_BINDING_SET &set,
        const ACE_WString &pattern
        );
    virtual void dump (void) const;
    virtual void dump_i (void) const;
        typedef ACE_Allocator_Adapter <ACE_Malloc <ACE_MEM_POOL_2, ACE_LOCK> >  ALLOCATOR;

  private:
    int remap (EXCEPTION_POINTERS *ep);
    int shared_bind (
        const ACE_WString &name,
        const ACE_WString &value,
        const char *type,
        int rebind
        );
    int shared_bind_i (
        const ACE_WString &name,
        const ACE_WString &value,
        const char *type,
        int rebind
        );
    int create_manager (void);
    int create_manager_i (void);
    ALLOCATOR *allocator_;
    ACE_Name_Space_Map <ALLOCATOR> *name_space_map_;
    ACE_Naming_Context::Context_Scope_Type ns_scope_;
    ACE_Name_Options *name_options_;
    TCHAR context_file_[MAXPATHLEN + MAXNAMELEN];
    ACE_LOCK *lock_;
};
```

## DESCRIPTION

Manages a Naming Service for a local name space which includes bindings for node\_local and host\_local naming contexts.  All strings are stored in wide character format. A Name Binding consists of a name (that's the key), a value string and an optional type string (no wide chars).

## Initialization and termination methods.

```
ACE_Local_Name_Space (void);
```

"Do-nothing" constructor.

```
ACE_Local_Name_Space (
    ACE_Naming_Context::Context_Scope_Type scope_in,
    ACE_Name_Options *name_options
    );
```

Specifies the scope of this namespace, opens and memory-maps the associated file (if accessible) or contacts the dedicated name server process for NET\_LOCAL namespace.

```
int open (ACE_Naming_Context::Context_Scope_Type scope_in);
```

Specifies the scope of this namespace, opens and memory-maps the associated file (if accessible) or contacts the dedicated name server process for NET\_LOCAL namespace.

```
~ACE_Local_Name_Space (void);
```

destructor, do some cleanup :TBD: last dtor should "compress" file

```
virtual int bind (
    const ACE_WString &name,
    const ACE_WString &value,
    const char *type = ""
    );
```

Bind a new name to a naming context (Wide character strings).

```
virtual int rebind (
    const ACE_WString &name,
    const ACE_WString &value,
    const char *type = ""
    );
```

Overwrite the value or type of an existing name in a ACE\_Local\_Name\_Space or bind a new name to the context, if it didn't exist yet. (Wide charcter strings interface).

```
virtual int unbind (const ACE_WString &name);
```

```
virtual int unbind_i (const ACE_WString &name);
```

Delete a name from a ACE\_Local\_Name\_Space (Wide charcter strings Interface).

```
virtual int resolve (
    const ACE_WString &name,
    ACE_WString &value,
    char *&type
    );
```

```
virtual int resolve_i (
    const ACE_WString &name,
    ACE_WString &value,
    char *&type
    );
```

Get value and type of a given name binding (Wide chars).  The caller is responsible for deleting type!

```
virtual int list_names (
    ACE_WSTRING_SET &set,
    const ACE_WString &pattern
    );
```

```
virtual int list_names_i (
    ACE_WSTRING_SET &set,
    const ACE_WString &pattern
    );
```

Get a set of names matching a specified pattern (wchars). Matching means the names must begin with the pattern string.

```
virtual int list_values (
    ACE_WSTRING_SET &set,
    const ACE_WString &pattern
    );
```

```
virtual int list_values_i (
    ACE_WSTRING_SET &set,
    const ACE_WString &pattern
    );
```

Get a set of values matching a specified pattern (wchars). Matching means the values must begin with the pattern string.

```
virtual int list_types (
    ACE_WSTRING_SET &set,
    const ACE_WString &pattern
    );
```

```
virtual int list_types_i (
    ACE_WSTRING_SET &set,
    const ACE_WString &pattern
    );
```

Get a set of types matching a specified pattern (wchars). Matching means the types must begin with the pattern string.

```
virtual int list_name_entries (
    ACE_BINDING_SET &set,
    const ACE_WString &pattern
    );
```

```
virtual int list_name_entries_i (
    ACE_BINDING_SET &set,
    const ACE_WString &pattern
    );
```

Get a set of names matching a specified pattern (wchars). Matching means the names must begin with the pattern string. Returns the complete binding associated each pattern match.

```
virtual int list_value_entries (
    ACE_BINDING_SET &set,
    const ACE_WString &pattern
    );
```

```
virtual int list_value_entries_i (
    ACE_BINDING_SET &set,
    const ACE_WString &pattern
    );
```

Get a set of values matching a specified pattern (wchars). Matching means the values must begin with the pattern string. Returns the complete binding associated each pattern match.

```
virtual int list_type_entries (
    ACE_BINDING_SET &set,
    const ACE_WString &pattern
    );
```

```
virtual int list_type_entries_i (
    ACE_BINDING_SET &set,
    const ACE_WString &pattern
    );
```

Get a set of types matching a specified pattern (wchars). Matching means the types must begin with the pattern string. Returns the complete binding associated each pattern match.

```
virtual void dump (void) const;
```

```
virtual void dump_i (void) const;
```

Dump the state of the object

## I just know this is going to cause problems on some platform...

```
    typedef ACE_Allocator_Adapter <ACE_Malloc <ACE_MEM_POOL_2, ACE_LOCK> >  ALLOCATOR;

```

## AUTHOR

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

## LIBRARY

ACE
