ACE_Incremental_Key_Generator3
Defines a simple incremental key generator.
Usage
#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_;
};
Overview
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.
Library
ace