---
name: "ACE_Cleanup_Adapter"
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_Cleanup_Adapter"
---

# ACE\_Cleanup\_Adapter(3)

Adapter for ACE\_Cleanup objects that allows them to be readily managed by the ACE\_Object\_Manager.

## NAME

ACE\_Cleanup\_Adapter -  Adapter for ACE\_Cleanup objects that allows them to be readily managed by the ACE\_Object\_Manager.

## SYNOPSIS

```
#include <ace/Managed_Object.h>
template<class TYPE>
class ACE_Cleanup_Adapter : public ACE_Cleanup
{
  public:
    ACE_Cleanup_Adapter (void);
    virtual ~ACE_Cleanup_Adapter (void);
    TYPE &object (void);
  private:
    TYPE object_;
};
```

## DESCRIPTION

This template class adapts an object of any type to be an ACE\_Cleanup object.  The object can then be destroyed type-safely by the ACE\_Object\_Manager.  This class is typically used to replace a cast; but, it's a bit cleaner and allows insertion of, say, run-time type identification internally if desired.

## PUBLIC MEMBERS

```
ACE_Cleanup_Adapter (void);
```

Default constructor.

```
virtual ~ACE_Cleanup_Adapter (void);
```

Virtual destructor, needed by some compilers for vtable placement.

```
TYPE &object (void);
```

Accessor for contained object.

## PRIVATE MEMBERS

```
TYPE object_;
```

Contained object.

## AUTHORS

David L. Levine

## LIBRARY

ace
