Reference

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 [email protected]

LIBRARY

ace