PWToolBox::UIDGenerator Class Reference

This is a lightweight class for generating unique identifiers. More...

#include <UIDGenerator.h>

List of all members.

Public Types

typedef boost::uintmax_t UID
 Let the counter be the maximum-sized unsigned integer available.

Public Member Functions

 UIDGenerator ()
 Creates a new UIDGenerator with an initial ID of 0.
UID const getNextID ()
 Retreives the next ID and increments the ID.


Detailed Description

This is a lightweight class for generating unique identifiers.

Note that the numbers generated are not globally unique. Two UIDGenerators may return the same IDs.

The counter is an implementation-defined maximum width integer. This is typically 64 bits, yielding a max value of 18446744073709551615. If more identifiers are needed, multiple UIDGenerators could be used together.

UIDGenerators are noncopyable.


Member Typedef Documentation

typedef boost::uintmax_t PWToolBox::UIDGenerator::UID

Let the counter be the maximum-sized unsigned integer available.


Constructor & Destructor Documentation

PWToolBox::UIDGenerator::UIDGenerator (  )  [inline]

Creates a new UIDGenerator with an initial ID of 0.


Member Function Documentation

UID const PWToolBox::UIDGenerator::getNextID (  )  [inline]

Retreives the next ID and increments the ID.

Returns:
The next ID


The documentation for this class was generated from the following file:
Generated on Sun Jul 13 14:18:26 2008 for PWToolBox by  doxygen 1.5.1