OpenMS
Loading...
Searching...
No Matches
UniqueIdGenerator.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Timo Sachsenberg $
6// $Authors: $
7// --------------------------------------------------------------------------
8
9#pragma once
10
12
13#include <boost/random/mersenne_twister.hpp>
14#include <boost/random/variate_generator.hpp>
15#include <boost/random/uniform_int.hpp>
16
17#include <string>
18
19
20namespace OpenMS
21{
22
23 class DateTime;
24
34 class OPENMS_DLLAPI UniqueIdGenerator
35 {
36
37public:
38
41
48 static std::string getUUID();
49
51 static void setSeed(const UInt64);
52
54 static UInt64 getSeed();
55
56protected:
59
60private:
61 static UInt64 seed_;
63 static boost::mt19937_64* rng_;
64 static boost::uniform_int<UInt64>* dist_;
65
67 void init_();
68 UniqueIdGenerator(const UniqueIdGenerator& );//protect from c++ auto-generation
69 };
70
71} // namespace OpenMS
72
A generator for unique ids.
Definition UniqueIdGenerator.h:35
static UniqueIdGenerator & getInstance_()
static UInt64 getSeed()
Get the seed.
static boost::mt19937_64 * rng_
Definition UniqueIdGenerator.h:63
static UInt64 getUniqueId()
Returns a new unique id.
static boost::uniform_int< UInt64 > * dist_
Definition UniqueIdGenerator.h:64
static void setSeed(const UInt64)
Initializes random generator using the given value.
static std::string getUUID()
Returns a new random UUID (version 4)
static UInt64 seed_
Definition UniqueIdGenerator.h:61
static UniqueIdGenerator * instance_
Definition UniqueIdGenerator.h:62
UniqueIdGenerator(const UniqueIdGenerator &)
uint64_t UInt64
Unsigned integer type (64bit)
Definition Types.h:47
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19