---
name: "ACE_Free_List"
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_Free_List"
---

# ACE\_Free\_List(3)

Implements a free list.

## NAME

ACE\_Free\_List -  Implements a free list.

## SYNOPSIS

```
#include <ace/Free_List.h>
template<class T>
class ACE_Free_List
{
  public:
    virtual ~ACE_Free_List (void);
    virtual void add (T *element) = 0;
    virtual T *remove (void) = 0;
    virtual size_t size (void) = 0;
    virtual void resize (size_t newsize) = 0;
};
```

## DESCRIPTION

This class maintains a free list of nodes of type T.

## PUBLIC MEMBERS

```
virtual ~ACE_Free_List (void);
```

Destructor - removes all the elements from the free\_list.

```
virtual void add (T *element) = 0;
```

Inserts an element onto the free list (if it isn't past the high water mark).

```
virtual T *remove (void) = 0;
```

Takes a element off the freelist and returns it.  It creates inc new elements if the size is at or below the low water mark.

```
virtual size_t size (void) = 0;
```

Returns the current size of the free list.

```
virtual void resize (size_t newsize) = 0;
```

Resizes the free list to newsize.

## AUTHOR

Darrell Brunsch (brunsch@cs.wustl.edu)

## LIBRARY

ace
