---
name: "ACE_Addr"
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_Addr"
---

# ACE\_Addr(3)

Defines the base class for the "address family independent" address format.

## NAME

ACE\_Addr -  Defines the base class for the "address family independent" address format.

## SYNOPSIS

```
#include <ace/Addr.h>
class ACE_Addr
{
  public:
    ACE_Addr (int type = -1, int size = -1);
    virtual ~ACE_Addr (void);
    int get_size (void) const;
    void set_size (int size);
    int get_type (void) const;
    void set_type (int type);
    virtual void *get_addr (void) const;
    virtual void set_addr (void *, int len);
    int operator == (const ACE_Addr &sap) const;
    int operator != (const ACE_Addr &sap) const;
    void base_set (int type, int size);
    static const ACE_Addr &sap_any (void);
    static const ACE_Addr sap_any;
    virtual u_long hash (void) const;
    void dump (void) const;
    ACE_ALLOC_HOOK_DECLARE;
  protected:
    int addr_type_;
    int addr_size_;
};
```

## Initialization and termination methods.

```
ACE_Addr (int type = -1, int size = -1);
```

Initializes instance variables.

```
virtual ~ACE_Addr (void);
```

Destructor.

## Get/set the size of the address.

```
int get_size (void) const;
```

Return the size of the address.

```
void set_size (int size);
```

Sets the size of the address.

## Get/set the type of the address.

```
int get_type (void) const;
```

Get the type of the address.

```
void set_type (int type);
```

Set the type of the address.

```
virtual void *get_addr (void) const;
```

Return a pointer to the address.

```
virtual void set_addr (void *, int len);
```

Set a pointer to the address.

## Equality/inequality tests

```
int operator == (const ACE_Addr &sap) const;
```

Check for address equality.

```
int operator != (const ACE_Addr &sap) const;
```

Check for address inequality.

```
void base_set (int type, int size);
```

Initializes instance variables.

```
static const ACE_Addr &sap_any (void);
```

Wild-card address.

This #define works around broken C++ compilers...

```
static const ACE_Addr sap_any;
```

Wild-card address.

```
virtual u_long hash (void) const;
```

Returns a hash value.  This should be overwritten by a subclass which can produce a better hash value.

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

Dump the state of an object.

```
ACE_ALLOC_HOOK_DECLARE;
```

Declare the dynamic allocation hooks.

## AUTHOR

Doug Schmidt

## LIBRARY

ace
