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
18namespace OpenMS
19{
20
21 class DateTime;
22
32 class OPENMS_DLLAPI UniqueIdGenerator
33 {
34
35public:
36
39
41 static void setSeed(const UInt64);
42
44 static UInt64 getSeed();
45
46protected:
49
50private:
51 static UInt64 seed_;
53 static boost::mt19937_64* rng_;
54 static boost::uniform_int<UInt64>* dist_;
55
57 void init_();
58 UniqueIdGenerator(const UniqueIdGenerator& );//protect from c++ auto-generation
59 };
60
61} // namespace OpenMS
62
A generator for unique ids.
Definition UniqueIdGenerator.h:33
static UniqueIdGenerator & getInstance_()
static UInt64 getSeed()
Get the seed.
static boost::mt19937_64 * rng_
Definition UniqueIdGenerator.h:53
static UInt64 getUniqueId()
Returns a new unique id.
static boost::uniform_int< UInt64 > * dist_
Definition UniqueIdGenerator.h:54
static void setSeed(const UInt64)
Initializes random generator using the given value.
static UInt64 seed_
Definition UniqueIdGenerator.h:51
static UniqueIdGenerator * instance_
Definition UniqueIdGenerator.h:52
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