| OpenMS 2.5.0

Static Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
UniqueIdGenerator Class Reference
Concept

A generator for unique ids. More...

`#include <OpenMS/CONCEPT/UniqueIdGenerator.h>`

## Static Public Member Functions

static UInt64 | getUniqueId ()
| Returns a new unique id. More...
static void | setSeed (const UInt64)
| Initializes random generator using the given value. More...
static UInt64 | getSeed ()
| Get the seed. More...

## Protected Member Functions

| UniqueIdGenerator ()
| ~UniqueIdGenerator ()

## Private Member Functions

void | init_ ()
| UniqueIdGenerator (const UniqueIdGenerator &)

## Static Private Member Functions

static UniqueIdGenerator & | getInstance_ ()

## Static Private Attributes

static UInt64 | seed_
static UniqueIdGenerator * | instance_
static boost::mt19937_64 * | rng_
static boost::uniform_int< UInt64 > * | dist_

## Detailed Description

A generator for unique ids.

The unique ids are 64-bit random unsigned random integers. The class is implemented as a singleton. The random generator is implemented using boost::random.

## Constructor & Destructor Documentation

## ◆ UniqueIdGenerator() [1/2]

UniqueIdGenerator | ( |  | ) |

protected

## ◆ ~UniqueIdGenerator()

~UniqueIdGenerator | ( |  | ) |

protected

## ◆ UniqueIdGenerator() [2/2]

UniqueIdGenerator | ( | const UniqueIdGenerator & |  | ) |

private

## Member Function Documentation

## ◆ getInstance_()

static UniqueIdGenerator& getInstance_ | ( |  | ) |

static private

## ◆ getSeed()

static UInt64 getSeed | ( |  | ) |

static

Get the seed.

## ◆ getUniqueId()

static UInt64 getUniqueId | ( |  | ) |

static

Returns a new unique id.

Referenced by UniqueIdInterface::ensureUniqueId(), and UniqueIdInterface::setUniqueId().

## ◆ init_()

void init_ | ( |  | ) |

private

## ◆ setSeed()

static void setSeed | ( | const UInt64 |  | ) |

static

Initializes random generator using the given value.

## Member Data Documentation

## ◆ dist_

boost::uniform_int<UInt64>* dist_

static private

## ◆ instance_

UniqueIdGenerator* instance_

static private

## ◆ rng_

boost::mt19937_64* rng_

static private

## ◆ seed_

UInt64 seed_

static private