---
name: "ACE_Incremental_Key_Generator"
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_Incremental_Key_Generator"
---

# ACE\_Incremental\_Key\_Generator(3)

Defines a simple incremental key generator.

## NAME

ACE\_Incremental\_Key\_Generator -  Defines a simple incremental key generator.

## SYNOPSIS

```
#include <ace/Map_T.h>
template<class T>
class ACE_Incremental_Key_Generator
{
  public:
    ACE_Incremental_Key_Generator (void);
    int operator () (T &t);
    T& current_value (void);
  protected:
    T t_;
};
```

## DESCRIPTION

Generates a new key of type T by incrementing current value. Requirements on T are:

  \- Constructor that accepts 0 in the constructor.\
   \- Prefix increment.\
   \- Assignment.

Note that a primitive types such as u\_long, int, etc., are suitable for this class.

## PUBLIC MEMBERS

```
ACE_Incremental_Key_Generator (void);
```

Constructor.

```
int operator () (T &t);
```

Functor method: generates a new key.

```
T& current_value (void);
```

Returns the current value.

## PROTECTED MEMBERS

```
T t_;
```

Current value.

## AUTHOR

Irfan Pyarali irfan@cs.wustl.edu

## LIBRARY

ace
