![]() |
OpenMS
|
A generator for unique ids. More...
#include <OpenMS/CONCEPT/UniqueIdGenerator.h>
Static Public Member Functions | |
| static UInt64 | getUniqueId () |
| Returns a new unique id. | |
| static std::string | getUUID () |
| Returns a new random UUID (version 4) | |
| static void | setSeed (const UInt64) |
| Initializes random generator using the given value. | |
| static UInt64 | getSeed () |
| Get the seed. | |
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 std::mt19937_64 * | rng_ |
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 std::mt19937_64 (MT19937-64), whose output sequence is fully specified by the algorithm and therefore identical on every platform and standard library. Ids are the raw 64-bit engine output: drawing them through a uniform distribution over the complete UInt64 range would be the identity.
|
protected |
|
protected |
|
private |
|
staticprivate |
|
static |
Get the seed.
|
static |
Returns a new unique id.
|
static |
Returns a new random UUID (version 4)
Formatted as the standard 36-character string "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".
|
private |
|
static |
Initializes random generator using the given value.
|
staticprivate |
|
staticprivate |
|
staticprivate |